Skip to content

Latest commit

 

History

History
156 lines (109 loc) · 4.92 KB

DEVELOPER.md

File metadata and controls

156 lines (109 loc) · 4.92 KB

Developer

This document describes how to set up your development environment to build and develop Aerie.

Prerequisite Software

Before you can run Aerie you must install and configure the following products on your development machine:

  • Git and/or the GitHub app; GitHub's Guide to Installing Git is a good source of information.

  • Docker which is used to run the Aerie services.

  • OpenJDK Temurin LTS which is used to build the Java-based Aerie services. If you're on OSX you can use brew:

    brew install --cask temurin

    Make sure you update your JAVA_HOME environment variable. For example with Zsh you can set your .zshrc to:

    export JAVA_HOME="/Library/Java/JavaVirtualMachines/temurin-21.jdk/Contents/Home"
  • PostgreSQL which is used for testing the database. You do not need this normally since Aerie runs Postgres in a Docker container for development, and you only need it for the psql command-line tool. Do not run the Postgres service locally or it will clash with the Aerie Postgres Docker container. If you're on OSX you can use brew:

    brew install postgresql

Code Editor

If you use IntelliJ IDEA, you can import the Aerie repository into IntelliJ as a Gradle project. No additional configuration is required.

Getting the Sources

Clone the Aerie repository:

git clone https://github.com/NASA-AMMOS/aerie.git
cd aerie

Building

cd aerie
./gradlew assemble

Testing

cd aerie
./gradlew test

Dependency Updates

Use the following task to print a report of the dependencies that have updates available.

cd aerie
./gradlew dependencyUpdates

Environment

To run the Aerie services you need to first set the proper environment variables. First copy the template:

cd aerie
cp .env.template .env

Fill out the .env file with the following default environment variables (note you should not use these values in production):

AERIE_PASSWORD=aerie
AERIE_USERNAME=aerie
HASURA_GRAPHQL_ADMIN_SECRET=aerie
HASURA_GRAPHQL_JWT_SECRET='{ "type": "HS256", "key": "oursupersecretsupersecurekey1234567890" }'
POSTGRES_PASSWORD=postgres
POSTGRES_USER=postgres

Start Aerie

The docker-compose.yml in the root directory deploys Aerie locally, creating containers using the artifacts from the build step above.

cd aerie
docker-compose up --build --detach

Once Aerie is started you can visit http://localhost to view the Aerie UI. You can visit http://localhost:8080 to view the Hasura Console.

Stop Aerie

cd aerie
docker compose down

Remove Docker Images

Removing a docker image from your local cache forces Docker to either rebuild it or fetch it from a repository (e.g. DockerHub or GitHub Packages).

docker rmi [image name or image id]

Remove Docker Volumes

Sometimes it's necessary to clear the contents of file system volumes mounted by Docker. For Aerie this could be needing to start with a clean install and wanting to delete the database contents, mission model jars, and mission simulation data files.

First ensure all containers are down. Only once containers are down you can run volume pruning operation:

docker volume prune

Entering a Docker Container

At times it is helpful to enter a docker container and inspect the filesystem or run CLI utilities such as psql or hasura-cli. For example a shell can be initialized in the Postgres container with:

docker exec -it aerie-postgres /bin/sh

Apple Silicon

If you're having issues building the Docker containers with Apple Silicon you can try setting the follow environment variables. This will disable BuildKit and try to default to using linux/arm as the platform.

export DOCKER_DEFAULT_PLATFORM=linux/arm64
export DOCKER_BUILDKIT=0