An example service project outlining our DevOps project setup
Clone this project with
git clone [email protected]:OAODEV/helloService.git
The hello service runs a TCP server that says hello. The greeting is read from
the greeting
envar. It will also say who it is from, taking the
environment name from the environment it's deployed in.
The service is contained in app/serve_hello.py
. This file is heavily
documented, describing operations considerations.
The unit tests are in test_hello_service.py
. This is nothing unusual
and has operations considerations documented.
The following files are required in the project root to hook into the operations platform.
This is the file that developers use to create the contained service. For the most part, that means creating the environment, installing dependencies, putting files in place, setting envionment variables, and so on. The platform will use this file to build the container and provide that container with the command to run the service. The Dockerfile in this project has more specific documentation.
More information on docker containers.
This file describes the services to herd, offering certain specifics about the service, information the platform requires to work with it. Details are documented in the Manifest file
Each Dockerfile
must put the Manifest
at /Manifest
so that the
platform may access it in a known location.
ADD Manifest /Manifest
This file simply holds the semantic version of the application at the commit. Fully optional.
The configuration file for our CI Service. Just copy the file here into your
project root, then update the herd_service_name
and herd_unittest_cmd
lines
under machine -> environment
machine:
services:
- docker
environment:
herd_service_name: <service name>
herd_unittest_cmd: <unittest cmd>
The unittest cmd
and service name
should be the same as in the Manifest
file.
This file is not part of the repository. It is passed to the configure command.
It should be a file with one <key>=<value>
statement per line.
message="Hello World."
git clone [email protected]:OAODEV/hello-service.git
cd hello-service
echo "# `whoami` ran the tutorial on `date`\n" >> app/serve_hello.py
git commit --am "adds importand comment"
For details on the herd command integrate
see https://github.com/OAODEV/herd#integrate
herd integrate
This is currently a manual process. If the build passes, we go over to CircleCI, click into our build then look for where it says
echo "The build name is in here!!!" r.iadops.com/$herd_service_name:$herd_build_tag
It's in there and should look like this.
r.iadops.com/hello:<semver>_build.<hash>
First create or locate a config file
echo "greeting=<your personal greeting>" > hello.conf
Then use that to configure the build using the build name you noted earlier. This will result in a Release.
herd configure r.iadops.com/hello:<semver>_build.<hash> ./hello.conf
If this succeeds, it will print out the details of the Release that was created. Note the release number.
herd deploy <Release Number> <host[:port]>