-
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.
Add Docker build config and continuous delivery
- Loading branch information
Showing
4 changed files
with
101 additions
and
0 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,54 @@ | ||
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-python-package: | ||
# name: Build Python package | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# with: | ||
# fetch-depth: 0 | ||
# - uses: hynek/build-and-inspect-python-package@v2 | ||
|
||
# publish-python-package: | ||
# name: Publish Python package to PyPI | ||
# if: github.ref_type == 'tag' | ||
# needs: ["build-python-package"] | ||
# runs-on: ubuntu-latest | ||
# environment: pypi | ||
# permissions: | ||
# id-token: write | ||
# steps: | ||
# - uses: actions/download-artifact@v4 | ||
# with: | ||
# name: Packages | ||
# path: dist | ||
|
||
# - uses: pypa/gh-action-pypi-publish@release/v1 | ||
# if: github.event_name == 'release' && github.event.action == 'published' | ||
# with: | ||
# # Remember to tell (test-)pypi about this repo before publishing | ||
# # Remove this line to publish to PyPI | ||
# repository-url: https://test.pypi.org/legacy/ | ||
|
||
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