SlideShare a Scribd company logo
OpenShift Community Day
       Writing Cartridges
    Bill DeCoste
    Principal Software Engineer
    wdecoste@redhat.com




1
Target Audience

You...
● Wish to offer new user services on an OpenShift PaaS
● Customize an existing user service on a PaaS




2
What are Cartridges?
    ●   Cartridge – A technology stack or framework (PHP, Perl, Java/JEE,
        Ruby, Python, MySQL, etc.) definition

    ●   Plugin – Auth, DNS, etc.

    ●   Gear – Allocation of memory, compute, and storage resources for
        running applications. Live on Nodes.

    ●   Application – Instantiation of a Cartridge. Overloaded term, I know.

    ●   Scaled/Scalable Application – Instantiated in multiple Gears




3
Suggestions ...
    ●   Start with a DIY (More significant for Cart V1)
        –   Resolve many installation and configuration issues (e.g. bindings,
            logging)
    ●   Existing Quickstart or sample?
    ●   Start with a similar cartridge
        –   Apache based?
        –   JEE Application Server?
        –   Embeddable Database?




4
Requirements
    ●   The OpenShift Cartridge API consists of:
        –   Executable files
        –   stdout/stderr
        –   Environment variables
    ●   You can use any language but we find bash the fastest
        –   Bash “SDK” provided, other languages planned
    ●   The software you are packaging either needs to be on the system or
        included in your cartridge




5
History – Cartridge V1.0

    ●   Opensource, but not easy to implement or customize
        –   Overly large number of files/scripts
        –   Blurred Node vs Cartridge responsibility
            (e.g. root access required by Cartridge)
        –   Each version required a new Cartridge
    ●   Difficult to maintain
        –   APIs not versioned




6
History – Cartridge V2.0

    ●   Eased implementation, customization, and
        maintenance
         –   Greatly reduced number of files/scripts
         –   Well-defined Cartridge vs Node responsibility
             (e.g. root access not required by Cartridge)
         –   Well-defined and versioned API
         –   Multiple versions supported in single Cartridge
    ●   Documentation:
        https://github.com/openshift/origin-server/blob/master/node/README.writing_cartridges.md




7
Minimal Cartridge
+-   bin
|    +- setup
|    +- control
+-   env
+-   metadata
|    +- manifest.yml


*Assumes packaged software already installed on system
*Most cartridges will have more files




8
metadata/manifest.yml

    ●   Elements
        –   Name
        –   Version
        –   Cartridge-Version
        –   Cartridge-Vendor
        –   Endpoints


*Other elements for defining features of your cartridge and it's packaged
software




9
Endpoints
 ●   Cartridges must explicitly declare which ports they will bind to, and
     provide meaningful variable names to describe:
      –   The IP address(es) reserved/available for binding
      –   The Gear-local ports to which the cartridge services will bind
      –   (Optional) Publicly proxied ports which expose Gear-local ports for
          use by the application's users or across application Gears
     Endpoints:

     - Private-IP-Name: <name of IP variable> (e.g. IP => OPENSHIFT_shortname_IP)
      Private-Port-Name: <name of port variable> (e.g. HTTP_PORT)

      Private-Port:   <port number> (e.g. 8080)
      Public-Port-Name: <name of public port variable> (e.g. HTTP_PROXY_PORT)




10
Hooks (in-flux)
     ●   Cartridges may need to act when some other cartridge is
         added/removed from an application.
     ●   This functionality is supported using Publish/Subscribe connectors in
         the manifest.yml.
         Subscribes:

          set-mysql-connection-info:       subscribe script
          Type: "NET_TCP:db:mysql"         subscription key

         Publishes:
          publish-mysql-connection-info:   publish script

          Type: "NET_TCP:db:mysql"         subscription key




11
bin/setup
     ●   Responsible for creating and/or configuring the files that were copied
         from the cartridge repository into the gear's directory.
     ●   Option --version
         –   Which version of the packaged software has been called for
         –   Possible to support n versions of the software, allows reuse of like
             code/configuration files etc




12
bin/control

OpenShift calls control when it wants work from you or your
packaged software
     ●   start – cartridge and the package software (httpd)
     ●   stop – cartridge and the package software (mysqld)
     ●   build – The application developer pushed new code to your
         language cartridge for processing (maven)
     ●   deploy – Code compiled but application not yet started. (Update
         database)
     ●   Others: threaddump, restart, reload, status




