build-push-action icon indicating copy to clipboard operation
build-push-action copied to clipboard

Build summary feature doesn't work with GitHub Enterprise Server

Open ponkio-o opened this issue 1 year ago • 2 comments

Contributing guidelines

I've found a bug, and:

  • [X] The documentation does not mention anything about my problem
  • [X] There are no open or closed issues that are related to my problem

Description

Build Summary introduced in v6.0.0 doesn't work with GHES v3.11.7.

My guess is that it is because the artifact v2 library used internally does not support GHES.

@actions/artifact v2+, upload-artifact@v4+, and download-artifact@v4+ are not currently supported on GHES yet. The previous version of this package can be found at this tag and on npm.

Expected behaviour

Correctly working build summary.

Actual behaviour

The following error message on Post Build and push step.

Warning: Failed to get backend IDs: The provided JWT token is invalid and/or missing claims

Repository URL

No response

Workflow run URL

No response

YAML workflow

name: build test

on:
  pull_request:

env:
  ACTIONS_STEP_DEBUG: true

jobs:
  checkout:
    runs-on:
      group: mygroup
      labels: instance-medium
    steps:
      - name: Set up Docker Buildx
        uses: docker/[email protected]
        id: buildx
        with:
          driver: remote
          endpoint: tcp://127.0.0.1:1234
      - name: Create simple Dockerfile
        run: |
          echo -e "FROM busybox\nRUN echo foobar > /hello.txt\nRUN cat /hello.txt" > Dockerfile
      - name: Build and push
        uses: docker/[email protected]
        with:
          builder: ${{ steps.buildx.outputs.name }}
          push: false
          load: true
          context: "."
          tags: build-test
          cache-from: type=gha
          cache-to: type=gha,mode=max
      - name: Test
        run: |
          docker run --rm build-test
      - name: List docker images
        run: docker images
      - name: Test container action
        uses: actions/hello-world-docker-action@main
        with:
          who-to-greet: "Mona the Octocat"

Workflow logs

Post job cleanup.
Generating build summary
  exporting build record to /_work/test-my-ecs-43Kn2kkJfG1Eb/_temp/docker-actions-toolkit-Jl9ozK/export
  /usr/bin/mkfifo /_work/test-my-ecs-43Kn2kkJfG1Eb/_temp/docker-actions-toolkit-Jl9ozK/buildx-in-78BHfW.fifo
  /usr/bin/mkfifo /_work/test-my-ecs-43Kn2kkJfG1Eb/_temp/docker-actions-toolkit-Jl9ozK/buildx-out-ufKka9.fifo
  docker buildx --builder builder-fe924839-4148-4c33-97ad-128ab332049b dial-stdio
  docker run --rm -i -v /home/runner/.docker/buildx/refs:/buildx-refs -v /_work/test-my-ecs-43Kn2kkJfG1Eb/_temp/docker-actions-toolkit-Jl9ozK/export:/out docker.io/dockereng/export-build:latest --ref-state-dir=/buildx-refs --node=builder-fe924839-4148-4c33-97ad-128ab332049b/builder-fe924839-4148-4c33-97ad-128ab332049b0 --ref=n70x36273vnv08m7yqecabwos --uid=1000 --gid=121
  Unable to find image 'dockereng/export-build:latest' locally
  latest: Pulling from dockereng/export-build
  bb431e31f450: Pulling fs layer
  03f1761d02d6: Pulling fs layer
  03f1761d02d6: Verifying Checksum
  03f1761d02d6: Download complete
  bb431e31f450: Verifying Checksum
  bb431e31f450: Download complete
  bb431e31f450: Pull complete
  03f1761d02d6: Pull complete
  Digest: sha256:3dfedea3148487c108965dede834f22e81528fc5b2f3989e4b8ecec2f8fe10ae
  Status: Downloaded newer image for dockereng/export-build:latest
  Parsing /_work/test-my-ecs-43Kn2kkJfG1Eb/_temp/docker-actions-toolkit-Jl9ozK/export/summary.json
  Build record exported to /_work/test-my-ecs-43Kn2kkJfG1Eb/_temp/docker-actions-toolkit-Jl9ozK/export/my~actions-sandbox~N70X36.dockerbuild (17 KB)
  Warning: Failed to get backend IDs: The provided JWT token is invalid and/or missing claims
