diego release

Go Diego Go!

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

A BOSH release for deploying the following Diego components:

  1. Executor
  2. Warden-Linux
  3. Stager
  4. File Server
  5. Runtime Metrics Server
  6. etcd

These components build out the new runtime architecture for Cloud Foundry, replacing the DEA and Health Manager.

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

Deploying Diego to a local Bosh-Lite instance

  1. checkout bosh-lite from git
cd ~/workspace
git clone git@github.com:cloudfoundry/bosh-lite.git
  1. Follow bosh-lite Installation and VMWare Fusion setup steps (requires vmware-fusion license)
cd ~/workspace/bosh-lite
vagrant up
gem install bosh_cli
bosh target 192.168.50.4
bosh login admin admin
./scripts/add-route
  1. Download the latest Warden stemcell and upload it to bosh-lite
wget http://bosh-jenkins-gems-warden.s3.amazonaws.com/stemcells/latest-bosh-stemcell-warden.tgz
bosh upload stemcell latest-bosh-stemcell-warden.tgz
  1. Checkout cf-release (develop branch) from git
cd ~/workspace
git clone git@github.com:cloudfoundry/cf-release.git
cd ~/workspace/cf-release
git checkout develop
./update
  1. Checkout diego-release (develop branch) from git
cd ~/workspace
git clone git@github.com:cloudfoundry-incubator/diego-release.git
cd ~/workspace/diego-release
git checkout develop
./scripts/update
  1. Generate a cf-release stub manifest with the bosh director uuid
mkdir -p ~/workspace/deployments/warden
printf "%s\ndirector_uuid: %s\nreleases: \n  - name: cf\n    version: latest\nproperties:\n  cc:\n    diego: true\n" "---" `bosh status --uuid` > ~/workspace/deployments/warden/cf-director.yml
  1. Generate and target cf-release manifest:
cd ~/workspace/cf-release
./generate_deployment_manifest warden ~/workspace/deployments/warden/cf-director.yml  > ~/workspace/deployments/warden/cf.yml
bosh deployment ~/workspace/deployments/warden/cf.yml
  1. Do the bosh dance:
cd ~/workspace/cf-release
bosh create release --force
bosh -n upload release
bosh -n deploy
  1. Generate a diego warden-director stub manifest with the bosh director uuid:
mkdir -p ~/workspace/deployments/warden
printf "%s\nname: diego\ndirector_uuid: %s" \
  "---" \
  `bosh status --uuid` \
  > ~/workspace/deployments/warden/diego-director.yml
  1. Generate and target diego's manifest:
cd ~/workspace/diego-release
./generate_deployment_manifest warden ../cf-release \
  ~/workspace/deployments/warden/diego-director.yml > \
  ~/workspace/deployments/warden/diego.yml
bosh deployment ~/workspace/deployments/warden/diego.yml
  1. Dance some more:
cd ~/workspace/diego-release
bosh create release --force
bosh -n upload release
bosh -n deploy

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

Running the CATs

Option 1: Run as a BOSH errand

The CF deployment includes the CATs as the acceptance_tests errand, so you can just run them as an errand.

  1. Target the CF deployment:

    bosh deployment ~/workspace/deployments/warden/cf.yml
    
  2. Run the errand:

    bosh run errand acceptance_tests
    

Option 2: Run Locally

If you are making changes to the CATs and want to iterate, you may wish to run the CATs locally. You'll be running ginkgo on your host machine, targetted at your BOSH-lite deployment.

  1. Checkout cf-acceptance-tests
go get -u -v github.com/cloudfoundry/cf-acceptance-tests/...
cd $GOPATH/src/github.com/cloudfoundry/cf-acceptance-tests
  1. Generate a CATs config file:
cd $GOPATH/src/github.com/cloudfoundry/cf-acceptance-tests
cat > integration_config.json <<EOF
{
  "api": "api.10.244.0.34.xip.io",
  "admin_user": "admin",
  "admin_password": "admin",
  "apps_domain": "10.244.0.34.xip.io",
  "skip_ssl_validation": true,
  "nodes": 1,
  "include_diego": true
}
EOF
export CONFIG=$PWD/integration_config.json
  1. Run the diego CATs:
cd $GOPATH/src/github.com/cloudfoundry/cf-acceptance-tests
ginkgo -nodes=4 ./diego
  1. Run the runtime CATs:
cd $GOPATH/src/github.com/cloudfoundry/cf-acceptance-tests
ginkgo -nodes=4 ./apps

Deploying an app

  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
  1. Checkout cf-acceptance-tests (to get, for example, the hello-world app)
go get -u -v github.com/cloudfoundry/cf-acceptance-tests/...
cd $GOPATH/src/github.com/cloudfoundry/cf-acceptance-tests/assets/hello-world
  1. Push hello-world app to CF & Configure it to use Diego
cf push goodbye --no-start
cf set-env goodbye CF_DIEGO_BETA true
cf start goodbye

Running an app

Follow the above instructions, but for step 3:

  1. Push hello-world app to CF & Configure it to use Diego
cf push goodbye --no-start
cf set-env goodbye CF_DIEGO_BETA true
cf set-env goodbye CF_DIEGO_RUN_BETA true
cf push goodbye -i 3 -c ./your/start/command