Platform as a Service from a Developer perspective
andi@osec.pl
Andrzej Goławski
IT barcamp 15.06.2015
code
deploy
run
Cloud Foundry
Heroku
MS Azure
Google app engine
OpenShift
May 2011
Nov 2012
June 2013
Comming 2015
develope mode
enterprise v1
full online mode
v3
Small
Medium
Large
Standalone:
JBoss Application Server 7
PHP 5.3
PHP 5.4
Embedded:
Node.js 0.10
MySql 5.5
Cron 1.4
Drupal
WordPress
Django
CakePHP
RHC - client command-line
The OpenShift web console
IDE plug-ins
install (Ruby 1.8.7 required)
$ gem install rhc
setup
$ rhc setup
OpenShift Client Tools (RHC) Setup Wizard
This wizard will help you upload your SSH keys, set your application namespace,
and check that other programs like Git are properly installed.
If you have your own OpenShift server, you can specify it now. Just hit enter to
use the server for OpenShift Online: openshift.redhat.com.
Enter the server hostname: |openshift.redhat.com|
You are using 4 of 50 total gears
The following gear sizes are available to you: small, medium, large
Your client tools are now configured.
Application-dir
.openshift
action_hooks
config
modules
standalone.xml
cron
daily
hourly
minutely
monthly
weekly
markers
src
pre-build
build
post-deploy
deploy
#!/bin/bash
minute=$(date '+%M')
if [ $minute != 12 ]; then
exit
fi
# rest of the script
skip_maven_build
force_clean_build
hot_deploy
java7
<profiles>
<profile>
<!-- When built in OpenShift the 'openshift' profile will be used when invoking mvn. -->
<!-- Use this profile for any OpenShift specific customization your app will need. -->
<!-- By default that is to put the resulting archive into the 'deployments' folder. -->
<!-- http://maven.apache.org/guides/mini/guide-building-for-different-environments.html -->
<id>openshift</id>
<build>
<finalName>testapp</finalName>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<outputDirectory>deployments</outputDirectory>
<warName>ROOT</warName>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
$ git add .
$ git commit -m "Some changes to my application"
$ git push
scale horizontally
(scale out)
scale vertically
(scale up)
logs
$ rhc tail registration
2015/06/15 00:12:23,270 INFO [org.jboss.weld.deployer] (MSC service thread 1-3) JBAS016008: Starting weld service for deployment registration.war
2015/06/15 00:12:23,868 INFO [org.jboss.web] (MSC service thread 1-3) JBAS018210: Registering web context: /barcamp-registration
2015/06/15 00:12:23,949 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "registration.war"
2015/06/15 00:13:58,752 INFO [org.jboss.resteasy.cdi.CdiInjectorFactory] (http--127.2.72.129-8080-1) Found BeanManager at java:comp/BeanManager
2015/06/15 00:13:58,772 INFO [org.jboss.resteasy.spi.ResteasyDeployment] (http--127.2.72.129-8080-1) Deploying javax.ws.rs.core.Application: class pl.osec.barcamp.registration.web.WebApplication$Proxy$_$$_WeldClientProxy
2015/06/15 00:34:21,656 INFO [org.apache.tomcat.util.net.JIoEndpoint] (http--127.2.72.129-8080-Acceptor-0) Maximum number of threads (64) created for connector with address 127.2.72.129/127.2.72.129 and port 8080
$ rhc app-show --gears quota -a registration
Gear Cartridges Used Limit
------------------------ ------------------------------- ------ -----
557e5072653e8a2f54000014 jbossas-7 datadog-datadog-5.0.0 111 MB 1 GB
disk usage
quick cleaning
$ rhc app tidy -a registration
rhc set-env DATADOG_API_KEY=ef874044026e3c96a94af649d9435d7c -a registration
rhc cartridge-add
http://cartreflect-claytondev.rhcloud.com/github/datadog/datadog-openshift
-a registration
The cartridge 'http://cartreflect-claytondev.rhcloud.com/github/datadog/datadog-openshift'
will be downloaded and installed
Adding http://cartreflect-claytondev.rhcloud.com/github/datadog/datadog-openshift
to application 'registration' ... done
datadog-datadog-5.0.0 (Datadog Agent 5.0.0)
-------------------------------------------
From: http://cartreflect-claytondev.rhcloud.com/github/datadog/datadog-openshift
Website: https://github.com/DataDog/datadog-openshift
Gears: Located with jbossas-7