Removing temp folder /_work/test-my-ecs-43Kn2kkJfG1Eb/_temp/docker-actions-toolkit-YvYQtJ
Post cache
  State not set

BuildKit logs

No response

Additional info

GitHub Enterprise Server: v3.11.7 actions/runner: v2.317.0

ponkio-o avatar Jun 24 '24 10:06 ponkio-o

Build Summary introduced in v6.0.0 doesn't work with GHES v3.11.7.

My guess is that it is because the artifact v2 library used internally does not support GHES.

@actions/artifact v2+, upload-artifact@v4+, and download-artifact@v4+ are not currently supported on GHES yet. The previous version of this package can be found at this tag and on npm.

Yes this seems to be the issue, I will look if we can downgrade to v1.

crazy-max avatar Jun 24 '24 11:06 crazy-max

Downgrading to v1 does not look promising as we can't interact with azure blob storage API anymore, which is needed in our case to set appropriate content-disposition header when uploading the artifact: https://github.com/docker/actions-toolkit/blob/2e70a0cac6b3a7fad73b736a8fc017036b1b082f/src/github.ts#L154-L173

In the meantime we will print a better error message for GHES users: https://github.com/docker/actions-toolkit/pull/382

@dvdksn Could we add a callout in https://docs.docker.com/build/ci/github-actions/build-summary/ page saying that Build summary is not yet supported on GHES?

crazy-max avatar Jun 26 '24 12:06 crazy-max

@crazy-max Thank you for your work!! When running v6.3.0 on GHES, the message "Build summary is not yet supported on GHES" is displayed. I believe this is the intended behaviour. But I feel little noisy... CleanShot 2024-07-03 at 18 16 56

Setting "DOCKER_BUILD_SUMMARY" would help, but it is cumbersome to set it for our all workflows. Stop using Annotations and just show them in the actions log. What do you think of this?

ponkio-o avatar Jul 03 '24 09:07 ponkio-o

When running v6.3.0 on GHES, the message "Build summary is not yet supported on GHES" is displayed. I believe this is the intended behaviour. But I feel little noisy...

@ponkio-o Should be good with latest release https://github.com/docker/build-push-action/releases/tag/v6.7.0

crazy-max avatar Aug 13 '24 12:08 crazy-max

Not 100% sure - but Build Summary is working on GHES - at least I'm on 3.12.x and a simple hello world is possible.

image

Looking at the changelog, the build summary was introduced in GHES 3.6 - so it's there since 2022-07-26.

So while the last version without Build Summary (3.5) was retired on 2023-09-25, the Build Summary should be seen as general available also on GHES.

timmjd avatar Aug 20 '24 16:08 timmjd

Not 100% sure - but Build Summary is working on GHES

It's not about the build summary itself but the actions artifact lib v2 that is not supported on GHES: https://github.com/actions/toolkit/tree/main/packages/artifact#v2---whats-new

@actions/artifact v2+, upload-artifact@v4+, and download-artifact@v4+ are not currently supported on GHES yet. The previous version of this package can be found at this tag and on npm.

crazy-max avatar Aug 20 '24 16:08 crazy-max

Could we make it work if DOCKER_BUILD_RECORD_UPLOAD is disabled?

dvdksn avatar Aug 20 '24 16:08 dvdksn

This is tracked in https://github.com/github/roadmap/issues/930 (Q4 2024)

crazy-max avatar Aug 20 '24 16:08 crazy-max

Could we make it work if DOCKER_BUILD_RECORD_UPLOAD is disabled?

Yes but then only summary will be available without the .dockerbuild artifact. @colinhemmings @sharonchang1 Could this be a way to mitigate this issue in the meantime?

crazy-max avatar Aug 20 '24 16:08 crazy-max

Not 100% sure - but Build Summary is working on GHES - at least I'm on 3.12.x and a simple hello world is possible.

image

Looking at the changelog, the build summary was introduced in GHES 3.6 - so it's there since 2022-07-26.

So while the last version without Build Summary (3.5) was retired on 2023-09-25, the Build Summary should be seen as general available also on GHES.

Hi, I am having same issue with OP :( Can we have a definition of which GHES supports this feature? O: At least, I can report to my GHES admin Our GHES version is r 3.12.8 And I am using v6.7.0

akakshuki avatar Sep 26 '24 10:09 akakshuki