Git Product home page Git Product logo

diego-release's Introduction

Cloud Foundry Diego [BOSH release]


This repo is a BOSH release for deploying Diego and associated tasks for testing a Diego deployment. Diego builds out the new runtime architecture for Cloud Foundry, replacing the DEAs and Health Manager.

This release relies on a separate deployment to provide NATS and Loggregator. In practice these come from cf-release.

Learn more about Diego and its components at diego-design-notes.


Developer Workflow

When working on individual components of Diego, work out of the submodules under src/. See Initial Setup.

Run the individual component unit tests as you work on them using ginkgo. To see if everything still works, run ./scripts/run-unit-tests in the root of the release.

When you're ready to commit, run:

./scripts/prepare-to-diego <story-id> <another-story-id>...

This will synchronize submodules, update the BOSH package specs, run all unit tests, all integration tests, and make a commit, bringing up a commit edit dialogue. The story IDs correspond to stories in our Pivotal Tracker backlog. You should simultaneously also build the release and deploy it to a local BOSH-Lite environment, and run the acceptance tests. See Running Smoke Tests & DATs.

If you're introducing a new component (e.g. a new job/errand) or changing the main path for an existing component, make sure to update ./scripts/sync-package-specs and ./scripts/sync-submodule-config.


## 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-release.git
cd diego-release/

# automate $GOPATH and $PATH setup
direnv allow

# switch to develop branch (not master!)
git checkout develop

# 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.


Running Unit Tests

  1. Install ginkgo

     go install github.com/onsi/ginkgo/ginkgo
    
  2. Install gnatsd

     go install github.com/apcera/gnatsd
    
  3. Install etcd

     go install github.com/coreos/etcd
    
  4. Install consul

     if uname -a | grep Darwin; then os=darwin; else os=linux; fi
     curl -L -o $TMPDIR/consul-0.5.0.zip "https://dl.bintray.com/mitchellh/consul/0.5.0_${os}_amd64.zip"
     unzip $TMPDIR/consul-0.5.0.zip -d ~/workspace/diego-release/bin
     rm $TMPDIR/consul-0.5.0.zip
    
  5. Run the unit test script

     ./scripts/run-unit-tests
    

Running Integration Tests

  1. Install and start Concourse, following its README.

  2. Install the fly CLI:

     # cd to the concourse release repo,
     cd /path/to/concourse/repo
    
     # switch to using the concourse $GOPATH and $PATH setup temporarily
     direnv allow
    
     # install the version of fly from Concourse's release
     go install github.com/concourse/fly
    
     # add the concourse release repo's bin/ directory to your $PATH
     export PATH=$PWD/bin:$PATH
    
  3. Run Inigo.

     # cd back to the diego-release release repo
     cd diego-release/
    
     # run the tests
     ./scripts/run-inigo
    

Deploying Diego to a local BOSH-Lite instance

  1. Install and start BOSH-Lite, following its README.

  2. Download the latest Warden Trusty Go-Agent stemcell and upload it to BOSH-lite

     bosh public stemcells
     bosh download public stemcell (name)
     bosh upload stemcell (downloaded filename)
    
  3. Checkout cf-release (develop branch) from git

     cd ~/workspace
     git clone [email protected]:cloudfoundry/cf-release.git
     cd ~/workspace/cf-release
     git checkout develop
     ./update
    
  4. Checkout diego-release (develop branch) from git

     cd ~/workspace
     git clone [email protected]:cloudfoundry-incubator/diego-release.git
     cd ~/workspace/diego-release
     git checkout develop
     ./scripts/update
    
  5. Install spiff, a tool for generating BOSH manifests. spiff is required for running the scripts in later steps. The following installation method assumes that go is installed. For other ways of installing spiff, see the spiff README.

     go get github.com/cloudfoundry-incubator/spiff
    
  6. Generate a deployment stub with the BOSH director UUID

     mkdir -p ~/deployments/bosh-lite
     cd ~/workspace/diego-release
     ./scripts/print-director-stub > ~/deployments/bosh-lite/director.yml
    
  7. Generate and target cf-release manifest:

     cd ~/workspace/cf-release
     ./generate_deployment_manifest warden \
         ~/deployments/bosh-lite/director.yml \
         ~/workspace/diego-release/stubs-for-cf-release/enable_diego_docker_in_cc.yml \
         ~/workspace/diego-release/stubs-for-cf-release/enable_consul_with_cf.yml \
         ~/workspace/diego-release/stubs-for-cf-release/enable_diego_ssh_in_cc.yml \
         ~/workspace/diego-release/manifest-generation/bosh-lite-stubs/property-overrides.yml \
         > ~/deployments/bosh-lite/cf.yml
     bosh deployment ~/deployments/bosh-lite/cf.yml
    
  8. Do the BOSH dance:

     cd ~/workspace/cf-release
     bosh create release --force
     bosh -n upload release
     bosh -n deploy
    
  9. Generate and target diego's manifest:

     cd ~/workspace/diego-release
     ./scripts/generate-deployment-manifest \
         ~/deployments/bosh-lite/director.yml \
         manifest-generation/bosh-lite-stubs/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 \
         ~/deployments/bosh-lite \
         > ~/deployments/bosh-lite/diego.yml
     bosh deployment ~/deployments/bosh-lite/diego.yml
    
  10. Dance some more:

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

Now you can either run the DATs or deploy your own app.


### Running Smoke Tests & DATs

You can test that your diego-release deployment is working and integrating with cf-release by running the lightweight diego-smoke-tests or the more thorough diego-acceptance-tests. Follow the READMEs in their respective repositories:

  • src/github.com/cloudfoundry-incubator/diego-smoke-tests
  • src/github.com/cloudfoundry-incubator/diego-acceptance-tests

Pushing an Application to Diego

  1. Create new CF Org & Space:

     cf api --skip-ssl-validation api.10.244.0.34.xip.io
     cf auth admin admin
     cf create-org diego
     cf target -o diego
     cf create-space diego
     cf target -s diego
    
  2. Push your application without starting it:

     cf push my-app --no-start
    
  3. Enable Diego for your application.

  4. Start your application:

     cf start my-app
    

diego-release's People

Contributors

vito avatar sykesm avatar emalm avatar onsi avatar krishicks avatar hsiliev avatar nwade avatar atulkc avatar jfmyers9 avatar lvarvel avatar georgethebeatle avatar matt-royal avatar leochu avatar mokiat avatar dliebreich avatar maxbrunsfeld avatar luan avatar mariash avatar parente avatar stefanschneider avatar dgoddard avatar jchesterpivotal avatar fraenkel avatar amitkgupta avatar fate-grand-order avatar karlkfi avatar

Watchers

James Cloos avatar lingesh-happiestminds 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.