Skip to content

Commit

Permalink
[Do not merge] Split download into directory (#20)
Browse files Browse the repository at this point in the history
* Split motuclient part

* Remove wave model download

* Rename download step

* Make requirements explicit

* Make requirements available in build context

* Fix entrypoint
  • Loading branch information
willirath authored Feb 25, 2021
1 parent 392fd7f commit 4e44c5e
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 157 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/build_and_push_images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
build:
strategy:
matrix:
image_purpose: ["motupy", "netcdf2csv", "netcdf2zarr"]
image_purpose: ["motupydownload", "netcdf2zarr"]
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand Down Expand Up @@ -49,7 +49,6 @@ jobs:
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile_${{ matrix.image_purpose }}
context: ${{ matrix.image_purpose }}
tags: "${{env.LATEST_IMAGE}}, ${{env.CALVER_IMAGE}}"
push: ${{ startsWith(github.ref, 'refs/heads/master')}}
9 changes: 0 additions & 9 deletions Dockerfile_motupy

This file was deleted.

142 changes: 0 additions & 142 deletions MotuClDownloadCMEMSWavModel.py

This file was deleted.

14 changes: 14 additions & 0 deletions motupydownload/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM python:3.8

# install motuclient
# TODO: cleanup cache?
COPY requirements.txt .
RUN python -m pip install -r requirements.txt

# drop this later, but we might need a bash for debugging
# TODO: cleanup cache?
RUN apt update && apt install -y bash

RUN mkdir -p /opt/motupydownload/
COPY motupydownload.py /opt/motupydownload/.
ENTRYPOINT ["python", "/opt/motupydownload/motupydownload.py"]
File renamed without changes.
1 change: 1 addition & 0 deletions motupydownload/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
motuclient==1.8.6
8 changes: 5 additions & 3 deletions netcdf2zarr/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ FROM python:3.8

# install xarray, netcdf and pandas
# TODO: cleanup cache?
RUN python -m pip install xarray netcdf4 zarr dask distributed numpy
COPY requirements.txt .
RUN python -m pip install -r requirements.txt

# drop this later, but we might need a bash for debugging
# TODO: cleanup cache?
RUN apt update && apt install -y bash

COPY netcdf2zarr.py .
ENTRYPOINT python netcdf2zarr.py
RUN mkdir -p /opt/netcdf2zarr/
COPY netcdf2zarr.py /opt/netcdf2zarr/.
ENTRYPOINT ["python", "/opt/netcdf2zarr/netcdf2zarr.py"]
6 changes: 6 additions & 0 deletions netcdf2zarr/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dask
distributed
netcdf4
numpy
xarray
zarr

0 comments on commit 4e44c5e

Please sign in to comment.