Skip to content

Commit

Permalink
update to docker files and workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gtramonte committed May 8, 2024
1 parent 7a060c6 commit 95d7ad5
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 17 deletions.
30 changes: 20 additions & 10 deletions .github/workflows/build_on_pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,58 +20,68 @@ jobs:
build
--user
- name: Build a binary wheel and a source for drivers
run: python3 -m build ./drivers
run: python3 -m build ./drivers
- name: Set Docker image tag name
run: echo "TAG=$(date +'%Y.%m.%d.%H.%M')" >> $GITHUB_ENV
- name: TAG ECHO
run: echo ${{ env.TAG }}
- name: Login to Scaleway Container Registry
uses: docker/login-action@v2
with:
username: nologin
password: ${{ secrets.DOCKER_PASSWORD }}
registry: ${{ vars.DOCKER_REGISTRY }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v2
- name: Build and push drivers
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: ./drivers
file: ./drivers/Dockerfile
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
REGISTRY=${{ vars.GEOKUBE_REGISTRY }}
tags: |
${{ vars.DOCKER_REGISTRY }}/geolake-drivers:${{ env.TAG }}
${{ vars.DOCKER_REGISTRY }}/geolake-drivers:latest
${{ vars.DOCKER_REGISTRY }}/geolake-drivers:latest
- name: Build and push datastore component
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: ./datastore
file: ./datastore/Dockerfile
push: true
build-args: |
REGISTRY=${{ vars.DOCKER_REGISTRY }}
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
${{ vars.DOCKER_REGISTRY }}/geolake-datastore:${{ env.TAG }}
${{ vars.DOCKER_REGISTRY }}/geolake-datastore:latest
${{ vars.DOCKER_REGISTRY }}/geolake-datastore:latest
- name: Build and push api component
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: ./api
file: ./api/Dockerfile
push: true
build-args: |
REGISTRY=${{ vars.DOCKER_REGISTRY }}
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
${{ vars.DOCKER_REGISTRY }}/geolake-api:${{ env.TAG }}
${{ vars.DOCKER_REGISTRY }}/geolake-api:latest
${{ vars.DOCKER_REGISTRY }}/geolake-api:latest
- name: Build and push executor component
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: ./executor
file: ./executor/Dockerfile
push: true
build-args: |
REGISTRY=${{ vars.DOCKER_REGISTRY }}
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
${{ vars.DOCKER_REGISTRY }}/geolake-executor:${{ env.TAG }}
${{ vars.DOCKER_REGISTRY }}/geolake-executor:latest
${{ vars.DOCKER_REGISTRY }}/geolake-executor:latest
6 changes: 3 additions & 3 deletions datastore/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
ARG REGISTRY=rg.fr-par.scw.cloud/geolake
ARG TAG=latest
FROM $REGISTRY/geolake-drivers:$TAG
RUN conda install -c conda-forge --yes --freeze-installed psycopg2 \
&& conda clean -afy

COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt
COPY ./datastore /app/datastore
COPY ./workflow /app/workflow
COPY ./dbmanager /app/dbmanager
Expand All @@ -13,3 +12,4 @@ COPY ./utils /app/utils
COPY ./tests /app/tests
COPY ./wait-for-it.sh /

WORKDIR /
3 changes: 2 additions & 1 deletion datastore/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
networkx
pydantic<2.0.0
pydantic<2.0.0
psycopg2-binary
6 changes: 3 additions & 3 deletions drivers/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ARG REGISTRY=rg.fr-par.scw.cloud/geokube
# ARG TAG=v0.2.6b1
ARG TAG=latest
FROM $REGISTRY/geokube:$TAG
RUN conda install -c conda-forge --yes --freeze-installed intake=0.6.6
RUN conda clean -afy

COPY dist/intake_geokube-0.1a0-py3-none-any.whl /
RUN pip install /intake_geokube-0.1a0-py3-none-any.whl
RUN rm /intake_geokube-0.1a0-py3-none-any.whl
RUN rm /intake_geokube-0.1a0-py3-none-any.whl

0 comments on commit 95d7ad5

Please sign in to comment.