Posts

Showing posts from December, 2017

http://bitdownload.ir/

http://bitdownload.ir/

manifest yaml inherit

parent: --- applications: - name: foo buildpack: teapot child: --- inherit: parent.yml applications: - name: foo buildpack: kettle

What is Cloud Foundry?

An open  Platform as a Service  ( PaaS ) Fast and easy to build, test, deploy & scale apps Works with any* language or framework Find out more at  docs.cloudfoundry.org Note: Open-source with an Apache license, hosted on GitHub. Developers use the cf command line utility to interact with a CF deployment. The cf cli is pre-built for Windows, Mac and Linux. CF supports any language or framework through buildpacks. More on that subject later.

How do I target a different org and/or space?

$ cf target -o ORG -s SPACE

What happens when I cf push?

App files sent to CF Runnable app artefact is created (droplet) App starts on an app host App receives web requests (if it binds to TCP port) 1.  App files  sent to CF By the  cf  cli, no other dependency required Define in  .cfignore  files that should not be sent Note: cf cli sent all our app files to the Cloud Controller The Cloud Controller stores all files it receives in the Blob Store It also stores metadata about the app in the database 2. Runnable  app artefact App Files + Runtime Dependencies = App Artefact Note: This is done by the Buildpack, part of the staging phase The majority of the output from a cf push is this staging phase You will find more about Buildpacks in the next topic 3.  App starts  on an app host If it's a web process, it binds to a TCP port

Resilient / High Availability

Image
05 How do I make my app resilient? This content is copyright of CloudCredo. © CloudCredo 2015. All rights reserved. Feature As a CF hero I want my app to be resilient So that random failures won't take it offline Let's  ship it # From the training home directory: $ cd 05-resilience/imperfect-app $ cf push ... urls: imperfect-app-votive-seeress.cfapps.io ... You've shipped  your new app! The static website is handling the traffic wonderfully Everyone wants to use your new app, but... It  crashes Version 1 Sucks, But Ship It Anyway Note:  Coding Horror wisdom How to  make an app resilient ? Embrace failure & run many instances of the same app $ cf scale imperfect-app -i 3 $ cf apps name state instances memory disk urls imperfect-app started 2/3 64M 256M imperfect.. Note: Because CF is running your app, running many instances of it is just a command away Notice the different IPs that your app instances are running on......

Buildpacks

Image
04 What are buildpacks? This content is copyright of CloudCredo. © CloudCredo 2015. All rights reserved. Feature As a CF hero I want a simple static website So that I can focus on building my product What are  buildpacks ? A Cloud Foundry component that  resolves your app's runtime dependencies Why  buildpacks ? Simplify app deployment - focus on your code Fewer files, quicker app deploys Produce self-contained, runnable app artefacts What does a  buildpack  do? Input is the application code Examines application and fulfils dependencies Output is a droplet Metadata output defines ENV vars and start command Each buildpack participates in election How does a  buildpack  work? bin/detect bin/compile bin/release Where does the  buildpack  run? Uses the host kernel with a rootfs (jeos) Default rootfs is cflinuxfs2 (based on Ubuntu 14.04 Trusty) Buildpack execution and app runtime are in containers Cloud Foundry uses  Garden  for containe...

Debug CF

Image
06 How do I debug my app? This content is copyright of CloudCredo. © CloudCredo 2015. All rights reserved. Feature As a CF hero I want to know what my CF app is doing So that I can debug it Push  a buggy app # From the training home directory: $ cd 06-debugging/debug-app $ cf push ... urls: debug-app-unerring-muddlehead.cfapps.io ... How do I  debug my app ? App logs App events App instrumentation SSH access 1. App  logs $ cf logs debug-app --recent ... ... [App/0] ERR ... - RuntimeError - I am a bug, fix me: ... [App/0] ERR /home/vcap/app/config.ru:20:in ` block in < class:Web > $ cf logs debug-app # Tails app logs, CTRL + C to exit Let's  fix the app $ cf set-env debug-app FIXED true $ cf restart debug-app 2. App  events $ cf events debug-app ... description ... index: 0, reason: CRASHED, exit_description: 2 error(s) ... ... Note: Notice that the most recent event is at the top 3. App  instrumentation New Relic AppDynamics Included in Java buil...