13
bin/teardown
     ●   Prepares the gear for the cartridge to be removed. This script will not
         called when the gear is destroyed.
     ●   The teardown script is only run when a cartridge is to be removed
         from the gear.
     ●   The gear is expected to continue to operate minus the functionality of
         your cartridge.




14
Template
 ●   Provides an minimal example of an application written in the
     language/framework your cartridge is packaging
     –   Typically application to web applications (e.g. homepage)
 ●   Action Hooks
     –   Executables for custom lifecycle
     –   e.g. pre-build, post-build, pre-deploy, post-deploy
         NOTE: Build lifecycle details available in doc
 ●   Markers
     –   Control cartridge behavior
     –   e.g. hot_deploy, disable_auto_scaling, force_clean_build, java7



15
System Environmental Variables (in-flux)
 ●   System Provided (subset)
     OPENSHIFT_APP_DNS the application's fully qualified domain name that your cartridge is a part of

     OPENSHIFT_APP_NAME the validated user assigned name for the application. Black list is system dependent.

     OPENSHIFT_APP_UUID OpenShift assigned UUID for the application

     OPENSHIFT_DATA_DIR the directory where your cartridge may store data

     OPENSHIFT_GEAR_DNS the gear's fully qualified domain name that your cartridge is a part of. May or may not be equal to OPENSHIFT_APP_DNS

     OPENSHIFT_GEAR_NAME OpenShift assigned name for the gear. May or may not be equal to OPENSHIFT_APP_NAME

     OPENSHIFT_GEAR_UUID OpenShift assigned UUID for the gear

     OPENSHIFT_HOMEDIR OpenShift assigned directory for the gear

     OPENSHIFT_REPO_DIR the directory where the developer's application is "archived" to and will be run from.

     OPENSHIFT_TMP_DIR the directory where your cartridge may store temporary data

 ●   Cartridge Provided (examples)
     OPENSHIFT_MYSQL_DB_HOST

     OPENSHIFT_MYSQL_DB_PASSWORD

     OPENSHIFT_MYSQL_DB_PORT

     OPENSHIFT_MYSQL_DB_USERNAME




16
Installing a V2 Cartridge
     ●   Typically available as RPMs
     ●   Added to /usr/libexec/openshift/cartridges/v2
     ●   Install Cartridge:
             oo-admin-cartridge -a install -s /usr/libexec/openshift/cartridges/v2/XXX

     ●   Clear Cache
             From /var/www/openshift/broker, run bundle exec rake tmp:clear OR
             Run `script/rails console` and enter 'Rails.cache.clear',

     ●   Confirm
            rhc cartridge list




17
Quickstarts/Samples
     ●   Many, many easy-to-install applications to showcase Cartridge use
     ●   https://github.com/openshift
     ●   Django, Rails, Tomcat, JEE, Mongo, Redmine, CakePHP, IronMQ,
         etc.
     ●   Typically follow install pattern:
         rhc create app …
         cd app
         git remote add upstream …
         git pull -s recursive -X theirs upstream master
     ●   Add your own!
     ●   NOTE: Quickstarts blend of v1/v2. Not all tested vs V2 yet


18
Thank You!




19
Channels
     ●   G+ Community
         https://plus.google.com/communities/114361859072744017486

     ●   E-Mail
         –   OpenShift Users: users@lists.openshift.redhat.com

         –   Origin Developers: dev@lists.openshift.redhat.com

     ●   IRC: irc.freenode.net
         –   OpenShift Users: #openshift

         –   Origin Developers: #openshift-dev

         –   Node/Cartridge Developers: #openshift-dev-node
20
Channels
     ●   Forums
         http://openshift.redhat.com/community/forums/openshift

     ●   Blogs
            https://openshift.redhat.com/community/blogs/

            http://mattoncloud.org/

            http://www.billdecoste.net

            http://www.krishnaraman.net

            http://cloud-mechanic.blogspot.com



21
OpenSource
     ●   GitHub: https://github.com/openshift
         –   Origin: origin-server

         –   OSE: enterprise-server

         –   Community Cartridges: origin-community-cartridges

         –   Quickstarts, Examples

         –   Watch, Star, Contribute!!!




22

More Related Content

