This document describes how to set up your development environment to build and develop PlanDev.
- Prerequisite Software
- Code Editor
- Getting the Sources
- Building
- Testing
- Dependency Updates
- Environment
- Start PlanDev
- Stop PlanDev
- Remove Docker Images
- Remove Docker Volumes
- Entering a Docker Container
- Apple Silicon
Before you can run PlanDev 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 PlanDev services.
-
OpenJDK Temurin LTS which is used to build the Java-based PlanDev services. If you're on OSX you can use brew. Note PlanDev is currently compatible with Java temurin V21, which can be installed with brew using:
brew install --cask temurin@21
Make sure you update your
JAVA_HOMEenvironment variable. For example with Zsh you can set your.zshrcto: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 PlanDev 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 PlanDev Postgres Docker container. If you're on OSX you can use brew:
brew install postgresql
If you use IntelliJ IDEA, you can import the PlanDev repository into IntelliJ as a Gradle project. No additional configuration is required.
Clone the PlanDev repository:
git clone https://github.com/NASA-AMMOS/plandev.git
cd plandevcd plandev
./gradlew assemblecd plandev
./gradlew testUse the following task to print a report of the dependencies that have updates available.
cd plandev
./gradlew dependencyUpdatesTo run the PlanDev services you need to first set the proper environment variables. First copy the template:
cd plandev
cp .env.template .envFill 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=postgresThe docker-compose.yml in the root directory deploys PlanDev locally, creating containers using the artifacts from the build step above.
cd plandev
docker-compose up --build --detachOnce PlanDev is started you can visit http://localhost to view the PlanDev UI. You can visit http://localhost:8080 to view the Hasura Console.
cd plandev
docker compose downRemoving 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]Sometimes it's necessary to clear the contents of file system volumes mounted by Docker. For PlanDev 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 pruneAt 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/shIf 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