This project uses Lightbend Orchestration to simplify deployment of Chirper to DC/OS. Follow the steps below to install Chirper in your own local DC/OS environment.
You'll need to ensure that the following software is installed on your Linux or macOS machine:
- Docker
- dcos
- reactive-cli 1.1.0 or later (Verify with
rp version)
Additionally, you'll need access to a DC/OS cluster and a Docker registry.
Finally, make sure that Cassandra and marathon-lb are deployed in your cluster.
dcos-vagrant can be used to provision a DC/OS cluster locally. This method does require a lot of memory to run the various DC/OS and Cassandra nodes, however. Success has been achieved with 32GB machines.
dcos-vagrant can be configured to deploy a built-in Docker registry by running the following before issuing vagrant up:
export DCOS_PRIVATE_REGISTRY=trueThe registry will then be available on boot.dcos:5000.
Once you've set up your environment, you can deploy Chirper to DC/OS. This involves building Docker images and then using a CLI tool to generate the DC/OS Marathon configuration.
See Lightbend Orchestration for DC/OS Documentation
Ensure you're using reactive-cli or newer. You can check the version with rp version.
dcos cluster listThis workflow relies on building Docker images and pushing them to a registry. Be sure to adjust the command below to point to your specific registry.
export DOCKER_REPOSITORY=boot.dcos:5000Build and publish the Docker images. Be sure to update the -DdockerRepository=... argument below.
sbt "-DdockerRepository=$DOCKER_REPOSITORY" clean docker:publishFinally, you're ready to deploy the services. The following commands will generate the marathon configuration for you and pipe it to dcos marathon app add.
Be sure to adjust the secret variables and cassanda service address as necessary. Additionally, you'll want to add
an entry to /etc/hosts pointing "chirper.dcos" to your public node's IP address. In a production environment, this will need to
be a real DNS entry.
# /etc/hosts
192.168.65.60 chirper.dcos
Configuration
First, set some variables for the following commands. This defines the secrets for the services, the group to deploy them in, the host where they'll be accessed, and the location of Cassandra. Be sure to change as appropriate for your environment.
chirp_secret=changeme
friend_secret=changeme
activity_stream_secret=changeme
front_end_secret=changeme
dcos_group=chirper
host=chirper.dcos
cassandra_svc="_native-client._node-0-server._tcp.cassandra.mesos"Deploy chirp-impl
rp generate-marathon-configuration "$DOCKER_REPOSITORY/chirp-impl:1.0.0-SNAPSHOT" \
--namespace "$dcos_group" \
--env JAVA_OPTS="-Dplay.http.secret.key=$chirp_secret -Dplay.filters.hosts.allowed.0=$host" \
--marathon-lb-host "$host" \
--external-service "cas_native=$cassandra_svc" \
--instances 2 | dcos marathon app addDeploy friend-impl
rp generate-marathon-configuration "$DOCKER_REPOSITORY/friend-impl:1.0.0-SNAPSHOT" \
--namespace "$dcos_group" \
--env JAVA_OPTS="-Dplay.http.secret.key=$friend_secret -Dplay.filters.hosts.allowed.0=$host" \
--marathon-lb-host "$host" \
--external-service "cas_native=$cassandra_svc" \
--instances 2 | dcos marathon app addDeploy activity-stream-impl
rp generate-marathon-configuration "$DOCKER_REPOSITORY/activity-stream-impl:1.0.0-SNAPSHOT" \
--namespace "$dcos_group" \
--env JAVA_OPTS="-Dplay.http.secret.key=$activity_stream_secret -Dplay.filters.hosts.allowed.0=$host" \
--marathon-lb-host "$host" \
--instances 1 | dcos marathon app addDeploy front-end
rp generate-marathon-configuration "$DOCKER_REPOSITORY/front-end:1.0.0-SNAPSHOT" \
--namespace "$dcos_group" \
--marathon-lb-host "$host" \
--env JAVA_OPTS="-Dplay.http.secret.key=$front_end_secret -Dplay.filters.hosts.allowed.0=$host" | dcos marathon app addNow that you've deployed your services, you can use dcos to
inspect the deployment, and your favorite web browser to use the application.
Open the URL this command prints in the browser
echo "http://$host/"