Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create test-ubuntu-git Docker Container for Proxy Tests #1616

Merged
merged 6 commits into from Feb 20, 2024

Conversation

jww3
Copy link
Contributor

@jww3 jww3 commented Feb 20, 2024

The test-proxy CI check has been failing since December 19, 2023.

test-proxy depends on Docker Hub container image alpine/git:latest.

  test-proxy:
    runs-on: ubuntu-latest
    container:
      image: alpine/git:latest
      options: --dns 127.0.0.1
    services:
      squid-proxy:
        image: ubuntu/squid:latest
        ports:
          - 3128:3128

It seems a recent update to alpine/git caused this test to start failing.

This PR seeks to establish a new git-enabled Linux container image hosted in the GitHub Container Image registry (ghcr.io). A subsequent PR will update test-proxy to utilize this new image.

By establishing a container image that is defined, maintained, published, and versioned via the actions/checkout repo, we insulate actions/checkout CI from external factors that introduce breaking changes.

@jww3 jww3 requested a review from a team as a code owner February 20, 2024 13:20
Comment on lines +39 to +44
# Use `docker/metadata-action` to preserve tags and labels that exist on the GHCR.io container image.
# - name: Extract metadata (tags, labels) for Docker
# id: meta
# uses: docker/metadata-action@v5.5.1
# with:
# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not convinced this block is necessary at this point. I'd like to see what happens without it first.

@jww3 jww3 changed the title Create a Docker Container for Proxy Tests, test-ubuntu-git Create test-ubuntu-git Docker Container for Proxy Tests Feb 20, 2024
uses: docker/login-action@v3.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is ${{ github.actor }} always the actions org?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's whomever triggers the workflow, (I can devise a quick test to confirm), but I believe it'll still work as desired. All the examples use ${{ github.actor }}.

The explanation is a bit murky, but some documentation is here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github.repository_owner is another option, but I wanted to try it this way first and see if it works OK.

I figure it should help make auth-related failures in the workflow more clear. (e.g. joe triggered the workflow, but joe doesn't have the requisite permissions).

It might also be handy to see who published the image in GHCR.io in the event we need to do some forensics.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see other workflows in the actions org that also use github.actor when pushing to ghcr.io including actions/runner.

Copy link
Contributor

@fhammerl fhammerl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jww3 jww3 merged commit 473055b into main Feb 20, 2024
10 of 11 checks passed
@jww3 jww3 deleted the ubuntu-git-container branch February 20, 2024 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants