-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from nsidc/docker
Dockerize & continuously deliver docker images
- Loading branch information
Showing
4 changed files
with
110 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: "Build & publish artifacts" | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
- "v2" # TODO: Remove before merge! | ||
tags: | ||
- "v[0-9]+.[0-9]+.[0-9]+*" | ||
|
||
concurrency: | ||
group: "${{ github.workflow }}-${{ github.ref }}" | ||
cancel-in-progress: true | ||
|
||
env: | ||
# Many color libraries just need this to be set to any value, but at least | ||
# one distinguishes color depth, where "3" -> "256-bit color". | ||
FORCE_COLOR: 3 | ||
|
||
jobs: | ||
build-and-publish-docker-image: | ||
name: "Build and publish Docker image" | ||
uses: "nsidc/.github/.github/workflows/build-and-publish-container-image.yml@main" | ||
secrets: "inherit" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM mambaorg/micromamba:1.5.8-alpine3.20 | ||
|
||
WORKDIR /app | ||
|
||
# Activate the conda environment during build process | ||
ARG MAMBA_DOCKERFILE_ACTIVATE=1 | ||
|
||
COPY ./conda-lock.yml . | ||
|
||
# NOTE: `-p` is important to install to the "base" env | ||
RUN micromamba install -y \ | ||
-p /opt/conda \ | ||
-f conda-lock.yml \ | ||
&& micromamba clean --all --yes | ||
|
||
|
||
# Install source | ||
COPY ./pyproject.toml . | ||
COPY ./antarctica_today ./antarctica_today | ||
COPY ./qgis ./qgis | ||
|
||
# TODO: `pip install --editable .` | ||
ENV PYTHONPATH=. | ||
|
||
# Extend the default micromamba entrypoint to use our CLI | ||
ENTRYPOINT ["/usr/local/bin/_entrypoint.sh", "python", "antarctica_today"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
services: | ||
cli: | ||
image: "nsidc/antarctica_today:local" | ||
build: "." | ||
user: "root" | ||
volumes: | ||
- "./Tb/:/app/Tb/" | ||
- "./data/:/app/data/" | ||
- "./database/:/app/database/" | ||
- "./plots/:/app/plots/" | ||
- "./baseline_datasets/:/app/baseline_datasets/:ro" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters