SlideShare a Scribd company logo
1 of 30
Writing Cartridges for OpenShift
Jhon Honce
Pr Software Engineer, Red Hat Inc
OpenShift Origin Community Day (Boston)
June 13, 2013
http://openshift.github.io
The OpenShift Ecosystem: GUI/CLI, Broker, Node
GUI
rhc (CLI)
Broker
Node
(Cartridges)
REST API
ssh|git MCollective
snapshot.tgz
gitrepository
Where does my code fit?
● Application – application developer
● Gears – PaaS developer
● Cartridges – Cartridge authors
● Web Frameworks, Databases, Daemons
● Encapsulates some piece software for use within
the PaaS
The Cartridge API
● Low overhead
● Named executable files
● stdout/stderr
● Environment variables
● Configuration files:
manifest.yml, managed_files.yml
● You can use any language
● source $OPENSHIFT_CARTRIDGE_SDK_BASH
● The software you are packaging must either be on the
system or included in your cartridge
Minimal Cartridge – identify cartridge
+- bin
| +- setup
| +- control
+- env
+- metadata
| +- manifest.yml
● Assumes packaged software
already installed on system
● Most cartridges will have
more files
● manifest.yml
Name: dog
Cartridge-Short-Name: DOG
.
:
Version: ‘1.0’
Cartridge-Version: 0.0.1
Cartridge-Vendor: honce
Minimal Cartridge – required files
+- bin
| +- setup
| +- control
+- env
+- metadata
| +- manifest.yml
● Assumes packaged software
already installed on system
● Most cartridges will have
more files
● manifest.yml
Name: dog
Cartridge-Short-Name: DOG
.
:
Version: ‘1.0’
Cartridge-Version: 0.0.1
Cartridge-Vendor: honce
Minimal Cartridge
+- bin
| +- setup
| +- control
+- env
+- metadata
| +- manifest.yml
● Assumes packaged software
already installed on system
● Most cartridges will have
more files
● manifest.yml
Name: dog
Cartridge-Short-Name: DOG
.
:
Version: ‘1.0’
Cartridge-Version: 0.0.1
Cartridge-Vendor: honce
My Cartridge needs to be seen!
+- bin
| +- …
| +- control
+…
● control Arguments
● start
● stop
● manifest.yml
.
:
Endpoints:
- Private-IP-Name: IP
Private-Port-Name: PORT
Private-Port: 8080
Public-Port-Name: PROXY_PORT
Mappings:
- Frontend: ""
Backend: ""
● Environment Variables
OPENSHIFT_<SHORT_NAME>_IP
OPENSHIFT_<SHORT_NAME>_PORT
OPENSHIFT_…_PROXY_PORT
My Cartridge needs to be invoked
+- bin
| +- …
| +- control
+…
● Basic control arguments
● start
● stop
● manifest.yml
.
:
Endpoints:
- Private-IP-Name: IP
Private-Port-Name: PORT
Private-Port: 8080
Public-Port-Name: PROXY_PORT
Mappings:
- Frontend: ""
Backend: ""
My Cartridge needs to be seen!
+- bin
| +- …
| +- control
+…
● Basic control arguments
● start
● stop
● manifest.yml
.
:
Endpoints:
- Private-IP-Name: IP
Private-Port-Name: PORT
Private-Port: 8080
Public-Port-Name: PROXY_PORT
Mappings:
- Frontend: ""
Backend: ""
Tip: control script can be trivial
.
:
case “$1” in
start)
/usr/sbin/httpd -C 
"Include $OPENSHIFT_DOG_CONF_DIR/*.conf" 
-f $HTTPD_CFG_FILE -k start ;;
stop)
… -k stop ;;
restart)
… -k restart ;;
esac
My Cartridge needs help, a database cartridge
+- hooks
| +- …
| +- publish-db-connection-info
+…
● manifest.yml
.
:
Publishes:
publish-db-connection-info:
Type: "ENV:NET_TCP:db:connection-info"
● Pub/Sub Protocol
● publish-db-connection-info is a script
echo OPENSHIFT_MYSQL_DB_HOST=$OPENSHIFT_GEAR_DNS
echo OPENSHIFT_MYSQL_DB_PORT=$OPENSHIFT_MYSQL_DB_PROXY_PORT
echo OPENSHIFT_MYSQL_DB_URL=”mysql://…/”
My Cartridge needs help, a database cartridge!
● manifest.yml
.
:
Publishes:
publish-db-connection-info:
Type: "ENV:NET_TCP:db:connection-info"
● Publish/Subscribe Protocol
● publish-db-connection-info is a script
echo OPENSHIFT_MYSQL_DB_HOST=$OPENSHIFT_GEAR_DNS
echo OPENSHIFT_MYSQL_DB_PORT=$OPENSHIFT_MYSQL_DB_PROXY_PORT
echo OPENSHIFT_MYSQL_DB_URL=”mysql://…/”
My Cartridge needs needs to be listening
● Pub/Sub Protocol
● The Type: element determines both the message format and
whether the subscribe hook may be implemented in the
Platform
● A provided hook script will be run in place of Platform code
● manifest.yml
.
:
Subscribes:
set-db-connection-info:
Type: “ENV:NET_TCP:db:connection-info”
Required: false
Let the Platform the cartridge can use a database
● Pub/Sub Protocol
● The Type: element determines both the message format and
whether the subscribe hook may be implemented in the
Platform
● A provided hook script will be run in place of Platform code
● manifest.yml
.
:
Subscribes:
set-db-connection-info:
Type: “ENV:NET_TCP:db:connection-info”
Required: false
Let the Platform the cartridge can use a database
● Pub/Sub Protocol
● The Type: element determines both the message format and
whether the subscribe hook may be implemented in the
Platform
● A provided hook script will be run in place of Platform code
● manifest.yml
.
:
Subscribes:
set-db-connection-info:
Type: “ENV:NET_TCP:db:connection-info”
Required: false
My Cartridge needs to be listening for databases
● Pub/Sub Protocol
● The Type: element determines both the message format and
whether the subscribe hook may be implemented in the
Platform
● A provided hook script will be run in place of Platform code
● manifest.yml
.
:
Subscribes:
set-db-connection-info:
Type: “ENV:NET_TCP:db:connection-info”
Required: false
My Cartridge needs to be listening for databases
● Pub/Sub Protocol
● The Type: element determines both the message format and
whether the subscribe hook may be implemented in the
Platform
● A provided hook script will be run in place of Platform code
● manifest.yml
.
:
Subscribes:
set-db-connection-info:
Type: “ENV:NET_TCP:db:connection-info”
Required: false
Customize Work Flows
● Cartridge Authors
● Implement additional control actions
● Provide optional scrips
● Application Developers
● .openshift/action_hooks
● .openshift/markers
● git pushed from developers repository
For Language Frameworks: A sample application
● template directory
● Checked in as the gear's initial git repository
● A “complete” application demonstrating that your
cartridge is ready for business
● If you should add the manifest element:
● Install-Build-Required: false
● Speeds up the installation of your cartridge
● You need to do work for the application developer
Environment Variables
The Node/Application/Gear/Cartridge all have shared
environment variables in their scope
● Node Scope variables
● /etc/openshift/env
● Gear Scope
● .../<gear uuid>/.env
● Application Scope
● .../<gear uuid>/.env/<cartridge name>
● Cartridge Scope
● .../<gear uuid>/<cartridge name>/env
Example Platform Environment Variables
● OPENSHIFT_APP_NAME
● OPENSHIFT_APP_DNS
● OPENSHIFT_DATA_DIR
● OPENSHIFT_HOMEDIR
● OPENSHIFT_TMP_DIR
● OPENSHIFT_<SHORT NAME>_DIR
● OPENSHIFT_<SHORT NAME>_IP
● OPENSHIFT_<SHORT NAME>_PORT
● You and application developer use these to tie into the software you
are packaging
● System tracks them and builds the correct process environment for
you
Creating An Application With Your Cartridge
● rhc create-app dog001 http://…/metadata/manifest.yml
● Tip: use raw URL from github
● manifest.yml contains Source-Url element
● Source-Url addresses root of your cartridge
● Tip: use download zip file from github repository
Tip: Origin VM as a development platform
● http://openshift.github.io/
● Broker-Node communication
● /var/log/mcollective.log
● Node logging
● /var/log/openshift/node/platform.log
● Node detailed logging
● /var/log/openshift/node/platform-trace.log
● Warning: Origin – Fedora 18
Online – RHEL 6
Tip: Examples – Online Cartridges
● http://tinyurl.com/online-cartridges
● JBoss EWS: multiple versions of packaged software
and support for multiple java versions
● MySQL: pub/sub database connections
● PHP My Admin: one cartridge dependent on another
Tip: Using bash for scripts
● -e and -u options are your friends
● -e exit on error
● -u using unset variable is an error
● -x for debugging
● Bash “SDK” (Library of functions)
● source $OPENSHIFT_CARTRIDGE_SDK_BASH
ERB File Rendering
● Unified method of doing value substitutions in
configuration files
● httpd.conf, php.ini, etc
● metadata/managed_files.yml
● processed_templates:
- '**/*.erb'
● All environment variables available
● No code can be executed
Title here
Text with no bullets
● Bullets layer one
● Bullets layer two
● Bullets layer three
Additional Resources!
● Cartridge Writing Guide:
http://tinyurl.com/writing-cartridges
● IRC Freenode
● #openshift (application developers)
● #openshift-dev (PaaS development)
● #openshift-dev-node (cartridge/node development)
● Email
● dev@lists.openshift.redhat.com
For more information:
http://openshift.github.io
Follow us on twitter:
@openshift
Join us on irc (freenode):
openshift

