Skip to content
This repository has been archived by the owner on May 18, 2021. It is now read-only.

Getting Started

David Phillips edited this page May 31, 2014 · 5 revisions

This guide provides a walk-through for setting up Airship on EC2 for deploying your own software.

Requirements

  1. Java 7
  2. Git
  3. Sonatype Nexus repository manager
  4. Snapshot and release repositories in Nexus to which you can publish
  5. A group in Nexus that contains both central and your own repositories from #4

Config Bundles

Airship uses config bundles, which are simply ZIP files that contain a directory structure to overlay onto the deployed package. For example, a config bundle might contain an etc directory with some config files.

Config bundles are stored in the Nexus repository as versioned, immutable artifacts, just like any other artifact. The Maven coordinates for configs are prefixed by an @ sign when specified on the Airship command line in order to differentiate them from binary package coordinates.

Creating Config Bundles

Setup asconfig

Download the config bundler tool, name it asconfig, make it executable and add it to your PATH:

curl -Lf -o asconfig "http://search.maven.org/remotecontent?filepath=io/airlift/airship/airship-config-bundler/0.13/airship-config-bundler-0.13-executable.jar"
chmod +x asconfig
# copy asconfig to ~/bin, /usr/local/bin, etc.

Create config repository

Create a directory for configs and initialize the Git repository, changing the Nexus repository names and URLs to match those of your Nexus installation:

mkdir config
cd config
asconfig init \
  --groupId com.example.config \
  --releasesRepository releases \
  --releasesRepositoryUri http://nexus.example.com:8181/nexus/content/repositories/releases \
  --snapshotsRepository snapshots \
  --snapshotsRepositoryUri http://nexus.example.com:8181/nexus/content/repositories/snapshots

This creates a new config repository and template branch. The template branch is used as the template for creating new config bundles. You can utilize it for files such as etc/jvm.config that are required by everything and generally have the same contents.

Create config bundle for Airship coordinator

Create a branch for the Airship coordinator config bundle:

asconfig add airship-coordinator

Create the first required file, etc/jvm.config, which specifies the configuration for the coordinator JVM:

-server
-Xmx256M
-XX:+UseConcMarkSweepGC
-XX:+ExplicitGCInvokesConcurrent
-XX:+HeapDumpOnOutOfMemoryError
-XX:+UseGCOverheadLimit
-XX:OnOutOfMemoryError="kill -9 %p"
-XX:+AggressiveOpts
-XX:+DoEscapeAnalysis
-XX:+UseCompressedOops

Create the second required file, etc/config.properties, which contains the configuration for the coordinator server:

airship.version=0.13
http-server.http.port=28888

coordinator.repository=http://nexus.example.com:8181/nexus/content/groups/public/

coordinator.default-group-id=io.airlift.airship,io.airlift.discovery,com.example.config,com.example.foo
[email protected]:agent-aws-${instanceType}:1-SNAPSHOT

coordinator.provisioner=aws

coordinator.aws.coordinator.ami=ami-01234567
coordinator.aws.coordinator.keypair=keypair
coordinator.aws.coordinator.security-group=default
coordinator.aws.coordinator.default-instance-type=t1.micro

coordinator.aws.agent.ami=ami-01234567
coordinator.aws.agent.keypair=keypair
coordinator.aws.agent.security-group=default
coordinator.aws.agent.default-instance-type=t1.micro

The above configuration requires some changes to match your own environment:

  • Replace the value of coordinator.repository with your own Nexus group that aggregates the central repository and your releases and snapshots repositories.
  • The value coordinator.default-group-id is a comma-separated list of default Maven group IDs. This lets you avoid specifying the group ID for groups that you commonly use. The example contains the following:
    • io.airlift.airship: for the Airship agents
    • io.airlift.discovery: for the Discovery server
    • com.example.config: for your configs -- use the same groupId that you used when running asconfig init
    • com.example.foo: for your binaries -- use whatever group(s) you use internally in your organization
  • Replace the value of coordinator.aws.coordinator.ami and coordinator.aws.agent.ami with your own AMI identifier. This AMI must be a Ubuntu Cloud AMI that contains Java 7 and Ruby 1.9.2+ in the ubuntu user's PATH.

Commit your changes using Git, then deploy a snapshot config bundle:

asconfig snapshot

This will deploy version 1-SNAPSHOT of the config. Deploying snapshots is useful while testing configuration changes since it doesn't increment the version number.

TODO: Agent config

Create etc/config.properties, which contains the configuration for the agent server:

http-server.http.port=28889

TODO: Provision coordinator

TODO: Provision agents

TODO: Install Discovery server