From ee34f04a329e28bd4115694f8c5c4e377a1daf17 Mon Sep 17 00:00:00 2001 From: Marco Mancini Date: Fri, 26 Jan 2024 08:50:07 +0100 Subject: [PATCH 01/10] Update workflows --- ...d-push-docker.yml => build-push-docker_pr.yml} | 8 ++++---- ...ker-prod.yml => build-push-docker_release.yml} | 15 +++++++++------ 2 files changed, 13 insertions(+), 10 deletions(-) rename .github/workflows/{build-push-docker.yml => build-push-docker_pr.yml} (76%) rename .github/workflows/{build-push-docker-prod.yml => build-push-docker_release.yml} (60%) diff --git a/.github/workflows/build-push-docker.yml b/.github/workflows/build-push-docker_pr.yml similarity index 76% rename from .github/workflows/build-push-docker.yml rename to .github/workflows/build-push-docker_pr.yml index 8e4f9fd..c515c10 100644 --- a/.github/workflows/build-push-docker.yml +++ b/.github/workflows/build-push-docker_pr.yml @@ -1,4 +1,4 @@ -name: Build Docker image of the GEOKUBE component and push to the dev repository +name: Build geokube Docker image and push to geokube container registry on: pull_request: @@ -23,7 +23,7 @@ jobs: with: username: nologin password: ${{ secrets.DOCKER_PASSWORD }} - registry: ${{ secrets.DOCKER_DEV_REPO_URL }} + registry: ${{ vars.GEOKUBE_REGISTRY }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - name: Build and push @@ -33,5 +33,5 @@ jobs: file: ./Dockerfile push: true tags: | - ${{ secrets.DOCKER_DEV_REPO_URL }}/geokube:${{ env.TAG }} - ${{ secrets.DOCKER_DEV_REPO_URL }}/geokube:latest + ${{ vars.GEOKUBE_REGISTR }}/geokube:${{ env.TAG }} + ${{ secrets.GEOKUBE_REGISTR }}/geokube:latest \ No newline at end of file diff --git a/.github/workflows/build-push-docker-prod.yml b/.github/workflows/build-push-docker_release.yml similarity index 60% rename from .github/workflows/build-push-docker-prod.yml rename to .github/workflows/build-push-docker_release.yml index 138c08d..8d596fe 100644 --- a/.github/workflows/build-push-docker-prod.yml +++ b/.github/workflows/build-push-docker_release.yml @@ -1,4 +1,4 @@ -name: Build Docker image of the GEOKUBE component and push to the production repository +name: Build on release a geokube Docker image and push to the geokube container registry on: push: @@ -18,8 +18,12 @@ jobs: run: pip install wheel - name: Build WHEEL file run: python setup.py bdist_wheel - - name: Login to Docker registry - run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login ${{ secrets.DOCKER_PROD_REPO_URL }} -u nologin --password-stdin + - name: Login to Scaleway Container Registry + uses: docker/login-action@v2 + with: + username: nologin + password: ${{ secrets.DOCKER_PASSWORD }} + registry: ${{ vars.GEOKUBE_REGISTRY }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - name: Build and push @@ -28,6 +32,5 @@ jobs: context: . file: ./Dockerfile push: true - tags: | - ${{ secrets.DOCKER_PROD_REPO_URL }}/geokube:${{ env.RELEASE_TAG }} - ${{ secrets.DOCKER_PROD_REPO_URL }}/geokube:latest + tags: | + ${{ vars.GEOKUBE_REGISTR }}/geokube:${{ env.TAG }} \ No newline at end of file From faf261243e80da6a26b6345162e86597a419e302 Mon Sep 17 00:00:00 2001 From: Marco Mancini Date: Fri, 26 Jan 2024 08:55:15 +0100 Subject: [PATCH 02/10] Fix docker github workflow action --- .github/workflows/build-push-docker_release.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-push-docker_release.yml b/.github/workflows/build-push-docker_release.yml index 8d596fe..cd0ed31 100644 --- a/.github/workflows/build-push-docker_release.yml +++ b/.github/workflows/build-push-docker_release.yml @@ -25,12 +25,10 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} registry: ${{ vars.GEOKUBE_REGISTRY }} - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Build and push - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v4 with: context: . file: ./Dockerfile push: true tags: | - ${{ vars.GEOKUBE_REGISTR }}/geokube:${{ env.TAG }} \ No newline at end of file + ${{ vars.GEOKUBE_REGISTRY }}/geokube:${{ env.TAG }} \ No newline at end of file From bae131cadf3f7e5ccca15a3420243b69c37cf7c7 Mon Sep 17 00:00:00 2001 From: Marco Mancini Date: Fri, 26 Jan 2024 08:58:11 +0100 Subject: [PATCH 03/10] Update python github workflow action --- .github/workflows/build-push-docker_release.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-push-docker_release.yml b/.github/workflows/build-push-docker_release.yml index cd0ed31..d3ffe88 100644 --- a/.github/workflows/build-push-docker_release.yml +++ b/.github/workflows/build-push-docker_release.yml @@ -11,9 +11,10 @@ jobs: - uses: actions/checkout@v3 - name: Get release tag run: echo "RELEASE_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - uses: actions/setup-python@v1 + - name: Set up Python + uses: actions/setup-python@v4 with: - python-version: 3.11 + python-version: "3.11" - name: Install WHEEL tool run: pip install wheel - name: Build WHEEL file From fa3ce3f8fb6586c3f7963a4dc258a72937194614 Mon Sep 17 00:00:00 2001 From: Marco Mancini Date: Fri, 26 Jan 2024 09:02:19 +0100 Subject: [PATCH 04/10] Update secret name in github workflow --- .github/workflows/build-push-docker_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-push-docker_release.yml b/.github/workflows/build-push-docker_release.yml index d3ffe88..e7f73e4 100644 --- a/.github/workflows/build-push-docker_release.yml +++ b/.github/workflows/build-push-docker_release.yml @@ -23,7 +23,7 @@ jobs: uses: docker/login-action@v2 with: username: nologin - password: ${{ secrets.DOCKER_PASSWORD }} + password: ${{ secrets.SCALEWAY_PASSWORD }} registry: ${{ vars.GEOKUBE_REGISTRY }} - name: Set up Docker Buildx uses: docker/build-push-action@v4 From 37d4b75ade11958f4b79a97aaf5eb5d857325ca2 Mon Sep 17 00:00:00 2001 From: Marco Mancini Date: Fri, 26 Jan 2024 10:57:27 +0100 Subject: [PATCH 05/10] Update secret name for workflow --- .github/workflows/build-push-docker_pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-push-docker_pr.yml b/.github/workflows/build-push-docker_pr.yml index c515c10..5a1acb1 100644 --- a/.github/workflows/build-push-docker_pr.yml +++ b/.github/workflows/build-push-docker_pr.yml @@ -22,7 +22,7 @@ jobs: uses: docker/login-action@v2 with: username: nologin - password: ${{ secrets.DOCKER_PASSWORD }} + password: ${{ secrets.SCALEWAY_PASSWORD }} registry: ${{ vars.GEOKUBE_REGISTRY }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 From 7fcda4c86a7f1e5cc0c43711b9950107de7c46b4 Mon Sep 17 00:00:00 2001 From: Marco Mancini Date: Fri, 26 Jan 2024 10:58:26 +0100 Subject: [PATCH 06/10] Fix registry var name --- .github/workflows/build-push-docker_pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-push-docker_pr.yml b/.github/workflows/build-push-docker_pr.yml index 5a1acb1..76cd7ef 100644 --- a/.github/workflows/build-push-docker_pr.yml +++ b/.github/workflows/build-push-docker_pr.yml @@ -33,5 +33,5 @@ jobs: file: ./Dockerfile push: true tags: | - ${{ vars.GEOKUBE_REGISTR }}/geokube:${{ env.TAG }} - ${{ secrets.GEOKUBE_REGISTR }}/geokube:latest \ No newline at end of file + ${{ vars.GEOKUBE_REGISTRY }}/geokube:${{ env.TAG }} + ${{ secrets.GEOKUBE_REGISTRY }}/geokube:latest \ No newline at end of file From 9793113895694c873fc7b52b0ce46c08dac03bfb Mon Sep 17 00:00:00 2001 From: Marco Mancini Date: Fri, 26 Jan 2024 11:00:26 +0100 Subject: [PATCH 07/10] Fix registry var name --- .github/workflows/build-push-docker_pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-push-docker_pr.yml b/.github/workflows/build-push-docker_pr.yml index 76cd7ef..45e8fd9 100644 --- a/.github/workflows/build-push-docker_pr.yml +++ b/.github/workflows/build-push-docker_pr.yml @@ -34,4 +34,4 @@ jobs: push: true tags: | ${{ vars.GEOKUBE_REGISTRY }}/geokube:${{ env.TAG }} - ${{ secrets.GEOKUBE_REGISTRY }}/geokube:latest \ No newline at end of file + ${{ vars.GEOKUBE_REGISTRY }}/geokube:latest \ No newline at end of file From 22c0c3d1fe394494ad4577d06c38d85863a9d739 Mon Sep 17 00:00:00 2001 From: Marco Mancini Date: Fri, 26 Jan 2024 12:07:54 +0100 Subject: [PATCH 08/10] Add pypi publishing workflows --- .github/workflows/pypi_publish.yml | 30 ++++++++++++++++++ .github/workflows/testpypi_publish.yml | 44 ++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 .github/workflows/pypi_publish.yml create mode 100644 .github/workflows/testpypi_publish.yml diff --git a/.github/workflows/pypi_publish.yml b/.github/workflows/pypi_publish.yml new file mode 100644 index 0000000..c390653 --- /dev/null +++ b/.github/workflows/pypi_publish.yml @@ -0,0 +1,30 @@ +name: Publish Kit4DL package to PyPI + +on: + release: + types: [published] + workflow_dispatch: + +jobs: + build-and-publish: + name: Build Kit4DL and publish to PyPI + strategy: + matrix: + python-version: ["3.10"] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + environment: release + permissions: + id-token: write + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install build tool + run: python3 -m pip install build --user + - name: Build wheels + run: python -m build --sdist --wheel --outdir=dist/ . + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file diff --git a/.github/workflows/testpypi_publish.yml b/.github/workflows/testpypi_publish.yml new file mode 100644 index 0000000..422363c --- /dev/null +++ b/.github/workflows/testpypi_publish.yml @@ -0,0 +1,44 @@ +name: Publish geokube package to TestPyPI + +on: + release: + types: [prereleased] + workflow_dispatch: + +jobs: + build-and-publish: + name: Build geokube and publish to TestPyPI + strategy: + matrix: + python-version: ["3.10"] + os: [ubuntu-latest] +# environment: +# name: testpypi +# url: https://test.pypi.org/p/geokube + permissions: + id-token: write + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install build tool + run: python3 -m pip install build --user + - name: Build wheels + run: python -m build --sdist --wheel --outdir=dist/ . + - name: Publish package distributions to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + pypi-publish: + name: Upload release to PyPI + runs-on: ubuntu-latest + environment: + name: testpypi + url: https://test.pypi.org/p/geokube + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + steps: + # retrieve your distributions here \ No newline at end of file From 797138cb32ede1cae8f82a2684ba5967629f4d12 Mon Sep 17 00:00:00 2001 From: Marco Mancini Date: Fri, 26 Jan 2024 12:31:25 +0100 Subject: [PATCH 09/10] Update version to 0.2.7 and fixed python version to 3.9 --- .github/workflows/build-push-docker_pr.yml | 2 +- .github/workflows/build-push-docker_release.yml | 2 +- .github/workflows/pypi_publish.yml | 2 +- .github/workflows/testpypi_publish.yml | 14 ++------------ Dockerfile | 6 +++--- geokube/version.py | 2 +- 6 files changed, 9 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build-push-docker_pr.yml b/.github/workflows/build-push-docker_pr.yml index 45e8fd9..b28b939 100644 --- a/.github/workflows/build-push-docker_pr.yml +++ b/.github/workflows/build-push-docker_pr.yml @@ -13,7 +13,7 @@ jobs: run: echo "TAG=$(date +'%Y.%m.%d.%H.%M')" >> $GITHUB_ENV - uses: actions/setup-python@v1 with: - python-version: 3.11 + python-version: 3.9 - name: Install WHEEL tool run: pip install wheel - name: Build WHEEL file diff --git a/.github/workflows/build-push-docker_release.yml b/.github/workflows/build-push-docker_release.yml index e7f73e4..55431e5 100644 --- a/.github/workflows/build-push-docker_release.yml +++ b/.github/workflows/build-push-docker_release.yml @@ -14,7 +14,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: "3.11" + python-version: "3.9" - name: Install WHEEL tool run: pip install wheel - name: Build WHEEL file diff --git a/.github/workflows/pypi_publish.yml b/.github/workflows/pypi_publish.yml index c390653..e85051d 100644 --- a/.github/workflows/pypi_publish.yml +++ b/.github/workflows/pypi_publish.yml @@ -10,7 +10,7 @@ jobs: name: Build Kit4DL and publish to PyPI strategy: matrix: - python-version: ["3.10"] + python-version: ["3.9"] os: [ubuntu-latest] runs-on: ${{ matrix.os }} environment: release diff --git a/.github/workflows/testpypi_publish.yml b/.github/workflows/testpypi_publish.yml index 422363c..6979cac 100644 --- a/.github/workflows/testpypi_publish.yml +++ b/.github/workflows/testpypi_publish.yml @@ -10,7 +10,7 @@ jobs: name: Build geokube and publish to TestPyPI strategy: matrix: - python-version: ["3.10"] + python-version: ["3.9"] os: [ubuntu-latest] # environment: # name: testpypi @@ -31,14 +31,4 @@ jobs: - name: Publish package distributions to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 with: - repository-url: https://test.pypi.org/legacy/ - pypi-publish: - name: Upload release to PyPI - runs-on: ubuntu-latest - environment: - name: testpypi - url: https://test.pypi.org/p/geokube - permissions: - id-token: write # IMPORTANT: this permission is mandatory for trusted publishing - steps: - # retrieve your distributions here \ No newline at end of file + repository-url: https://test.pypi.org/legacy/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 86913e9..4ab8b02 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ RUN conda clean -afy \ && find /opt/conda/ -follow -type f -name '*.pyc' -delete \ && find /opt/conda/ -follow -type f -name '*.js.map' -delete \ && find /opt/conda/lib/python*/site-packages/bokeh/server/static -follow -type f -name '*.js' ! -name '*.min.js' -delete -COPY dist/geokube-0.2a0-py3-none-any.whl / +COPY dist/geokube-0.2.7-py3-none-any.whl / RUN pip install /geokube-0.2a0-py3-none-any.whl -RUN rm /geokube-0.2a0-py3-none-any.whl -ENV LD_LIBRARY_PATH=/opt/conda/x86_64-conda-linux-gnu/lib:/usr/lib/x86_64-linux-gnu +RUN rm /geokube-0.2.7-py3-none-any.whl +ENV LD_LIBRARY_PATH=/opt/conda/x86_64-conda-linux-gnu/lib:/usr/lib/x86_64-linux-gnu \ No newline at end of file diff --git a/geokube/version.py b/geokube/version.py index 03a5849..8d83856 100644 --- a/geokube/version.py +++ b/geokube/version.py @@ -1 +1 @@ -__version__ = "0.2a0" +__version__ = "0.2.7" \ No newline at end of file From fb12302857c5aff003529b94794df45f8566b6da Mon Sep 17 00:00:00 2001 From: Marco Mancini Date: Sun, 28 Jan 2024 16:02:32 +0100 Subject: [PATCH 10/10] Update version and url repo --- geokube/version.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/geokube/version.py b/geokube/version.py index 8d83856..49f34f4 100644 --- a/geokube/version.py +++ b/geokube/version.py @@ -1 +1 @@ -__version__ = "0.2.7" \ No newline at end of file +__version__ = "0.2.0" \ No newline at end of file diff --git a/setup.py b/setup.py index 320668c..9c61ecc 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ description="Python package for Earth Science Data Analysis", long_description=long_description, long_description_content_type="text/markdown", - url="https://github.com/geokube/geokube", + url="https://github.com/CMCC-Foundation/geokube", packages=setuptools.find_packages(), install_requires=[ "pytest-cov",