More Related Content

What's hot

C++ CoreHard Autumn 2018. Создание пакетов для открытых библиотек через conan...
C++ CoreHard Autumn 2018. Создание пакетов для открытых библиотек через conan...C++ CoreHard Autumn 2018. Создание пакетов для открытых библиотек через conan...
C++ CoreHard Autumn 2018. Создание пакетов для открытых библиотек через conan...corehard_by
 
Golang execution modes
Golang execution modesGolang execution modes
Golang execution modesTing-Li Chou
 
Writing an Ostinato Protocol Builder [FOSDEM 2021]
Writing an Ostinato Protocol Builder [FOSDEM 2021]Writing an Ostinato Protocol Builder [FOSDEM 2021]
Writing an Ostinato Protocol Builder [FOSDEM 2021]pstavirs
 
Phing - A PHP Build Tool (An Introduction)
Phing - A PHP Build Tool (An Introduction)Phing - A PHP Build Tool (An Introduction)
Phing - A PHP Build Tool (An Introduction)Michiel Rook
 
[COSCUP 2020] How to use llvm frontend library-libtooling
[COSCUP 2020] How to use llvm frontend library-libtooling[COSCUP 2020] How to use llvm frontend library-libtooling
[COSCUP 2020] How to use llvm frontend library-libtoolingDouglas Chen
 
