From 2f3e2cc62cc4b4eaf42af0863a6aa16abec82205 Mon Sep 17 00:00:00 2001 From: Emma Ai Date: Tue, 28 Nov 2023 03:51:08 +0000 Subject: [PATCH] update docker build relevant --- .github/workflows/statistician-image.yml | 11 +++++++---- docker/requirements.txt | 6 +++--- odc/stats/plugins/gm.py | 3 +++ tests/requirements.txt | 6 +++--- tests/test_gm_ls.py | 2 +- 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/workflows/statistician-image.yml b/.github/workflows/statistician-image.yml index a9ce8d37..3794abfa 100644 --- a/.github/workflows/statistician-image.yml +++ b/.github/workflows/statistician-image.yml @@ -24,6 +24,7 @@ on: permissions: id-token: write # This is required for requesting the JWT contents: read # This is required for actions/checkout + packages: write # This is required for pushing to ghcr jobs: test: @@ -97,16 +98,18 @@ jobs: && (needs.set_tags.outputs.image_tag) needs: [test, set_tags] runs-on: ubuntu-latest + steps: - name: Checkout code uses: actions/checkout@v3 - - name: Push image to dockerhub + - name: Push image to ghcr uses: whoan/docker-build-with-cache-action@master with: context: ./docker - username: gadockersvc - password: ${{ secrets.GADOCKERSVC_PASSWORD }} - image_name: ${{ env.IMAGE_NAME }} + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + image_name: ${{ github.repository }} image_tag: latest,${{ needs.set_tags.outputs.image_tag }} build_extra_args: '{"--build-arg": "UPDATE_VERSION=${{ needs.set_tags.outputs.image_tag }}"}' diff --git a/docker/requirements.txt b/docker/requirements.txt index fd0d8c23..9eeb6aa7 100644 --- a/docker/requirements.txt +++ b/docker/requirements.txt @@ -1,14 +1,14 @@ --extra-index-url https://packages.dea.ga.gov.au/ -datacube[performance,s3]>=1.8.11 +datacube[performance,s3]>=1.8.17 hdstats==0.1.8.post1 -odc-algo @ git+https://github.com/opendatacube/odc-algo@b8dcfce +odc-algo @ git+https://github.com/opendatacube/odc-algo@851e782 odc-apps-cloud==0.2.2 # For testing odc-apps-dc-tools==0.2.12 odc-cloud==0.2.3 odc-dscache==0.2.2 -odc-stac==0.3.6 +odc-stac==0.3.8 # odc-stac is in PyPI odc-stats[ows] diff --git a/odc/stats/plugins/gm.py b/odc/stats/plugins/gm.py index fd6c0135..30981a67 100644 --- a/odc/stats/plugins/gm.py +++ b/odc/stats/plugins/gm.py @@ -29,6 +29,7 @@ def __init__( ] = None, basis_band=None, aux_names: Dict[str, str] = None, + resampling: str = "nearest", work_chunks: Tuple[int, int] = (400, 400), **kwargs, ): @@ -43,6 +44,7 @@ def __init__( if nodata_classes is not None: nodata_classes = tuple(nodata_classes) self._nodata_classes = nodata_classes + self.resampling = resampling input_bands = self.bands if self._nodata_classes is not None: # NOTE: this ends up loading Mask band twice, once to compute @@ -52,6 +54,7 @@ def __init__( super().__init__( input_bands=input_bands, basis=basis_band or self.bands[0], + resampling=self.resampling, **kwargs, ) diff --git a/tests/requirements.txt b/tests/requirements.txt index cd91f36f..4463741d 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,5 +1,5 @@ --extra-index-url https://packages.dea.ga.gov.au/ -datacube>=1.8.17 +datacube!=1.8.14 # for pytest-depends deepdiff future_fstrings @@ -7,7 +7,7 @@ mock moto networkx numpy -odc-algo +odc-algo==0.2.4.dev3628 odc-stac # For tests @@ -17,4 +17,4 @@ pytest-httpserver pytest-timeout # patch image -xarray>=2023.7.0 +xarray>=2023.1.0 diff --git a/tests/test_gm_ls.py b/tests/test_gm_ls.py index 4b65c3b7..0f1dfe43 100644 --- a/tests/test_gm_ls.py +++ b/tests/test_gm_ls.py @@ -177,7 +177,7 @@ def test_resampling(dataset): dataset = dataset.copy() stats_gmls = StatsGMLS(cloud_filters=mask_filters, nodata_classes=(-999,)) - assert stats_gmls.resampling == "bilinear" + assert stats_gmls.resampling == "nearest" def test_no_data_value(monkeypatch):