Developer's Guide to the Reactive Interaction Gateway
You'd like to help hacking? Great! To get started, install Elixir and the Mix build tool on your machine. If you use asdf, all you need to do is asdf install
. Otherwise, either follow the instructions on the Elixir website, or use kiex to install and manage Elixir runtimes.
With Elixir installed, do this:
- Install dependencies with
mix deps.get
- Start Phoenix endpoint with
mix phx.server
RIG doesn't come with a status website, but if you like to you can check its health endpoint:
$ curl localhost:4000
{"message":"Route is not available"}
$ curl localhost:4010/health
OK
Additional notes:
- You can run tests with
mix test
. See CONTRIBUTING.md for more details. - When debugging multi-node features, it's helpful to run the (named) nodes in
iex
sessions usingiex --sname nodename -S mix
.
Our conventions are documented in guides/architecture/decisions/
. See 0001-record-architecture-decisions.md for more details.
Project Layout
Run mix docs
to see the source documentation. The module descriptions should make the code structure obvious; if they don't, please open an issue describing what you were looking for but couldn't find. Also, updates to the (source code) documentation are appreciated!
Incrementing Elixir and OTP versions
To have the project use a newer Elixir version, make sure to change the following locations:
.travis.yml
: Update the Elixir and OTP versions in the.elixir-env
section.Dockerfile
,aws.dockerfile
,smoke_tests.dockerfile
: Make sure to change theFROM
image tag for both the build image (elixir:...-alpine) as well as the runtime image (erlang:...-alpine). If the Erlang runtime (ERTS) in the runtime image doesn't match the ERTS version in the build image, chances are the built image won't work due to missing libraries. Because of this, it's best to use the most recent versions for both images when upgrading - they should always be compatible..tool-versions
: Again, make sure both the Elixir and the OTP versions match what you have used in the previous steps.
Releasing a new version
- Increment
@rig_version
in mix.exs - Increment
appVersion
in the Helm v2 Chart.yaml and Helm v3 Chart.yaml files - Update Helm chart README files: install helm-docs and run
helm-docs
in the root directory - Increment image tag in the Kubernetes rig.yaml file
- In CHANGELOG.md, rename
[Unreleased]
and add a corresponding link to the bottom of the file - Create a signed Git tag either using
git -s
or by creating a release using the Github UI
Test Tags
We use tag
s to group tests together. Often, it makes sense to assign more than one tag to a test case.
@tag | When to use it? |
---|---|
:avro | Integration tests that require a running Avro schema registry. |
:kafka | Integration tests that require a running Kafka broker. |
:kinesis | Integration tests that require an active Kinesis stream. |
:smoke | Quick integration test that is designed to catch obvious integration problems. |