Fluentd Hacking Guide at RubyKaigi 2014
Fluentd Hacking Guide at RubyKaigi 2014Fluentd Hacking Guide at RubyKaigi 2014
Fluentd Hacking Guide at RubyKaigi 2014Naotoshi Seo
 
Vagrant move over, here is Docker
Vagrant move over, here is DockerVagrant move over, here is Docker
Vagrant move over, here is DockerNick Belhomme
 
LSA2 - 03 Http apache nginx
LSA2 - 03 Http apache nginxLSA2 - 03 Http apache nginx
LSA2 - 03 Http apache nginxMarian Marinov
 
Putting Phing to Work for You
Putting Phing to Work for YouPutting Phing to Work for You
Putting Phing to Work for Youhozn
 
Laravel 4 package development
Laravel 4 package developmentLaravel 4 package development
Laravel 4 package developmentTihomir Opačić
 
Centralized Logging with syslog
Centralized Logging with syslogCentralized Logging with syslog
Centralized Logging with syslogamiable_indian
 
DevOps in PHP environment
DevOps in PHP environment DevOps in PHP environment
DevOps in PHP environment Evaldo Felipe
 
Deploying PHP applications with Phing
Deploying PHP applications with PhingDeploying PHP applications with Phing
Deploying PHP applications with PhingMichiel Rook
 
Apache Dispatch
Apache DispatchApache Dispatch
Apache DispatchFred Moyer
 
GNU Compiler Collection - August 2005
GNU Compiler Collection - August 2005GNU Compiler Collection - August 2005
GNU Compiler Collection - August 2005Saleem Ansari
 
zebra & openconfigd Introduction
zebra & openconfigd Introductionzebra & openconfigd Introduction
zebra & openconfigd IntroductionKentaro Ebisawa
 
Composer - Package Management for PHP. Silver Bullet?
Composer - Package Management for PHP. Silver Bullet?Composer - Package Management for PHP. Silver Bullet?
Composer - Package Management for PHP. Silver Bullet?Kirill Chebunin
 
PSR-7 - Middleware - Zend Expressive
PSR-7 - Middleware - Zend ExpressivePSR-7 - Middleware - Zend Expressive
PSR-7 - Middleware - Zend ExpressiveMilad Arabi
 
Writing multi-language documentation using Sphinx
Writing multi-language documentation using SphinxWriting multi-language documentation using Sphinx
Writing multi-language documentation using SphinxMarkus Zapke-Gründemann
 

What's hot (20)

C++ CoreHard Autumn 2018. Создание пакетов для открытых библиотек через conan...
C++ CoreHard Autumn 2018. Создание пакетов для открытых библиотек через conan...C++ CoreHard Autumn 2018. Создание пакетов для открытых библиотек через conan...
C++ CoreHard Autumn 2018. Создание пакетов для открытых библиотек через conan...
 
Golang execution modes
Golang execution modesGolang execution modes
Golang execution modes
 
Writing an Ostinato Protocol Builder [FOSDEM 2021]
Writing an Ostinato Protocol Builder [FOSDEM 2021]Writing an Ostinato Protocol Builder [FOSDEM 2021]
Writing an Ostinato Protocol Builder [FOSDEM 2021]
 
Phing - A PHP Build Tool (An Introduction)
Phing - A PHP Build Tool (An Introduction)Phing - A PHP Build Tool (An Introduction)
Phing - A PHP Build Tool (An Introduction)
 
[COSCUP 2020] How to use llvm frontend library-libtooling
[COSCUP 2020] How to use llvm frontend library-libtooling[COSCUP 2020] How to use llvm frontend library-libtooling
[COSCUP 2020] How to use llvm frontend library-libtooling
 
