Skip to content

mbta/concentrate

Folders and files

NameName
Last commit message
Last commit date
Dec 31, 2024
May 14, 2024
Oct 20, 2023
Feb 20, 2018
Jan 29, 2025
Dec 31, 2024
Oct 23, 2023
Jan 29, 2025
Jan 3, 2024
Dec 19, 2017
Dec 11, 2018
Dec 15, 2017
Dec 22, 2017
Jun 27, 2024
Jun 27, 2024
Dec 15, 2017
Dec 31, 2024
May 14, 2019
Dec 31, 2024
Jun 27, 2024
Oct 21, 2024

Repository files navigation

Concentrate

Elixir CI

Concentrate combines realtime transit information from multiple sources into single output files.

Configuration

Concentrate can either be configured via config/config.exs or a JSON environment variable as CONCENTRATE_JSON: more details are available in configuration.md.

Architecture

See architecture.md for the overall architecture of the system.

Development Setup

# after installing asdf from https://github.com/asdf-vm/asdf..
asdf install

# get Elixir dependencies
mix deps.get

# add pre-commit hook to verify formatting/tests/types
ln -s ../../hooks/pre-commit .git/hooks/pre-commit

# make sure everything passes! (slowest to fastest)
mix format --check-formatted
mix credo
mix dialyzer

See the section on tests below for information on running unit tests, which requires having a local MQTT broker running.

If you run into issues compiling snabbkaffe:

rm -fr deps/quicer
mix deps.get
mix deps.compile

Tests

To run the tests, first install and setup Colima, Docker, and docker-compose:

brew install docker docker-compose colima
colima start
mkdir -p ${DOCKER_CONFIG:-"~/.docker"}/cli-plugins
ln -sfn /opt/homebrew/opt/docker-compose/bin/docker-compose ${DOCKER_CONFIG:-"~/.docker"}/cli-plugins/docker-compose

Then, start the Compose configuration in a separate window or tab and run the tests:

  1. docker compose up
  2. mix test

Docker

Concentrate comes with a Dockerfile, allowing you to build an image that can be run anywhere Docker works. It's a multi-stage build, so it requires at least Docker 17.05.

# build
docker build -t concentrate:latest .

# run
docker run concentrate:latest