GithubHelp home page GithubHelp logo

isabella232 / diego-docker-cache-release Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cloudfoundry-attic/diego-docker-cache-release

0.0 0.0 0.0 153 KB

BOSH release for Diego Docker Cache

License: Apache License 2.0

Shell 91.50% HTML 5.74% Ruby 2.77%

diego-docker-cache-release's Introduction

diego-docker-cache

BOSH release for Diego Docker Cache


Initial Setup

This BOSH release doubles as a $GOPATH. It will automatically be set up for you if you have direnv installed.

# fetch release repo
mkdir -p ~/workspace
cd ~/workspace
git clone https://github.com/cloudfoundry-incubator/diego-docker-cache.git
cd diego-docker-cache/

# automate $GOPATH and $PATH setup
direnv allow

# initialize and sync submodules
./scripts/update

If you do not wish to use direnv, you can simply source the .envrc file in the root of the release repo. You may manually need to update your $GOPATH and $PATH variables as you switch in and out of the directory.


Deploying to a local BOSH-Lite instance

  1. Follow the instructions in Diego Release and install CF

  2. When generating the Diego's manifest (step 9) use the following set of files instead:

     cd ~/workspace/diego-release
     ./scripts/generate-deployment-manifest \
       ~/workspace/diego-docker-cache-release/stubs-for-diego-release/bosh-lite-property-overrides.yml \
       manifest-generation/bosh-lite-stubs/instance-count-overrides.yml \
       manifest-generation/bosh-lite-stubs/persistent-disk-overrides.yml \
       manifest-generation/bosh-lite-stubs/iaas-settings.yml \
       manifest-generation/bosh-lite-stubs/additional-jobs.yml \
       manifest-generation/bosh-lite-stubs/release-versions.yml \
       ~/workspace/cf-release/bosh-lite/deployments \
       > ~/workspace/diego-release/bosh-lite/deployments/diego.yml
     bosh deployment ~/workspace/diego-release/bosh-lite/deployments/diego.yml
    
  3. Deploy Diego:

     bosh create release --force
     bosh -n upload release
     bosh -n deploy
    
  4. Generate and target Diego Docker Cache's manifest:

     cd ~/workspace/diego-docker-cache-release
     ./scripts/generate-bosh-lite-manifest
     bosh deployment ~/workspace/diego-docker-cache-release/bosh-lite/deployments/docker-cache.yml
    
  5. Deploy the Docker Cache:

     bosh create release --force
     bosh -n upload release
     bosh -n deploy
    

Configuring registry

Backend storage

You can configure the Docker Registry backend storage in property-overrides.yml. Here is what you have to include for each supported storage type:

Filesystem

This is the default storage type. You can simply omit the property overrides or explicitly add:

docker_registry:
  storage:
    name: filesystem

AWS S3

docker_registry:
  storage:
    name: s3
    s3:
      bucket: <bucket name>
      accesskey: <access key>
      secretkey: <secret key>
      region: <region name, i.e. us-east-1>

Save the property changes and then generate the manifest and deploy the Diego Docker Cache release.

TLS

Docker Registry can be configured to use TLS for secure communication. To do this:

  1. Obtain a certificate and key. This can be done with OpenSSL:

     openssl genrsa -out server.key 1024
     openssl req -new -key server.key -out server.csr
     openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
    
  2. Edit property-overrides.yml. You have to add the generated certificate and key:

     docker_registry:
       tls:
         enabled: true
         certificate: |
           -----BEGIN CERTIFICATE-----
           ... content of server.crt file ...
           -----END CERTIFICATE-----
         key: |
           -----BEGIN RSA PRIVATE KEY-----
           ... content of server.key file ...
           -----END RSA PRIVATE KEY-----
    

Save the property changes and then generate the manifest and deploy the Diego Docker Cache release.

Running Acceptance Tests

See docker-cache-acceptance-tests

Caching docker image with Diego

  1. Install CF CLI v6.10.0+ (or follow the guide in Migrating to Diego)

  2. Install diego-beta CLI Plugin

     cf add-plugin-repo CF-Community http://plugins.cloudfoundry.org/
     cf install-plugin Diego-Beta -r CF-Community
    
  3. Login to CF

     cf api --skip-ssl-validation api.10.244.0.34.xip.io
     cf auth admin admin
    
  4. Push your docker application

     cf docker-push <application_name> <docker_image> --no-start
    
  5. Enable caching by setting DIEGO_DOCKER_CACHE boolean environment variable

     cf set-env <application_name> DIEGO_DOCKER_CACHE true
    
  6. Start the application:

     cf start <application_name>
    

diego-docker-cache-release's People

Contributors

cwlbraa avatar emalm avatar georgethebeatle avatar hsiliev avatar infra-red avatar jfmyers9 avatar luan avatar nimakaviani avatar sykesm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.