Fluentd Hacking Guide at RubyKaigi 2014
Fluentd Hacking Guide at RubyKaigi 2014Fluentd Hacking Guide at RubyKaigi 2014
Fluentd Hacking Guide at RubyKaigi 2014
 
Vagrant move over, here is Docker
Vagrant move over, here is DockerVagrant move over, here is Docker
Vagrant move over, here is Docker
 
LSA2 - 03 Http apache nginx
LSA2 - 03 Http apache nginxLSA2 - 03 Http apache nginx
LSA2 - 03 Http apache nginx
 
Putting Phing to Work for You
Putting Phing to Work for YouPutting Phing to Work for You
Putting Phing to Work for You
 
Phing
PhingPhing
Phing
 
Laravel 4 package development
Laravel 4 package developmentLaravel 4 package development
Laravel 4 package development
 
Centralized Logging with syslog
Centralized Logging with syslogCentralized Logging with syslog
Centralized Logging with syslog
 
DevOps in PHP environment
DevOps in PHP environment DevOps in PHP environment
DevOps in PHP environment
 
Deploying PHP applications with Phing
Deploying PHP applications with PhingDeploying PHP applications with Phing
Deploying PHP applications with Phing
 
Apache Dispatch
Apache DispatchApache Dispatch
Apache Dispatch
 
GNU Compiler Collection - August 2005
GNU Compiler Collection - August 2005GNU Compiler Collection - August 2005
GNU Compiler Collection - August 2005
 
zebra & openconfigd Introduction
zebra & openconfigd Introductionzebra & openconfigd Introduction
zebra & openconfigd Introduction
 
Composer - Package Management for PHP. Silver Bullet?
Composer - Package Management for PHP. Silver Bullet?Composer - Package Management for PHP. Silver Bullet?
Composer - Package Management for PHP. Silver Bullet?
 
PSR-7 - Middleware - Zend Expressive
PSR-7 - Middleware - Zend ExpressivePSR-7 - Middleware - Zend Expressive
PSR-7 - Middleware - Zend Expressive
 
Writing multi-language documentation using Sphinx
Writing multi-language documentation using SphinxWriting multi-language documentation using Sphinx
Writing multi-language documentation using Sphinx
 

Viewers also liked

100 useful-exercises-in-english-zb0375
100 useful-exercises-in-english-zb0375100 useful-exercises-in-english-zb0375
100 useful-exercises-in-english-zb0375egalaki23
 
Keynote Berlin Buzzwords 2016 Inspiring The Next Generation @getmakered
Keynote Berlin Buzzwords 2016  Inspiring The  Next Generation @getmakered Keynote Berlin Buzzwords 2016  Inspiring The  Next Generation @getmakered
Keynote Berlin Buzzwords 2016 Inspiring The Next Generation @getmakered Diane Mueller
 
Putting Private Clouds to Work with PaaS Interop Vegas 2013 presentation by D...
Putting Private Clouds to Work with PaaS Interop Vegas 2013 presentation by D...Putting Private Clouds to Work with PaaS Interop Vegas 2013 presentation by D...
Putting Private Clouds to Work with PaaS Interop Vegas 2013 presentation by D...Diane Mueller
 
OSCON Kids GetMakered 3D Selfie Workshop
OSCON Kids GetMakered 3D Selfie WorkshopOSCON Kids GetMakered 3D Selfie Workshop
OSCON Kids GetMakered 3D Selfie WorkshopDiane Mueller
 
OpenShift Origin Community Day (Boston) Welcome & Resources by Diane Mueller
OpenShift Origin Community Day (Boston) Welcome & Resources by Diane MuellerOpenShift Origin Community Day (Boston) Welcome & Resources by Diane Mueller
OpenShift Origin Community Day (Boston) Welcome & Resources by Diane MuellerDiane Mueller
 
OpenStack Summit Tokyo 2015: Scale or Fail: Containers on OpenStack with Open...
OpenStack Summit Tokyo 2015: Scale or Fail: Containers on OpenStack with Open...OpenStack Summit Tokyo 2015: Scale or Fail: Containers on OpenStack with Open...
OpenStack Summit Tokyo 2015: Scale or Fail: Containers on OpenStack with Open...Diane Mueller
 
Deploying & Scaling OpenShift on OpenStack using Heat - OpenStack Seattle Mee...
Deploying & Scaling OpenShift on OpenStack using Heat - OpenStack Seattle Mee...Deploying & Scaling OpenShift on OpenStack using Heat - OpenStack Seattle Mee...
Deploying & Scaling OpenShift on OpenStack using Heat - OpenStack Seattle Mee...Diane Mueller
 
MonkiGras 2016 Inspiring The Next Generation: The Getmakered Project
MonkiGras 2016 Inspiring The Next Generation:  The Getmakered ProjectMonkiGras 2016 Inspiring The Next Generation:  The Getmakered Project
MonkiGras 2016 Inspiring The Next Generation: The Getmakered ProjectDiane Mueller
 
