Skip to content

Instantly share code, notes, and snippets.

@suhlig
Created December 8, 2017 15:48
Show Gist options
  • Save suhlig/0eac59e5b2451b949f6cdaa353a6e0c6 to your computer and use it in GitHub Desktop.
Save suhlig/0eac59e5b2451b949f6cdaa353a6e0c6 to your computer and use it in GitHub Desktop.
Presentation on the Cloud Foundry Application Lifecycle

Cloud Foundry Application Lifecycle

Abstract

What happens between cf push and "state: running"? We will have a look at how the Cloud Foundry part of the IBM Cloud creates and manages applications. Attending this session will give you an in-depth understanding of application deployment works and where to look in case of trouble. (edited)

Happy Day

cd ~/workspace/cf-acceptance-tests/assets/dora
cf push cloudora
cf logs cloudora
curl http://cloudora.eu-de.mybluemix.net
  1. Show the flow
  2. Walk through output of cf push

App Output

stdout

curl 'http://cloudora.eu-de.mybluemix.net/echo/stdout/This%20is%20a%20vvveeerrryyy%0Alllooonnnggg%20ttteeexxxttt'

stderr

curl 'http://cloudora.eu-de.mybluemix.net/echo/stderr/The%20world%20is%20coming%20to%20an%20end'

Understanding the log output

RTR
CELL
APP/PROC/WEB

Explain

  • HTTP status code
  • vcap_request_id
  • response_time

Scale to two instances

cf scale cloudora -i 2
curl http://cloudora.eu-de.mybluemix.net/id

Explain where to find instance id in the logs:

curl http://cloudora.eu-de.mybluemix.net/health

What happens if the app dies?

curl http://cloudora.eu-de.mybluemix.net/sigterm/TERM

SSH Access

cf ssh cloudora

Error Scenarios

Start command fails

cf push cloudora -c false

This is a stateful setting; reset it with

cf push cloudora -c null

Wrong Port

cf push cloudora -c 'bundle exec rackup -p $RANDOM'

Do the right thing (similar to the default):

cf push cloudora -c 'bundle exec rackup -p $PORT'

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment