diff --git a/.github/workflows/build-production.yml b/.github/workflows/build-production.yml new file mode 100644 index 0000000..608c92b --- /dev/null +++ b/.github/workflows/build-production.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/build-push-docker-prod.yml b/.github/workflows/build-push-docker-prod.yml deleted file mode 100644 index 3cc1e88..0000000 --- a/.github/workflows/build-push-docker-prod.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Build Docker image of the geodds-api component and push to the production repository - -on: - push: - tags: - - 'v*' -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Get release tag - run: echo "RELEASE_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - name: Login to Docker registry - run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login ${{ secrets.DOCKER_PROD_REPO_URL }} -u nologin --password-stdin - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Build and push - uses: docker/build-push-action@v4 - with: - context: . - file: ./Dockerfile - push: true - tags: | - ${{ secrets.DOCKER_PROD_REPO_URL }}/geodds-api:${{ env.RELEASE_TAG }} - ${{ secrets.DOCKER_PROD_REPO_URL }}/geodds-api:latest diff --git a/.github/workflows/build-push-docker.yml b/.github/workflows/build-push-docker.yml deleted file mode 100644 index 6365e65..0000000 --- a/.github/workflows/build-push-docker.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Build Docker image of the geodds-api component and push to the dev repository - -on: - pull_request: - types: [opened, synchronize] - workflow_dispatch: -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - 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: ${{ secrets.DOCKER_DEV_REPO_URL }} - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Build and push - uses: docker/build-push-action@v4 - with: - context: . - file: ./Dockerfile - push: true - build-args: | - REGISTRY=${{ secrets.DOCKER_DEV_REPO_URL }} - tags: | - ${{ secrets.DOCKER_DEV_REPO_URL }}/geodds-api:${{ env.TAG }} - ${{ secrets.DOCKER_DEV_REPO_URL }}/geodds-api:latest \ No newline at end of file diff --git a/.github/workflows/build-staging.yml b/.github/workflows/build-staging.yml new file mode 100644 index 0000000..7c16ff2 --- /dev/null +++ b/.github/workflows/build-staging.yml @@ -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 \ No newline at end of file diff --git a/api/Dockerfile b/api/Dockerfile index 9ee0633..a2cfea0 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -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 diff --git a/datastore/Dockerfile b/datastore/Dockerfile index 9ca2496..018ad5e 100644 --- a/datastore/Dockerfile +++ b/datastore/Dockerfile @@ -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 diff --git a/drivers/Dockerfile b/drivers/Dockerfile index d4f9e76..4980d28 100644 --- a/drivers/Dockerfile +++ b/drivers/Dockerfile @@ -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 diff --git a/drivers/README.md b/drivers/README.md index f08349c..ed98e22 100644 --- a/drivers/README.md +++ b/drivers/README.md @@ -1,2 +1,2 @@ -# intake-geokube +# geolake-drivers GeoKube plugin for Intake \ No newline at end of file diff --git a/drivers/pyproject.toml b/drivers/pyproject.toml index ae138ac..2f0a6d5 100644 --- a/drivers/pyproject.toml +++ b/drivers/pyproject.toml @@ -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" diff --git a/executor/Dockerfile b/executor/Dockerfile index 6a946fd..db3cebb 100644 --- a/executor/Dockerfile +++ b/executor/Dockerfile @@ -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