「Lispインタープリター」勉強会 2014.12.04
「Lispインタープリター」勉強会 2014.12.04「Lispインタープリター」勉強会 2014.12.04
「Lispインタープリター」勉強会 2014.12.04Minoru Chikamune
 
Stormとその周辺 2013.03.15
Stormとその周辺 2013.03.15Stormとその周辺 2013.03.15
Stormとその周辺 2013.03.15Minoru Chikamune
 
Cuadernillodeentrenamientoicfessaber11preguntasyrespuestas 130419082717-phpapp01
Cuadernillodeentrenamientoicfessaber11preguntasyrespuestas 130419082717-phpapp01Cuadernillodeentrenamientoicfessaber11preguntasyrespuestas 130419082717-phpapp01
Cuadernillodeentrenamientoicfessaber11preguntasyrespuestas 130419082717-phpapp01Martha Patricia Salamanca Suarez
 
有名論文から学ぶディープラーニング 2016.03.25
有名論文から学ぶディープラーニング 2016.03.25有名論文から学ぶディープラーニング 2016.03.25
有名論文から学ぶディープラーニング 2016.03.25Minoru Chikamune
 
「機械学習 By スタンフォード大学」勉強会 2015.09.11
「機械学習 By スタンフォード大学」勉強会 2015.09.11「機械学習 By スタンフォード大学」勉強会 2015.09.11
「機械学習 By スタンフォード大学」勉強会 2015.09.11Minoru Chikamune
 

Viewers also liked (18)

100 useful-exercises-in-english-zb0375
100 useful-exercises-in-english-zb0375100 useful-exercises-in-english-zb0375
100 useful-exercises-in-english-zb0375
 
Keynote Berlin Buzzwords 2016 Inspiring The Next Generation @getmakered
Keynote Berlin Buzzwords 2016  Inspiring The  Next Generation @getmakered Keynote Berlin Buzzwords 2016  Inspiring The  Next Generation @getmakered
Keynote Berlin Buzzwords 2016 Inspiring The Next Generation @getmakered
 
Tarea n 6
Tarea n 6Tarea n 6
Tarea n 6
 
Putting Private Clouds to Work with PaaS Interop Vegas 2013 presentation by D...
Putting Private Clouds to Work with PaaS Interop Vegas 2013 presentation by D...Putting Private Clouds to Work with PaaS Interop Vegas 2013 presentation by D...
Putting Private Clouds to Work with PaaS Interop Vegas 2013 presentation by D...
 
Adjectives
AdjectivesAdjectives
Adjectives
 
OSCON Kids GetMakered 3D Selfie Workshop
OSCON Kids GetMakered 3D Selfie WorkshopOSCON Kids GetMakered 3D Selfie Workshop
OSCON Kids GetMakered 3D Selfie Workshop
 
Biomas
BiomasBiomas
Biomas
 
Vote mollabi
Vote mollabiVote mollabi
Vote mollabi
 
OpenShift Origin Community Day (Boston) Welcome & Resources by Diane Mueller
OpenShift Origin Community Day (Boston) Welcome & Resources by Diane MuellerOpenShift Origin Community Day (Boston) Welcome & Resources by Diane Mueller
OpenShift Origin Community Day (Boston) Welcome & Resources by Diane Mueller
 
Site
SiteSite
Site
 
OpenStack Summit Tokyo 2015: Scale or Fail: Containers on OpenStack with Open...
OpenStack Summit Tokyo 2015: Scale or Fail: Containers on OpenStack with Open...OpenStack Summit Tokyo 2015: Scale or Fail: Containers on OpenStack with Open...
OpenStack Summit Tokyo 2015: Scale or Fail: Containers on OpenStack with Open...
 
Deploying & Scaling OpenShift on OpenStack using Heat - OpenStack Seattle Mee...
Deploying & Scaling OpenShift on OpenStack using Heat - OpenStack Seattle Mee...Deploying & Scaling OpenShift on OpenStack using Heat - OpenStack Seattle Mee...
Deploying & Scaling OpenShift on OpenStack using Heat - OpenStack Seattle Mee...
 
MonkiGras 2016 Inspiring The Next Generation: The Getmakered Project
MonkiGras 2016 Inspiring The Next Generation:  The Getmakered ProjectMonkiGras 2016 Inspiring The Next Generation:  The Getmakered Project
MonkiGras 2016 Inspiring The Next Generation: The Getmakered Project
 
「Lispインタープリター」勉強会 2014.12.04
「Lispインタープリター」勉強会 2014.12.04「Lispインタープリター」勉強会 2014.12.04
「Lispインタープリター」勉強会 2014.12.04
 
Stormとその周辺 2013.03.15
Stormとその周辺 2013.03.15Stormとその周辺 2013.03.15
Stormとその周辺 2013.03.15
 