PDF
Build Your Own PaaS, Just like Red Hat's OpenShift from LinuxCon 2013 New Orl...
ODP
Putting The PaaS in OpenStack with Diane Mueller @RedHat
ODP
DevOps, PaaS and the Modern Enterprise CloudExpo Europe presentation by Diane...
ODP
Deploying & Scaling OpenShift on OpenStack using Heat - OpenStack Seattle Mee...
PDF
Building Domain-specific PaaS with OpenShift Origin: The TRESOR Healthcare P...
PDF
OpenShift 4 installation
ODP
From Zero to Cloud: Revolutionize your Application Life Cycle with OpenShift ...
ODP
Build a PaaS with OpenShift Origin
Build Your Own PaaS, Just like Red Hat's OpenShift from LinuxCon 2013 New Orl...
Putting The PaaS in OpenStack with Diane Mueller @RedHat
DevOps, PaaS and the Modern Enterprise CloudExpo Europe presentation by Diane...
Deploying & Scaling OpenShift on OpenStack using Heat - OpenStack Seattle Mee...
Building Domain-specific PaaS with OpenShift Origin: The TRESOR Healthcare P...
OpenShift 4 installation
From Zero to Cloud: Revolutionize your Application Life Cycle with OpenShift ...
Build a PaaS with OpenShift Origin

What's hot (20)

