diff --git a/.github/workflows/dagger-docker.yml b/.github/workflows/dagger-docker.yml index 10de82f4..02cec617 100644 --- a/.github/workflows/dagger-docker.yml +++ b/.github/workflows/dagger-docker.yml @@ -52,33 +52,8 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - uses: docker/setup-buildx-action@v2 - - - uses: docker/build-push-action@v4 - if: github.event_name == 'workflow_dispatch' - with: - context: . - file: "Dockerfile" - build-args: | - BASE_IMAGE_TAG=${{ github.event.inputs.image_tag }} - tags: localpavics-sdi:latest - load: true - cache-from: type=gha - cache-to: type=gha,mode=max - push: false - - - uses: docker/build-push-action@v4 - if: github.event_name != 'workflow_dispatch' - with: - context: . - file: "Dockerfile" - tags: localpavics-sdi:latest - load: true - cache-from: type=gha - cache-to: type=gha,mode=max - push: false - - name: Dagger testing run: | + export BASE_IMAGE_TAG=${{ github.event.inputs.image_tag }} pip install .[dagger] python ./ci/dagger-pipeline.py diff --git a/Dockerfile b/Dockerfile index 7ca0729a..d3ac19bb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,9 @@ LABEL Description="PAVICS-SDI-TESTING-IMAGE" Vendor="Birdhouse" Version="1.3.0" USER root # Install build tools -RUN apt-get install --yes build-essential +RUN apt-get install --yes build-essential \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* # Switch to /code directory WORKDIR /code diff --git a/ci/dagger-pipeline.py b/ci/dagger-pipeline.py index bdd29d57..e3353164 100644 --- a/ci/dagger-pipeline.py +++ b/ci/dagger-pipeline.py @@ -17,14 +17,16 @@ async def main(): async with dagger.Connection(dagger.Config(log_output=sys.stderr)) as client: top_level_dir = client.host().directory(Path(__file__).parent.parent.as_posix()) - if os.getenv("CI"): - sources = ( - client.container() - # pull container - .from_("localpavics-sdi:latest").with_workdir("/code") - ) - else: - sources = await top_level_dir.docker_build() + # if os.getenv("CI"): + # sources = ( + # client.container() + # # pull container + # .from_("localpavics-sdi:latest").with_workdir("/code") + # ) + # else: + sources = await top_level_dir.docker_build( + build_args=os.getenv("BASE_IMAGE_TAG") + ) username = sources.with_exec(["whoami"]) whats_here = sources.with_exec(["ls", "-la", "/code"]) diff --git a/pyproject.toml b/pyproject.toml index dd21d4dc..f98dec3d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ authors = [ ] maintainers = [ {name = "Tuan Long Vu", email = "vu.long@ouranos.ca"}, - {name = "David Huard", email = "huard.davis@ouranos.ca"}, + {name = "David Huard", email = "huard.david@ouranos.ca"}, {name = "Trevor James Smith", email = "smith.trevorj@ouranos.ca"}, {name = "Francis Charette-Migneault", email = "francis.charette.migneault@gmail.com"} ]