Cuadernillodeentrenamientoicfessaber11preguntasyrespuestas 130419082717-phpapp01
Cuadernillodeentrenamientoicfessaber11preguntasyrespuestas 130419082717-phpapp01Cuadernillodeentrenamientoicfessaber11preguntasyrespuestas 130419082717-phpapp01
Cuadernillodeentrenamientoicfessaber11preguntasyrespuestas 130419082717-phpapp01
 
有名論文から学ぶディープラーニング 2016.03.25
有名論文から学ぶディープラーニング 2016.03.25有名論文から学ぶディープラーニング 2016.03.25
有名論文から学ぶディープラーニング 2016.03.25
 
「機械学習 By スタンフォード大学」勉強会 2015.09.11
「機械学習 By スタンフォード大学」勉強会 2015.09.11「機械学習 By スタンフォード大学」勉強会 2015.09.11
「機械学習 By スタンフォード大学」勉強会 2015.09.11
 

Similar to OpenShift Origin Community Day (Boston) Writing Cartridges V2 by Jhon Honce

Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...OpenShift Origin
 
Movable Type 5.2 Overview at MTDDC 2012
Movable Type 5.2 Overview at MTDDC 2012Movable Type 5.2 Overview at MTDDC 2012
Movable Type 5.2 Overview at MTDDC 2012Yuji Takayama
 
