The Power of Buildpacks in a Platform as-a-Service (PaaS)

  • 491 views
Uploaded on

uildpacks are the primary method for deploying applications in Stackato. In essence a buildpack is a network-available directory containing a handful of configuration scripts used to set up containers …

uildpacks are the primary method for deploying applications in Stackato. In essence a buildpack is a network-available directory containing a handful of configuration scripts used to set up containers to provision cloud applications. Developed by Heroku, buildpacks are part of the Cloud Foundry v2 architecture. Understanding their use and power in a private PaaS is important in order give you the flexibility you need to deploy almost any applications, regardless of its complexity, technology stack, or dependencies. Buildpacks will help your users tremendously by setting up the exact environment according to their application needs.

In this webinar, Technology Evangelist, John Wetherill, and Cloud Engineer, Ho Ming Li, will discuss the power of buildpacks in more detail. You will learn:

- What a buildpack is
- The history/origins of buildpacks
- Which sites and services support buildpacks today
- Who uses buildpacks and why they are important
- How buildpacks work
- How custom buildpacks are used and created
- Buildpack alternatives / alternate approaches
- Buildpack limitations and gotchas
- The future of buildpacks

http://www.activestate.com/webinars/power-buildpacks-paas

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
491
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
29
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. The Power of Buildpacks in PaaS The Platform for the Agile Enterprise John Wetherill Technology Evangelist Ho Ming Li Cloud Engineer
  • 2. Recent Events activestate.com/stackato | @activestate | #stackato | activestate.com/blog | Copyright 2014
  • 3. Recent Events activestate.com/stackato | @activestate | #stackato | activestate.com/blog | Copyright 2014
  • 4. What is Stackato? A secure, stable, and commercially supported Platform-as-aService (PaaS) built with open source components such as Cloud Foundry and Docker activestate.com/stackato | @activestate | #stackato | activestate.com/blog | Copyright 2014
  • 5. Buildpacks Defined “Cloud Foundry uses buildpacks to transform user-provided artifacts into runnable applications” Buildpacks can be used to: • • • • examine user-provided artifacts download dependencies configure application properties specify the application entry point and runtime options activestate.com/stackato | @activestate | #stackato | activestate.com/blog | Copyright 2014
  • 6. Anatomy of a Buildpack • a buildpack is a network-accessible git repository • repo must contain a bin directory with three scripts bin/detect bin/release bin/compile activestate.com/stackato | @activestate | #stackato | activestate.com/blog | Copyright 2014
  • 7. detect script • determine whether to apply a buildpack • single parameter: BUILD_DIR • script examines this directory If buildpack can service this app: • print framework name to stdout • exit 0 activestate.com/stackato | @activestate | #stackato | activestate.com/blog | Copyright 2014
  • 8. sample detect script #!/bin/sh if [-f $1/*.js]; then # looks like a node application echo “nodejs” exit 0 else exit 1 fi activestate.com/stackato | @activestate | #stackato | activestate.com/blog | Copyright 2014
  • 9. compile script • perform the buildpack transformation • three parameters: BUILD_DIR CACHE_DIR ENV_DIR • anything goes here: download dependencies, configure environment, tweak files activestate.com/stackato | @activestate | #stackato | activestate.com/blog | Copyright 2014
  • 10. sample compile script #!/bin/sh if [ ! -s $1/hello.txt ]; then echo "hello.txt was empty" exit 1 fi cat $1/hello.txt | sed -e "s/[Hh]ello/Goodbye/g" > $1/goodbye.txt activestate.com/stackato | @activestate | #stackato | activestate.com/blog | Copyright 2014
  • 11. sample compile script #!/bin/sh wget something apt-get install something-else echo “some: config” > config-file.yml activestate.com/stackato | @activestate | #stackato | activestate.com/blog | Copyright 2014
  • 12. release script • release script must output yaml • specify “addons” • specify Procfile entries (app entrypoint) (config_vars from Heroku deprecated - use shell-script in app instead) activestate.com/stackato | @activestate | #stackato | activestate.com/blog | Copyright 2014
  • 13. sample release script #!/usr/bin/env bash cat <<EOF --web: java $JAVA_OPT jetty-runner --port $PORT addons: mysql:dev EOF activestate.com/stackato | @activestate | #stackato | activestate.com/blog | Copyright 2014
  • 14. Procfile • Not part of buildpack • Specifies app entrypoint • Procfile must be present in app build dir Sample procfile for Java app: web: java $JAVA_OPTS jetty-runner --port $PORT activestate.com/stackato | @activestate | #stackato | activestate.com/blog | Copyright 2014
  • 15. CloudFoundry / Stackato built-in buildpacks For Java, Ruby, NodeJS • https://github.com/cloudfoundry/java-buildpack • https://github.com/cloudfoundry/heroku-buildpack-ruby • https://github.com/cloudfoundry/heroku-buildpack-nodejs activestate.com/stackato | @activestate | #stackato | activestate.com/blog | Copyright 2014
  • 16. CloudFoundry Community Buildpacks https://github.com/cloudfoundry-community/cf-docs-contrib/wiki/Buildpacks activestate.com/stackato | @activestate | #stackato | activestate.com/blog | Copyright 2014
  • 17. Summary Procfile Buildpack Application source activestate.com/stackato | @activestate | #stackato | activestate.com/blog | Copyright 2014
  • 18. Minimal buildpack https://github.com/heroku/heroku-buildpack-hello activestate.com/stackato | @activestate | #stackato | activestate.com/blog | Copyright 2014
  • 19. Buildpacks and stackato.yml stackato.yml is used in conjunction with buildpack to: • specify buildpack location • configure environment • specify staging and runtime hooks • request services • request resources • specify app properties activestate.com/stackato | @activestate | #stackato | activestate.com/blog | Copyright 2014
  • 20. Specifying Buildpacks • Buildpack can be selected in stackato.yml: buildpack: https://github.com/user/mybuildpack.git • Or as option to stackato command: stackato push --buildpack ssh://git/buildpack.git activestate.com/stackato | @activestate | #stackato | activestate.com/blog | Copyright 2014
  • 21. Legacy Buildpack • special bundled buildpack for “legacy” Stackato apps • provides all frameworks from pre 3.0 Stackato • specify framework and runtime in stackato.yml name: bottle-py3 framework: type: python runtime: python32 activestate.com/stackato | @activestate | #stackato | activestate.com/blog | Copyright 2014
  • 22. Buildpack Catalog http://buildpack-catalog.stacka.to/buildpacks/ activestate.com/stackato | @activestate | #stackato | activestate.com/blog | Copyright 2014
  • 23. Customizing a buildpack Why customize? • alternate versions of runtimes, frameworks, services • new (or old) runtimes (FORTRAN anyone?) • complete control of app provisioning process activestate.com/stackato | @activestate | #stackato | activestate.com/blog | Copyright 2014
  • 24. Customizing a buildpack Three simple steps: 1. fork an existing buildpack 2. tweak the scripts in bin, add assets 3. specify location of new buildpack in stackato.yml or as parameter to “stackato push --buildpack https://…” activestate.com/stackato | @activestate | #stackato | activestate.com/blog | Copyright 2014
  • 25. Buildpacks and Licenses EULAs Software license strings API keys Commercial Software Example: https://github.com/cloudfoundry/ibm-websphere-liberty-buildpack.git activestate.com/stackato | @activestate | #stackato | activestate.com/blog | Copyright 2014
  • 26. Buildpack Futures Better Asset Caching More services and frameworks Docker Integration? activestate.com/stackato | @activestate | #stackato | activestate.com/blog | Copyright 2014
  • 27. Why Enterprises Use Stackato Faster Time to Market With Stackato, developers can get apps to the cloud in minutes, not weeks. Greater Security Stackato has been extended and hardened to provide enterprises with tighter security, better compliance, and more control over secure, sensitive data. Agility and Scalability As usage grows, Stackato scales applications to deliver performance for end-users demand. Productivity and Innovation Stackato automates the configuration, deployment, and management of applications. Flexibility Stackato gives developers and IT managers the freedom they need. The polyglot nature of Stackato means you can give your developers the flexibility to work with the best choice of language for any task. activestate.com/stackato | @activestate | #stackato | activestate.com/blog | Copyright 2014
  • 28. Download your own Stackato micro cloud at: http://www.activestate.com/stackato