- AWS CLI 1.10+
- AWS Account (to store artifacts, secrets)
- jabba for managing Java versions
- Rollbar Account (error reporting -- optional)
jabba use-- if you don't have that version available, also
jabba installthe version from
Setting Up AWS Account
There are a set of tasks necessary before starting development in order to provision Raster Foundry. Raster Foundry depends heavily on AWS resources and using AWS resources to manage secrets/containers/artifacts in development. If only local development is being done, the primary resource that will be used are S3 buckets to store secrets.
In the AWS account you need to create a few buckets for the following:
- A bucket to house raw data (e.g. geotiffs, JPEG2000, ingest definitions, etc.)
- A config bucket that will store secrets for development and or other environments, an exported database for development data
- A bucket to house processed data (e.g. thumbnails, processed raster RDDs)
The names of the buckets are not important, but they should be memorable and easy to parse for your own sake. On your host machine you need to set up an AWS profile for the account with the S3 buckets. For instance, to set up an AWS profile called
raster-foundry with the AWS cli the following command would be used:
$ aws configure --profile raster-foundry
You will be prompted for an access key and secret key.
Setting Development Environment Variables
.env.template file is a template file with environment variables that get injected into running containers during development. This file should be copied into the AWS config bucket created after filling in sensitive information (replacing all
PLACEHOLDER values with appropriate values for your AWS setup). When provisioning this file is copied to the development environment and injected into containers with
In addition to setting up an AWS account, you must register for an Auth0 account to produce secrets to use in the
.env file. You need to go through setting up an application and copying over the client IDs, domain, and secret.
Additionally, if you want to exercise token management in the application, you need to generate a management API app to handle managing the generation of refresh tokens for users via the management API. This is not necessary for most functionality in the application and can be deferred until later if you desire.
The last thing to set up with Auth0 are the allowed callback URLs and logout URLs. These need to be edited to allow interaction for local development from
Raster Foundry follows the approach outlined here ("Scripts to Rule Them All") to have a mostly consistent development experience. We deviate in a few specific ways:
- We don't pin / require a specific Java version. The application will eventually run in a jdk8 container, and for reproduction it's helpful to have
jabbato be able to describe issues that occur on some Java versions but not others, but largely this does not make a difference at this point.
- We expect the user to install
jabbaon their host, instead of running everything in containers. Users can choose to run everything in containers, but that's not how the development environment is organized by default.
Almost all interaction with consoles and servers can be managed via calls to a script located in
./scripts. Default values for the S3 config and data buckets in addition to AWS profile will be used if they are not set with an environment variable. Before running
scripts/bootstrap, these should be injected into your shell environment:
export RF_AWS_PROFILE=raster-foundry export RF_SETTINGS_BUCKET=rasterfoundry-development-config-us-east-1
After exporting your environment settings, you are ready to get started:
$ ./scripts/bootstrap $ ./scripts/update $ ./scripts/server
The servers should come up successfully.
Then, kill your servers. To get the database loaded with sample data, you can run
This will fetch a database dump from S3 and some development images. You can use these data for consistent testing instructions
with other developers. This script will also apply any outstanding migrations not present in the dev database.
Database migrations are managed using flyway. You can run
flyway commands with
scripts/migrate. Some commands you
can run are:
scripts/migrate migrate: apply outtanding migrations
scripts/migrate repair: reconcile the checksums of applied migrations in the database with what's present on disk
There is no command to revert migrations.
The workflow for creating a new migration is:
- Write a migration in
- Verify the schema changes in PostgreSQL with
The Vagrant configuration maps the following host ports to services running in the virtual machines. Ports can be overridden for individual developers using environment variables
|Application Server (akka)||
|Tile Server (http4s)||
|Application Server (JMX)||
|Tile Server (JMX)||
Helper and development scripts are located in the
./scripts directory at the root of this project. These scripts are designed to encapsulate and perform commonly used actions such as starting a development server, accessing a development console, or running tests.
||Pulls/builds necessary containers|
||Runs migrations, installs dependencies, etc.|
||Starts a development server|
||Gives access to a running container via
||Drops you into a
||Runs tests and linters for project|
||Invoked by CI server and makes use of
||Publish container images to container image repositories.|
||Load data for development purposes from S3|
||Perform a one-way
||Process an upload in development|
Run all the tests:
In staging and production, a batch job will automatically be kicked off for processing after a successful upload. In development, you need to process the upload manually which you can do like so:
$ ./scripts/process-upload <upload_id>