Skip to content

Commit

Permalink
Merge pull request #2 from CMCC-Foundation/feature_1
Browse files Browse the repository at this point in the history
Feature #1
  • Loading branch information
Marco Mancini authored Jan 29, 2024
2 parents 291a1e6 + a3a3e99 commit ca7d480
Show file tree
Hide file tree
Showing 10 changed files with 164 additions and 66 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/build-production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Build Docker images for geolake components and push to the repository

on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source for drivers
run: python3 -m build ./drivers
- name: Set Docker image tag name
run: echo "TAG=$(date +'%Y.%m.%d.%H.%M')" >> $GITHUB_ENV
- name: Login to Scaleway Container Registry
uses: docker/login-action@v2
with:
username: nologin
password: ${{ secrets.DOCKER_PASSWORD }}
registry: ${{ vars.DOCKER_REGISTRY }}
- name: Get release tag
run: echo "RELEASE_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push drivers
uses: docker/build-push-action@v4
with:
context: ./drivers
file: ./drivers/Dockerfile
push: true
build-args: |
REGISTRY=${{ vars.DOCKER_REGISTRY }}
tags: |
${{ vars.DOCKER_REGISTRY }}/geolake-drivers:${{ env.RELEASE_TAG }}
${{ vars.DOCKER_REGISTRY }}/geolake-drivers:latest
- name: Build and push datastore component
uses: docker/build-push-action@v4
with:
context: ./datastore
file: ./datastore/Dockerfile
push: true
build-args: |
REGISTRY=${{ vars.DOCKER_REGISTRY }}
tags: |
${{ vars.DOCKER_REGISTRY }}/geolake-datastore:${{ env.RELEASE_TAG }}
${{ vars.DOCKER_REGISTRY }}/geolake-datastore:latest
- name: Build and push api component
uses: docker/build-push-action@v4
with:
context: ./api
file: ./api/Dockerfile
push: true
build-args: |
REGISTRY=${{ vars.DOCKER_REGISTRY }}
tags: |
${{ vars.DOCKER_REGISTRY }}/geolake-api:${{ env.RELEASE_TAG }}
${{ vars.DOCKER_REGISTRY }}/geolake-api:latest
- name: Build and push executor component
uses: docker/build-push-action@v4
with:
context: ./executor
file: ./executor/Dockerfile
push: true
build-args: |
REGISTRY=${{ vars.DOCKER_REGISTRY }}
tags: |
${{ vars.DOCKER_REGISTRY }}/geolake-executor:${{ env.RELEASE_TAG }}
${{ vars.DOCKER_REGISTRY }}/geolake-executor:latest
26 changes: 0 additions & 26 deletions .github/workflows/build-push-docker-prod.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/build-push-docker.yml

This file was deleted.

77 changes: 77 additions & 0 deletions .github/workflows/build-staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Build Docker images for geolake components and push to the repository

on:
pull_request:
types: [opened, synchronize]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source for drivers
run: python3 -m build ./drivers
- name: Set Docker image tag name
run: echo "TAG=$(date +'%Y.%m.%d.%H.%M')" >> $GITHUB_ENV
- 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
- name: Build and push drivers
uses: docker/build-push-action@v4
with:
context: ./drivers
file: ./drivers/Dockerfile
push: true
build-args: |
REGISTRY=${{ vars.DOCKER_REGISTRY }}
tags: |
${{ vars.DOCKER_REGISTRY }}/geolake-drivers:${{ env.TAG }}
${{ vars.DOCKER_REGISTRY }}/geolake-drivers:latest
- name: Build and push datastore component
uses: docker/build-push-action@v4
with:
context: ./datastore
file: ./datastore/Dockerfile
push: true
build-args: |
REGISTRY=${{ vars.DOCKER_REGISTRY }}
tags: |
${{ vars.DOCKER_REGISTRY }}/geolake-datastore:${{ env.TAG }}
${{ vars.DOCKER_REGISTRY }}/geolake-datastore:latest
- name: Build and push api component
uses: docker/build-push-action@v4
with:
context: ./api
file: ./api/Dockerfile
push: true
build-args: |
REGISTRY=${{ vars.DOCKER_REGISTRY }}
tags: |
${{ vars.DOCKER_REGISTRY }}/geolake-api:${{ env.TAG }}
${{ vars.DOCKER_REGISTRY }}/geolake-api:latest
- name: Build and push executor component
uses: docker/build-push-action@v4
with:
context: ./executor
file: ./executor/Dockerfile
push: true
build-args: |
REGISTRY=${{ vars.DOCKER_REGISTRY }}
tags: |
${{ vars.DOCKER_REGISTRY }}/geolake-executor:${{ env.TAG }}
${{ vars.DOCKER_REGISTRY }}/geolake-executor:latest
2 changes: 1 addition & 1 deletion api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG REGISTRY=rg.nl-ams.scw.cloud/geodds-production
ARG TAG=latest
FROM $REGISTRY/geodds-datastore:$TAG
FROM $REGISTRY/geolake-datastore:$TAG
WORKDIR /app
COPY requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion datastore/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG REGISTRY=rg.nl-ams.scw.cloud/geokube-production
ARG TAG=latest
FROM $REGISTRY/intake-geokube:$TAG
FROM $REGISTRY/geolake-drivers:$TAG
RUN conda install -c conda-forge --yes --freeze-installed psycopg2 \
&& conda clean -afy
COPY requirements.txt /app/requirements.txt
Expand Down
6 changes: 3 additions & 3 deletions drivers/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ 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-1.0b0-py3-none-any.whl /
RUN pip install /intake_geokube-1.0b0-py3-none-any.whl
RUN rm /intake_geokube-1.0b0-py3-none-any.whl
COPY dist/geolake_drivers-1.0b0-py3-none-any.whl /
RUN pip install /geolake_drivers-1.0b0-py3-none-any.whl
RUN rm /geolake_drivers-1.0b0-py3-none-any.whl
2 changes: 1 addition & 1 deletion drivers/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# intake-geokube
# geolake-drivers
GeoKube plugin for Intake
2 changes: 1 addition & 1 deletion drivers/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "intake-geokube"
name = "geolake-drivers"
description = "opengeokube DDS driver."
requires-python = ">=3.10"
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion executor/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG REGISTRY=rg.nl-ams.scw.cloud/geodds-production
ARG TAG=latest
ARG SENTINEL_USERNAME=...
ARG SENTINEL_PASSWORD=...
FROM $REGISTRY/geodds-datastore:$TAG
FROM $REGISTRY/geolake-datastore:$TAG
WORKDIR /app
ENV SENTINEL_USERNAME=$SENTINEL_USERNAME
ENV SENTINEL_PASSWORD=$SENTINEL_PASSWORD
Expand Down

0 comments on commit ca7d480

Please sign in to comment.