Skip to content

Commit

Permalink
move strict requirements for the Docker image to a requirements.txt file
Browse files Browse the repository at this point in the history
  • Loading branch information
aperrin66 committed Oct 9, 2024
1 parent b179308 commit 0a913a8
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 22 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ jobs:
env:
BASE_IMAGE: "${{ vars.DOCKER_ORG }}/geospaas:2.5.2-python${{ matrix.python_version }}"
IMAGE_NAME: "${{ vars.DOCKER_ORG }}/geospaas_harvesting"
METANORM_VERSION: '4.5.2'
PYTHESINT_VERSION: '1.7.0'
GEOSPAAS_DB_HOST: 'db'
GEOSPAAS_DB_USER: 'test'
GEOSPAAS_DB_PASSWORD: "${{ secrets.GEOSPAAS_DB_PASSWORD }}"
Expand Down Expand Up @@ -56,8 +54,6 @@ jobs:
target: base
build-args: |
BASE_IMAGE=${{ env.BASE_IMAGE }}
METANORM_VERSION=${{ env.METANORM_VERSION }}
PYTHESINT_VERSION=${{ env.PYTHESINT_VERSION }}
push: false
load: true
tags: 'harvesting_tests'
Expand Down Expand Up @@ -108,8 +104,6 @@ jobs:
context: .
build-args: |
BASE_IMAGE=${{ env.BASE_IMAGE }}
METANORM_VERSION=${{ env.METANORM_VERSION }}
PYTHESINT_VERSION=${{ env.PYTHESINT_VERSION }}
push: ${{ github.event_name == 'release' }}
tags: |
${{ env.IMAGE_NAME }}:${{ github.ref_name }}-python${{ matrix.python_version }}
Expand Down
19 changes: 4 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
ARG BASE_IMAGE=nansencenter/geospaas:latest

# This stage can be used to run tests
FROM ${BASE_IMAGE} AS base
COPY . /tmp/setup
RUN pip install --upgrade --no-cache-dir -r /tmp/setup/requirements.txt

ARG METANORM_VERSION
RUN pip install --upgrade --no-cache-dir \
https://github.com/nansencenter/metanorm/releases/download/${METANORM_VERSION}/metanorm-${METANORM_VERSION}-py3-none-any.whl \
'copernicusmarine' \
'feedparser==6.0.*' \
'graypy==2.1.*' \
'requests_oauthlib==1.3.*' \
'tblib'

ARG PYTHESINT_VERSION=''
RUN bash -c "[ -n '$PYTHESINT_VERSION' ] && pip install --upgrade 'pythesint==$PYTHESINT_VERSION' || true"

# This stage contains the full installation
FROM base

COPY . /tmp/setup
RUN pip install /tmp/setup && \
rm -rf /tmp/setup

ENTRYPOINT ["python"]
CMD ["-m", "geospaas_harvesting.cli"]
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies = [
"netCDF4",
"numpy",
"oauthlib",
"pythesint",
"pythesint>=1.7.0",
"python-dateutil",
"PyYAML",
"requests_oauthlib",
Expand Down
28 changes: 28 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Dependency requirements that can be used to build a working environment.
# For example, this is used to build the Docker image.

# strict requirements
metanorm @ git+https://github.com/nansencenter/metanorm@4.5.2
pythesint==1.7.0

# loose requirements
copernicusmarine==1.*
django-geo-spaas==2.*
django>=3
feedparser==6.*
feedparser==6.0.*
graypy==2.*
graypy==2.1.*
nansat==1.*
netCDF4==1.*
numpy==1.*
oauthlib==3.*
python-dateutil==2.*
PyYAML==5.*
requests_oauthlib==1.*
requests_oauthlib==1.3.*
requests==2.*
shapely==2.*

# necessary for running unit tests in parallel
tblib

0 comments on commit 0a913a8

Please sign in to comment.