(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systems(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systemssosorry
 
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...Nagios
 
Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Henry Schreiner
 
EuroPython 2013 - Python3 TurboGears Training
EuroPython 2013 - Python3 TurboGears TrainingEuroPython 2013 - Python3 TurboGears Training
EuroPython 2013 - Python3 TurboGears TrainingAlessandro Molina
 
Integrating ChatGPT with Apache Airflow
Integrating ChatGPT with Apache AirflowIntegrating ChatGPT with Apache Airflow
Integrating ChatGPT with Apache AirflowTatiana Al-Chueyr
 
Open source projects with python
Open source projects with pythonOpen source projects with python
Open source projects with pythonroskakori
 
Development Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP LibrariesDevelopment Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP LibrariesPantheon
 
Improving Operations Efficiency with Puppet
Improving Operations Efficiency with PuppetImproving Operations Efficiency with Puppet
Improving Operations Efficiency with PuppetNicolas Brousse
 
Collect distributed application logging using fluentd (EFK stack)
Collect distributed application logging using fluentd (EFK stack)Collect distributed application logging using fluentd (EFK stack)
Collect distributed application logging using fluentd (EFK stack)Marco Pas
 
PHP QA Tools
PHP QA ToolsPHP QA Tools
PHP QA Toolsrjsmelo
 
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Pantheon
 
Make Your Containers Faster: Linux Container Performance Tools
Make Your Containers Faster: Linux Container Performance ToolsMake Your Containers Faster: Linux Container Performance Tools
Make Your Containers Faster: Linux Container Performance ToolsKernel TLV
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux DevelopersOpersys inc.
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014biicode
 
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Opersys inc.
 

Similar to OpenShift Origin Community Day (Boston) Writing Cartridges V2 by Jhon Honce (20)

Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
 
Aci dp
Aci dpAci dp
Aci dp
 
Movable Type 5.2 Overview at MTDDC 2012
Movable Type 5.2 Overview at MTDDC 2012Movable Type 5.2 Overview at MTDDC 2012
Movable Type 5.2 Overview at MTDDC 2012
 
(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systems(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systems
 
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
 
PHP Development Tools
PHP  Development ToolsPHP  Development Tools
PHP Development Tools
 
Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024
 
EuroPython 2013 - Python3 TurboGears Training
EuroPython 2013 - Python3 TurboGears TrainingEuroPython 2013 - Python3 TurboGears Training
EuroPython 2013 - Python3 TurboGears Training
 
Integrating ChatGPT with Apache Airflow
Integrating ChatGPT with Apache AirflowIntegrating ChatGPT with Apache Airflow
Integrating ChatGPT with Apache Airflow
 
Deploy your own P2P network
Deploy your own P2P networkDeploy your own P2P network
Deploy your own P2P network
 
Open source projects with python
Open source projects with pythonOpen source projects with python
Open source projects with python
 
Development Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP LibrariesDevelopment Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP Libraries
 
Improving Operations Efficiency with Puppet
Improving Operations Efficiency with PuppetImproving Operations Efficiency with Puppet
Improving Operations Efficiency with Puppet
 
Collect distributed application logging using fluentd (EFK stack)
Collect distributed application logging using fluentd (EFK stack)Collect distributed application logging using fluentd (EFK stack)
Collect distributed application logging using fluentd (EFK stack)
 
PHP QA Tools
PHP QA ToolsPHP QA Tools
PHP QA Tools
 
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
 
Make Your Containers Faster: Linux Container Performance Tools
Make Your Containers Faster: Linux Container Performance ToolsMake Your Containers Faster: Linux Container Performance Tools
Make Your Containers Faster: Linux Container Performance Tools
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux Developers
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
 

Recently uploaded

TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 

Recently uploaded (20)

TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 

OpenShift Origin Community Day (Boston) Writing Cartridges V2 by Jhon Honce

  • 1. Writing Cartridges for OpenShift Jhon Honce Pr Software Engineer, Red Hat Inc OpenShift Origin Community Day (Boston) June 13, 2013 http://openshift.github.io
  • 2. The OpenShift Ecosystem: GUI/CLI, Broker, Node GUI rhc (CLI) Broker Node (Cartridges) REST API ssh|git MCollective snapshot.tgz gitrepository
  • 3. Where does my code fit? ● Application – application developer ● Gears – PaaS developer ● Cartridges – Cartridge authors ● Web Frameworks, Databases, Daemons ● Encapsulates some piece software for use within the PaaS
  • 4. The Cartridge API ● Low overhead ● Named executable files ● stdout/stderr ● Environment variables ● Configuration files: manifest.yml, managed_files.yml ● You can use any language ● source $OPENSHIFT_CARTRIDGE_SDK_BASH ● The software you are packaging must either be on the system or included in your cartridge
  • 5. Minimal Cartridge – identify cartridge +- bin | +- setup | +- control +- env +- metadata | +- manifest.yml ● Assumes packaged software already installed on system ● Most cartridges will have more files ● manifest.yml Name: dog Cartridge-Short-Name: DOG . : Version: ‘1.0’ Cartridge-Version: 0.0.1 Cartridge-Vendor: honce
  • 6. Minimal Cartridge – required files +- bin | +- setup | +- control +- env +- metadata | +- manifest.yml ● Assumes packaged software already installed on system ● Most cartridges will have more files ● manifest.yml Name: dog Cartridge-Short-Name: DOG . : Version: ‘1.0’ Cartridge-Version: 0.0.1 Cartridge-Vendor: honce
  • 7. Minimal Cartridge +- bin | +- setup | +- control +- env +- metadata | +- manifest.yml ● Assumes packaged software already installed on system ● Most cartridges will have more files ● manifest.yml Name: dog Cartridge-Short-Name: DOG . : Version: ‘1.0’ Cartridge-Version: 0.0.1 Cartridge-Vendor: honce
  • 8. My Cartridge needs to be seen! +- bin | +- … | +- control +… ● control Arguments ● start ● stop ● manifest.yml . : Endpoints: - Private-IP-Name: IP Private-Port-Name: PORT Private-Port: 8080 Public-Port-Name: PROXY_PORT Mappings: - Frontend: "" Backend: "" ● Environment Variables OPENSHIFT_<SHORT_NAME>_IP OPENSHIFT_<SHORT_NAME>_PORT OPENSHIFT_…_PROXY_PORT
  • 9. My Cartridge needs to be invoked +- bin | +- … | +- control +… ● Basic control arguments ● start ● stop ● manifest.yml . : Endpoints: - Private-IP-Name: IP Private-Port-Name: PORT Private-Port: 8080 Public-Port-Name: PROXY_PORT Mappings: - Frontend: "" Backend: ""
  • 10. My Cartridge needs to be seen! +- bin | +- … | +- control +… ● Basic control arguments ● start ● stop ● manifest.yml . : Endpoints: - Private-IP-Name: IP Private-Port-Name: PORT Private-Port: 8080 Public-Port-Name: PROXY_PORT Mappings: - Frontend: "" Backend: ""
  • 11. Tip: control script can be trivial . : case “$1” in start) /usr/sbin/httpd -C "Include $OPENSHIFT_DOG_CONF_DIR/*.conf" -f $HTTPD_CFG_FILE -k start ;; stop) … -k stop ;; restart) … -k restart ;; esac
  • 12. My Cartridge needs help, a database cartridge +- hooks | +- … | +- publish-db-connection-info +… ● manifest.yml . : Publishes: publish-db-connection-info: Type: "ENV:NET_TCP:db:connection-info" ● Pub/Sub Protocol ● publish-db-connection-info is a script echo OPENSHIFT_MYSQL_DB_HOST=$OPENSHIFT_GEAR_DNS echo OPENSHIFT_MYSQL_DB_PORT=$OPENSHIFT_MYSQL_DB_PROXY_PORT echo OPENSHIFT_MYSQL_DB_URL=”mysql://…/”
  • 13. My Cartridge needs help, a database cartridge! ● manifest.yml . : Publishes: publish-db-connection-info: Type: "ENV:NET_TCP:db:connection-info" ● Publish/Subscribe Protocol ● publish-db-connection-info is a script echo OPENSHIFT_MYSQL_DB_HOST=$OPENSHIFT_GEAR_DNS echo OPENSHIFT_MYSQL_DB_PORT=$OPENSHIFT_MYSQL_DB_PROXY_PORT echo OPENSHIFT_MYSQL_DB_URL=”mysql://…/”
  • 14. My Cartridge needs needs to be listening ● Pub/Sub Protocol ● The Type: element determines both the message format and whether the subscribe hook may be implemented in the Platform ● A provided hook script will be run in place of Platform code ● manifest.yml . : Subscribes: set-db-connection-info: Type: “ENV:NET_TCP:db:connection-info” Required: false
  • 15. Let the Platform the cartridge can use a database ● Pub/Sub Protocol ● The Type: element determines both the message format and whether the subscribe hook may be implemented in the Platform ● A provided hook script will be run in place of Platform code ● manifest.yml . : Subscribes: set-db-connection-info: Type: “ENV:NET_TCP:db:connection-info” Required: false
  • 16. Let the Platform the cartridge can use a database ● Pub/Sub Protocol ● The Type: element determines both the message format and whether the subscribe hook may be implemented in the Platform ● A provided hook script will be run in place of Platform code ● manifest.yml . : Subscribes: set-db-connection-info: Type: “ENV:NET_TCP:db:connection-info” Required: false
  • 17. My Cartridge needs to be listening for databases ● Pub/Sub Protocol ● The Type: element determines both the message format and whether the subscribe hook may be implemented in the Platform ● A provided hook script will be run in place of Platform code ● manifest.yml . : Subscribes: set-db-connection-info: Type: “ENV:NET_TCP:db:connection-info” Required: false
  • 18. My Cartridge needs to be listening for databases ● Pub/Sub Protocol ● The Type: element determines both the message format and whether the subscribe hook may be implemented in the Platform ● A provided hook script will be run in place of Platform code ● manifest.yml . : Subscribes: set-db-connection-info: Type: “ENV:NET_TCP:db:connection-info” Required: false
  • 19. Customize Work Flows ● Cartridge Authors ● Implement additional control actions ● Provide optional scrips ● Application Developers ● .openshift/action_hooks ● .openshift/markers ● git pushed from developers repository
  • 20. For Language Frameworks: A sample application ● template directory ● Checked in as the gear's initial git repository ● A “complete” application demonstrating that your cartridge is ready for business ● If you should add the manifest element: ● Install-Build-Required: false ● Speeds up the installation of your cartridge ● You need to do work for the application developer
  • 21. Environment Variables The Node/Application/Gear/Cartridge all have shared environment variables in their scope ● Node Scope variables ● /etc/openshift/env ● Gear Scope ● .../<gear uuid>/.env ● Application Scope ● .../<gear uuid>/.env/<cartridge name> ● Cartridge Scope ● .../<gear uuid>/<cartridge name>/env
  • 22. Example Platform Environment Variables ● OPENSHIFT_APP_NAME ● OPENSHIFT_APP_DNS ● OPENSHIFT_DATA_DIR ● OPENSHIFT_HOMEDIR ● OPENSHIFT_TMP_DIR ● OPENSHIFT_<SHORT NAME>_DIR ● OPENSHIFT_<SHORT NAME>_IP ● OPENSHIFT_<SHORT NAME>_PORT ● You and application developer use these to tie into the software you are packaging ● System tracks them and builds the correct process environment for you
  • 23. Creating An Application With Your Cartridge ● rhc create-app dog001 http://…/metadata/manifest.yml ● Tip: use raw URL from github ● manifest.yml contains Source-Url element ● Source-Url addresses root of your cartridge ● Tip: use download zip file from github repository
  • 24. Tip: Origin VM as a development platform ● http://openshift.github.io/ ● Broker-Node communication ● /var/log/mcollective.log ● Node logging ● /var/log/openshift/node/platform.log ● Node detailed logging ● /var/log/openshift/node/platform-trace.log ● Warning: Origin – Fedora 18 Online – RHEL 6
  • 25. Tip: Examples – Online Cartridges ● http://tinyurl.com/online-cartridges ● JBoss EWS: multiple versions of packaged software and support for multiple java versions ● MySQL: pub/sub database connections ● PHP My Admin: one cartridge dependent on another
  • 26. Tip: Using bash for scripts ● -e and -u options are your friends ● -e exit on error ● -u using unset variable is an error ● -x for debugging ● Bash “SDK” (Library of functions) ● source $OPENSHIFT_CARTRIDGE_SDK_BASH
  • 27. ERB File Rendering ● Unified method of doing value substitutions in configuration files ● httpd.conf, php.ini, etc ● metadata/managed_files.yml ● processed_templates: - '**/*.erb' ● All environment variables available ● No code can be executed
  • 28. Title here Text with no bullets ● Bullets layer one ● Bullets layer two ● Bullets layer three
  • 29. Additional Resources! ● Cartridge Writing Guide: http://tinyurl.com/writing-cartridges ● IRC Freenode ● #openshift (application developers) ● #openshift-dev (PaaS development) ● #openshift-dev-node (cartridge/node development) ● Email ● dev@lists.openshift.redhat.com
  • 30. For more information: http://openshift.github.io Follow us on twitter: @openshift Join us on irc (freenode): openshift