PDF
Salt conf 2014-installing-openstack-using-saltstack-v02
PDF
Kubernetes or OpenShift - choosing your container platform for Dev and Ops
PDF
Putting Drupal in the Cloud with Red Hat's OpenShift PaaS #DrupalCon/Prague
PPTX
Galera on kubernetes_no_video
ODP
5 ways to install @OpenShift in 5 minutes (Lightening Talk given at #DevConfC...
PDF
Open shift and docker - october,2014
PPT
Openshift + Openstack + Fedora = Awesome
PDF
CoreOS automated MySQL Cluster Failover using Galera Cluster
PPTX
Open shift enterprise 3.1 paas on kubernetes
PDF
OpenShift Overview
PDF
OpenShift and next generation application development
ODP
OpenShift Anywhere given at Infrastructure.Next Talk at #Scale12X
PPTX
Core os dna_automacon
PDF
Docker Meetup - Melbourne 2015 - Kubernetes Deep Dive
ODP
OpenShift Enterprise
PPTX
Core os dna_oscon
PDF
OpenShift In a Nutshell - Episode 01 - Introduction
PDF
Red Hat OpenShift on Bare Metal and Containerized Storage
PDF
Containers - Portable, repeatable user-oriented application delivery. Build, ...
PPTX
FICO Open Shift presentation
Salt conf 2014-installing-openstack-using-saltstack-v02
Kubernetes or OpenShift - choosing your container platform for Dev and Ops
Putting Drupal in the Cloud with Red Hat's OpenShift PaaS #DrupalCon/Prague
Galera on kubernetes_no_video
5 ways to install @OpenShift in 5 minutes (Lightening Talk given at #DevConfC...
Open shift and docker - october,2014
Openshift + Openstack + Fedora = Awesome
CoreOS automated MySQL Cluster Failover using Galera Cluster
Open shift enterprise 3.1 paas on kubernetes
OpenShift Overview
OpenShift and next generation application development
OpenShift Anywhere given at Infrastructure.Next Talk at #Scale12X
Core os dna_automacon
Docker Meetup - Melbourne 2015 - Kubernetes Deep Dive
OpenShift Enterprise
Core os dna_oscon
OpenShift In a Nutshell - Episode 01 - Introduction
Red Hat OpenShift on Bare Metal and Containerized Storage
Containers - Portable, repeatable user-oriented application delivery. Build, ...
FICO Open Shift presentation
Ad

Similar to Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red Hat (20)

PDF
OpenShift Origin Community Day (Boston) Extending OpenShift Origin: Build You...
PDF
OpenShift Origin Community Day (Boston) Writing Cartridges V2 by Jhon Honce
PDF
PHP Development Tools
PDF
Java in containers
PDF
State of Containers and the Convergence of HPC and BigData
PDF
Workflow story: Theory versus practice in Large Enterprises
PDF
Workflow story: Theory versus Practice in large enterprises by Marcin Piebiak
PDF
Integrating ChatGPT with Apache Airflow
PDF
[HKDUG] #20161210 - BarCamp Hong Kong 2016 - What's News in PHP?
PPT
Linux containers and docker
PPTX
Why you’re going to fail running java on docker!
PPTX
GOSIM 2024 - Porting Servo to OpenHarmony
PDF
Make Your Containers Faster: Linux Container Performance Tools
PDF
software defined network, openflow protocol and its controllers
PDF
2012 09-08-josug-jeff
PDF
Scaleable PHP Applications in Kubernetes
PPTX
Using R on High Performance Computers
PDF
gVisor, Kata Containers, Firecracker, Docker: Who is Who in the Container Space?
PDF
Bundling Packages and Deploying Applications with RPM
PDF
Leveraging open source for large scale analytics
OpenShift Origin Community Day (Boston) Extending OpenShift Origin: Build You...
OpenShift Origin Community Day (Boston) Writing Cartridges V2 by Jhon Honce
PHP Development Tools
Java in containers
State of Containers and the Convergence of HPC and BigData
Workflow story: Theory versus practice in Large Enterprises
Workflow story: Theory versus Practice in large enterprises by Marcin Piebiak
Integrating ChatGPT with Apache Airflow
[HKDUG] #20161210 - BarCamp Hong Kong 2016 - What's News in PHP?
Linux containers and docker
Why you’re going to fail running java on docker!
GOSIM 2024 - Porting Servo to OpenHarmony
Make Your Containers Faster: Linux Container Performance Tools
software defined network, openflow protocol and its controllers
2012 09-08-josug-jeff
Scaleable PHP Applications in Kubernetes
Using R on High Performance Computers
gVisor, Kata Containers, Firecracker, Docker: Who is Who in the Container Space?
Bundling Packages and Deploying Applications with RPM
Leveraging open source for large scale analytics
Ad

More from OpenShift Origin (17)

ODP
OpenShift PaaS Anywhere (Infrastructure.Next Ghent 2014-02-24) Diane Mueller
ODP
Deploying & Scaling OpenShift on OpenStack using Heat - OpenStack Seattle Mee...
PDF
Human Face of Cloud Computing Cyber Summit 2013 Diane Mueller Red Hat OpenShi...
PDF
LatinoWare 2013 An OpenSource Blueprint for Cloud presented by Diane Mueller,...
PDF
OpenShift PaaS Overviewi by Marek Jelen 03-2013 CodeMotion Roma
PDF
OpenShift Overview Presentation by Marek Jelen for Zurich Geeks Event
PDF
Bringing Some Spatial Love to your Application with OpenShift - Mongo Berlin ...
PDF
Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Ma...
PDF
LinuxCon 2013 Steven Dake on Using Heat for autoscaling OpenShift on Openstack
PDF
How to Launch a Public PaaS with OpenSource: The GetUpCloud & OpenShift Orgin...
PDF
OpenShift Origin Community Day (Boston) Welcome & Resources by Diane Mueller
PDF
Putting Private Clouds to Work with PaaS Interop 2013 Vegas Diane Mueller
ODP
Welcome to the @OpenShift Origin Community by Diane Mueller @pythondj @redhat
ODP
OpenShift & SELinux with Dan Walsh @rhatdan
ODP
OpenShift Origin Internals
ODP
DevOps @ OpenShift Online
ODP
Introduction to OpenShift Origin- Private, Public and Community
OpenShift PaaS Anywhere (Infrastructure.Next Ghent 2014-02-24) Diane Mueller
Deploying & Scaling OpenShift on OpenStack using Heat - OpenStack Seattle Mee...
Human Face of Cloud Computing Cyber Summit 2013 Diane Mueller Red Hat OpenShi...
LatinoWare 2013 An OpenSource Blueprint for Cloud presented by Diane Mueller,...
OpenShift PaaS Overviewi by Marek Jelen 03-2013 CodeMotion Roma
OpenShift Overview Presentation by Marek Jelen for Zurich Geeks Event
Bringing Some Spatial Love to your Application with OpenShift - Mongo Berlin ...
Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Ma...
LinuxCon 2013 Steven Dake on Using Heat for autoscaling OpenShift on Openstack
How to Launch a Public PaaS with OpenSource: The GetUpCloud & OpenShift Orgin...
OpenShift Origin Community Day (Boston) Welcome & Resources by Diane Mueller
Putting Private Clouds to Work with PaaS Interop 2013 Vegas Diane Mueller
Welcome to the @OpenShift Origin Community by Diane Mueller @pythondj @redhat
OpenShift & SELinux with Dan Walsh @rhatdan
OpenShift Origin Internals
DevOps @ OpenShift Online
Introduction to OpenShift Origin- Private, Public and Community

Recently uploaded (20)

PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Encapsulation theory and applications.pdf
PPTX
Cloud computing and distributed systems.
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Big Data Technologies - Introduction.pptx
PPT
Teaching material agriculture food technology
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Electronic commerce courselecture one. Pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
Modernizing your data center with Dell and AMD
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
A Presentation on Artificial Intelligence
Understanding_Digital_Forensics_Presentation.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Encapsulation theory and applications.pdf
Cloud computing and distributed systems.
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
NewMind AI Weekly Chronicles - August'25 Week I
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Advanced methodologies resolving dimensionality complications for autism neur...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Big Data Technologies - Introduction.pptx
Teaching material agriculture food technology
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Diabetes mellitus diagnosis method based random forest with bat algorithm
Electronic commerce courselecture one. Pdf
Machine learning based COVID-19 study performance prediction
Modernizing your data center with Dell and AMD
“AI and Expert System Decision Support & Business Intelligence Systems”
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Building Integrated photovoltaic BIPV_UPV.pdf
A Presentation on Artificial Intelligence

Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red Hat

  • 1. OpenShift Community Day Writing Cartridges Bill DeCoste Principal Software Engineer wdecoste@redhat.com 1
  • 2. Target Audience You... ● Wish to offer new user services on an OpenShift PaaS ● Customize an existing user service on a PaaS 2
  • 3. What are Cartridges? ● Cartridge – A technology stack or framework (PHP, Perl, Java/JEE, Ruby, Python, MySQL, etc.) definition ● Plugin – Auth, DNS, etc. ● Gear – Allocation of memory, compute, and storage resources for running applications. Live on Nodes. ● Application – Instantiation of a Cartridge. Overloaded term, I know. ● Scaled/Scalable Application – Instantiated in multiple Gears 3
  • 4. Suggestions ... ● Start with a DIY (More significant for Cart V1) – Resolve many installation and configuration issues (e.g. bindings, logging) ● Existing Quickstart or sample? ● Start with a similar cartridge – Apache based? – JEE Application Server? – Embeddable Database? 4
  • 5. Requirements ● The OpenShift Cartridge API consists of: – Executable files – stdout/stderr – Environment variables ● You can use any language but we find bash the fastest – Bash “SDK” provided, other languages planned ● The software you are packaging either needs to be on the system or included in your cartridge 5
  • 6. History – Cartridge V1.0 ● Opensource, but not easy to implement or customize – Overly large number of files/scripts – Blurred Node vs Cartridge responsibility (e.g. root access required by Cartridge) – Each version required a new Cartridge ● Difficult to maintain – APIs not versioned 6
  • 7. History – Cartridge V2.0 ● Eased implementation, customization, and maintenance – Greatly reduced number of files/scripts – Well-defined Cartridge vs Node responsibility (e.g. root access not required by Cartridge) – Well-defined and versioned API – Multiple versions supported in single Cartridge ● Documentation: https://github.com/openshift/origin-server/blob/master/node/README.writing_cartridges.md 7
  • 8. Minimal Cartridge +- bin | +- setup | +- control +- env +- metadata | +- manifest.yml *Assumes packaged software already installed on system *Most cartridges will have more files 8
  • 9. metadata/manifest.yml ● Elements – Name – Version – Cartridge-Version – Cartridge-Vendor – Endpoints *Other elements for defining features of your cartridge and it's packaged software 9
  • 10. Endpoints ● Cartridges must explicitly declare which ports they will bind to, and provide meaningful variable names to describe: – The IP address(es) reserved/available for binding – The Gear-local ports to which the cartridge services will bind – (Optional) Publicly proxied ports which expose Gear-local ports for use by the application's users or across application Gears Endpoints: - Private-IP-Name: <name of IP variable> (e.g. IP => OPENSHIFT_shortname_IP) Private-Port-Name: <name of port variable> (e.g. HTTP_PORT) Private-Port: <port number> (e.g. 8080) Public-Port-Name: <name of public port variable> (e.g. HTTP_PROXY_PORT) 10
  • 11. Hooks (in-flux) ● Cartridges may need to act when some other cartridge is added/removed from an application. ● This functionality is supported using Publish/Subscribe connectors in the manifest.yml. Subscribes: set-mysql-connection-info: subscribe script Type: "NET_TCP:db:mysql" subscription key Publishes: publish-mysql-connection-info: publish script Type: "NET_TCP:db:mysql" subscription key 11
  • 12. bin/setup ● Responsible for creating and/or configuring the files that were copied from the cartridge repository into the gear's directory. ● Option --version – Which version of the packaged software has been called for – Possible to support n versions of the software, allows reuse of like code/configuration files etc 12
  • 13. bin/control OpenShift calls control when it wants work from you or your packaged software ● start – cartridge and the package software (httpd) ● stop – cartridge and the package software (mysqld) ● build – The application developer pushed new code to your language cartridge for processing (maven) ● deploy – Code compiled but application not yet started. (Update database) ● Others: threaddump, restart, reload, status 13
  • 14. bin/teardown ● Prepares the gear for the cartridge to be removed. This script will not called when the gear is destroyed. ● The teardown script is only run when a cartridge is to be removed from the gear. ● The gear is expected to continue to operate minus the functionality of your cartridge. 14
  • 15. Template ● Provides an minimal example of an application written in the language/framework your cartridge is packaging – Typically application to web applications (e.g. homepage) ● Action Hooks – Executables for custom lifecycle – e.g. pre-build, post-build, pre-deploy, post-deploy NOTE: Build lifecycle details available in doc ● Markers – Control cartridge behavior – e.g. hot_deploy, disable_auto_scaling, force_clean_build, java7 15
  • 16. System Environmental Variables (in-flux) ● System Provided (subset) OPENSHIFT_APP_DNS the application's fully qualified domain name that your cartridge is a part of OPENSHIFT_APP_NAME the validated user assigned name for the application. Black list is system dependent. OPENSHIFT_APP_UUID OpenShift assigned UUID for the application OPENSHIFT_DATA_DIR the directory where your cartridge may store data OPENSHIFT_GEAR_DNS the gear's fully qualified domain name that your cartridge is a part of. May or may not be equal to OPENSHIFT_APP_DNS OPENSHIFT_GEAR_NAME OpenShift assigned name for the gear. May or may not be equal to OPENSHIFT_APP_NAME OPENSHIFT_GEAR_UUID OpenShift assigned UUID for the gear OPENSHIFT_HOMEDIR OpenShift assigned directory for the gear OPENSHIFT_REPO_DIR the directory where the developer's application is "archived" to and will be run from. OPENSHIFT_TMP_DIR the directory where your cartridge may store temporary data ● Cartridge Provided (examples) OPENSHIFT_MYSQL_DB_HOST OPENSHIFT_MYSQL_DB_PASSWORD OPENSHIFT_MYSQL_DB_PORT OPENSHIFT_MYSQL_DB_USERNAME 16
  • 17. Installing a V2 Cartridge ● Typically available as RPMs ● Added to /usr/libexec/openshift/cartridges/v2 ● Install Cartridge: oo-admin-cartridge -a install -s /usr/libexec/openshift/cartridges/v2/XXX ● Clear Cache From /var/www/openshift/broker, run bundle exec rake tmp:clear OR Run `script/rails console` and enter 'Rails.cache.clear', ● Confirm rhc cartridge list 17
  • 18. Quickstarts/Samples ● Many, many easy-to-install applications to showcase Cartridge use ● https://github.com/openshift ● Django, Rails, Tomcat, JEE, Mongo, Redmine, CakePHP, IronMQ, etc. ● Typically follow install pattern: rhc create app … cd app git remote add upstream … git pull -s recursive -X theirs upstream master ● Add your own! ● NOTE: Quickstarts blend of v1/v2. Not all tested vs V2 yet 18
  • 20. Channels ● G+ Community https://plus.google.com/communities/114361859072744017486 ● E-Mail – OpenShift Users: users@lists.openshift.redhat.com – Origin Developers: dev@lists.openshift.redhat.com ● IRC: irc.freenode.net – OpenShift Users: #openshift – Origin Developers: #openshift-dev – Node/Cartridge Developers: #openshift-dev-node 20
  • 21. Channels ● Forums http://openshift.redhat.com/community/forums/openshift ● Blogs https://openshift.redhat.com/community/blogs/ http://mattoncloud.org/ http://www.billdecoste.net http://www.krishnaraman.net http://cloud-mechanic.blogspot.com 21
  • 22. OpenSource ● GitHub: https://github.com/openshift – Origin: origin-server – OSE: enterprise-server – Community Cartridges: origin-community-cartridges – Quickstarts, Examples – Watch, Star, Contribute!!! 22