appending variable to image artefacts

22 views Asked by At

this is how i create and upload docker images for Dagster to ECR using my Github action:

# For each code location, the "build-push-action" builds the docker
      # image and a "set-build-output" command records the image tag for each code location.
      # To re-use the same docker image across multiple code locations, build the docker image once
      # and specify the same tag in multiple "set-build-output" commands. To use a different docker
      # image for each code location, use multiple "build-push-actions" with a location specific
      # tag.

      - name: Build and upload Docker image 
        if: steps.prerun.outputs.result != 'skip'
        uses: docker/build-push-action@v4
        with:
          context: .
          push: true
          tags: ${{ env.IMAGE_REGISTRY }}:${{ env.IMAGE_TAG }}-${{ github.head_ref }}-data
          cache-from: type=gha
          cache-to: type=gha,mode=max

      - name: Update build session with image tag for data
        id: ci-set-build-output-example-location
        if: steps.prerun.outputs.result != 'skip'
        uses: dagster-io/dagster-cloud-action/actions/utils/[email protected]
        with:
          command: "ci set-build-output --location-name=teal_data --image-tag=$IMAGE_TAG-${{ github.head_ref }}-data"

Every time, there's a new image, there are 3 new entries in ECR.

Entry 1:

Correct full name including the "github.head_ref" as I specifided.

ArtifactType: Image Index

Size: Eg 300 mb.

entry2:

Name: "-"

github.head_ref is not appended in the name.

Artifact type: Image

Size: 0 Mb

Entry 3:

Artifact type: Image

Size: actual size eg 300 mb.

Why is this so? Are these extra images really required?

Is it possible to append github.head_ref to the remaining image entries as well?

Is the dagster branch deployment dependent on the ImageIndex, Image or a combination of all? If I delete all the "Image" components, will it have an impact on my dagster deployment?

enter image description here

Note:

I have already checked out this: Github Action docker/build-push-action@v4 to ECR returns untagged images question but it DOES NOT answer my concerns because

a) I am not using QEMU

b) the provenance: false tag also did not help the OP.

0

There are 0 answers