A demonstration of a subsetter capability based on GDAL to be used with Harmony.
These instructions only apply to building and developing the service. The example
service will be pulled automatically by Harmony from the harmonyservices/service-example
repository on demand.
For building & pushing the image locally:
For local development:
- miniconda3-24.7.1 (can be installed via pyenv)
- Create a conda virtual environment:
$ conda env create -n venv --file environment-dev.yml
- Activate the virtual environment:
$ conda activate venv
# Run the tests once:
$ make test
# Run the tests continuously in watch mode:
$ make test-watch
You may want to test Harmony Service Example with an unreleased version of the Harmony Service Library. This might be someone else's feature or bug-fix branch, or perhaps your own local changes. If you haven't already, clone the Harmony Service Library and switch to an unreleased branch or make your local changes. Typically this clone would be in a sibling directory of Harmony Service Example:
$ git clone https://github.com/nasa/harmony-service-lib-py ../harmony-service-lib-py
Then install it into your conda environment in development mode. Subsequent changes to the Harmony Service Library will be reflected immediately without need to install it again:
$ pip install -e ../harmony-service-lib-py
-
Build the Docker image (installs Harmony Service Library from PyPI):
$ make build-image
If the Docker build does not complete and or this breaks your local Docker environment, try increasing the memory allocated to your Docker environment.
If you'd like the Docker image to include a local version of the Harmony Service Library, set the LOCAL_SVCLIB_DIR
environment variable to its location and build:
$ make build-image LOCAL_SVCLIB_DIR=../harmony-service-lib-py
-
(Optional) Deploy (publish) the Docker image to Amazon ECR:
$ make push-image
If you plan to build the Docker image and are running Docker in Docker, you'll also want to create a .env file and populate it with the following:
# Harmony-Service-Example Environment Variables
# Set to 'true' if running Docker in Docker and the docker daemon is somewhere other than the current context
DIND=true
# Set the PLATFORM varible to define the platform of the build output
PLATFORM=linux/amd64
# Indicates where docker commands should find the docker daemon
DOCKER_DAEMON_ADDR=host.docker.internal:2375
The project has a Bamboo CI job running in the Earthdata Bamboo environment.