Skip to content

Deployment

Carlos Quiroz edited this page Jun 20, 2016 · 20 revisions

Deployment

This document describes how to build and deploy distributions of applications in ocs3.

Note: All the samples in this doc refer to the seqexec but this can be replaced by any other application

Applications

It is understood as an application, a set of libraries deployed as a unit with a specific configuration and launchers, that can be deployed independently. We should be able to run an application locally for testing/development and have the ability to produce distributions that can be installed.

In those cases we also want to include a suitable JRE and a specific configuration.

The applications are packaged using the sbt-native-packager plugin appropriately customized for our case. All the application deployments will contain the same file structure with changes for the different distributions

<approot>
├── bin // Launcher scripts
│   └── seqexec-server
├── conf // Logging, app, launcher configuration
│   ├── launcher.args
│   └── logging.properties
├── log // Log files
├── jre // Java Runtime Environment when appropriate
└── lib // Binaries and dependencies
    ├── edu.gemini.ocs.seqexec_server-0.1-SNAPSHOT.jar
    ├── ...

sbt config

Applications are defined as regular projects on sbt. These applications define the app and the configuration used for deployment. For example we have

seqexec_server // for development
seqexec_server_test_l64 // for testing on linux 64
seqexec_server_production_l64 // production on linux 64

We can have more applications for example containing different configuration for different developers

Development versions

For development versions we can produce a local staged version that can be executed locally or a tar ball containing the code, configuration and launchers.

Stage

For the staged version execute in sbt

seqexec_server/universal:stage

This will produce a distribution that can be run locally, by executing the launcher at:

./app/seqexec-server/target/universal/stage/bin/seqexec-server

Note that the stage dir becomes the home for the application, and it thus contains a configuration dir

tar ball

It is possible to deploy the same setup as stage but in a tar ball with the command below

seqexec_server/universal:packageZipTarball

This will package stage into a tar ball at

app/seqexec-server/target/universal/seqexec_server-0.1-SNAPSHOT.tgz

This tar ball can be distribute but not that it does not include the jre

Test versions

A test version is mean to be deployable but contain a test configuration. As such it contains a jre for the appropriate OS, e.g. Linux 64

JRE

To build you should have a proper JRE copy of the target OS on your system. By default the build expects it at $HOME/.jres8, however you can override that by having a jres.sbt file with content like

ocsJreDir in ThisBuild := file(<myjredir>)

it is expected that you have a structure of jres with one directory for system and links to the latest version of the jre, like:

.jres8
├── linux
│   ├── JRE32_1.8 -> jre_32_1.8.0_40/
│   ├── JRE64_1.8 -> jre_64_1.8.0_40/
│   ├── jre_32_1.8.0_40
│   └── jre_64_1.8.0_40
├── osx
│   ├── JRE1.7 -> jre1.8.0_40.jre/
│   ├── JRE1.8 -> jre1.8.0_40.jre/
│   └── jre1.8.0_40.jre
└── windows
    ├── JRE1.8 -> jre1.8.0_40/
    └── jre1.8.0_40

tar ball

To make a deployable tar ball execute

seqexec_server_test_l64/universal:packageZipTarball

The resulting tar ball can be placed on a target host and executed as a daemon, e.g. with the command

nohup <app>/bin/seqexec-server &

Production versions

TODO

TODO

[ ] Specify configurations [ ] Support RPMs

Clone this wiki locally