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

Move GitHub Action image to GitHub Packages #1472

Open
estahn opened this issue May 13, 2022 · 17 comments
Open

Move GitHub Action image to GitHub Packages #1472

estahn opened this issue May 13, 2022 · 17 comments
Labels
enhancement New feature or request nostale This issue or pull request is not stale, keep it open

Comments

@estahn
Copy link

estahn commented May 13, 2022

Is your feature request related to a problem? Please describe.

It would be great to load the image from GitHub Packages, as I assume this will be a substantially faster pulling experience.

https://github.com/megalinter/megalinter/blob/0126180f621bdb4f84b1864e6788daba8c7b1642/action.yml#L10

Describe the solution you'd like

  • Upload said image to GitHub Packages
  • Use it in action.yml
@estahn estahn added the enhancement New feature or request label May 13, 2022
@Kurt-von-Laven
Copy link
Collaborator

We would probably need to offer the image via both Docker and GitHub Packages at least for now since it seems like a pretty breaking change. I may be missing something since I have never used GitHub Packages, but If you or anyone else finds time to open a pull request, it seems like a low-effort, high-reward way to boost pull performance for GitHub users without affecting others.

@Kurt-von-Laven
Copy link
Collaborator

In the meantime, those using GitHub Actions might try the dirt simple docker-cache action I wrote to improve our MegaLinter pull times.

@estahn
Copy link
Author

estahn commented May 15, 2022

@Kurt-von-Laven
Copy link
Collaborator

Oh, maybe my assumption that we don’t already do this was wrong in that case. I do notice a few errors in the logs about some Docker images not being found, but they do claim a successful upload to the GitHub Container Registry. I am unfamiliar with all of these tools and on mobile right now, so please let me know if I am overlooking the obvious.

@nvuillam
Copy link
Member

The main docker image is uploaded to github registry, but not the flavor images yet

@nvuillam
Copy link
Member

I think this was because github registry allowed only one image name by repo but maybe that changed, i can have a look

@Kurt-von-Laven
Copy link
Collaborator

I read this blog post to say that they now allow multiple images per repo:

It's great that the <repo-name> above does not have to be a git repository name. The Container registry namespace is now separate from the git repository namespace — you can push images into container repositories with names like org/x1 and org/x2 using code from a GitHub repo named something completely different (e.g. org/something-else). In my opinion, this is a really nice change and aligns much more effectively with how teams use these registry products.

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity.
It will be closed in 14 days if no further activity occurs.
Thank you for your contributions.

If you think this issue should stay open, please remove the O: stale 🤖 label or comment on the issue.

@github-actions github-actions bot added the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Jun 15, 2022
@Kurt-von-Laven Kurt-von-Laven added nostale This issue or pull request is not stale, keep it open and removed O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity labels Jun 15, 2022
@estahn
Copy link
Author

estahn commented Jul 5, 2022

What needs to happen to move this forward? Seems like an easy win for a speed boost?

@Kurt-von-Laven
Copy link
Collaborator

MegaLinter as a whole is feature frozen for the next week or so to get v6 released.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 5, 2022

This issue has been automatically marked as stale because it has not had recent activity.
It will be closed in 14 days if no further activity occurs.
Thank you for your contributions.

If you think this issue should stay open, please remove the O: stale 🤖 label or comment on the issue.

@github-actions github-actions bot added the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Aug 5, 2022
@nvuillam nvuillam removed the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Aug 5, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2022

This issue has been automatically marked as stale because it has not had recent activity.
It will be closed in 14 days if no further activity occurs.
Thank you for your contributions.

If you think this issue should stay open, please remove the O: stale 🤖 label or comment on the issue.

@github-actions github-actions bot added the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Sep 5, 2022
@Kurt-von-Laven
Copy link
Collaborator

It sounds like this is a matter of adding a section similar to this one to deploy-RELEASE-flavors.yml then? Would it also make sense to update mega-linter-runner to support pulling from GHCR?

@Kurt-von-Laven Kurt-von-Laven removed the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Sep 5, 2022
@nvuillam
Copy link
Member

nvuillam commented Sep 5, 2022

Yes, we would need first to also store flavor images on GHCR, then update the action.yml files to target it
About MegaLinter runner, as it can be called from anywhere i prefer to let it on docker by default, but we could add an option --registry to allow to target ghrc

@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2022

This issue has been automatically marked as stale because it has not had recent activity.
It will be closed in 14 days if no further activity occurs.
Thank you for your contributions.

If you think this issue should stay open, please remove the O: stale 🤖 label or comment on the issue.

@github-actions github-actions bot added the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Oct 6, 2022
@Kurt-von-Laven Kurt-von-Laven removed the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Oct 6, 2022
@wesley-dean-flexion
Copy link
Contributor

Quick question...

Without getting too much into the backstory, we're looking at pulling from GHCR instead of DockerHub to cut down on the load time for Megalinter runs. With that in mind, when I try to pull from GHCR without authenticating first, I get a permissions error:

$ docker pull "ghcr.io/oxsecurity/megalinter-ci_light:v7.10.0"
Error response from daemon: Head "https://ghcr.io/v2/oxsecurity/megalinter-ci_light/manifests/v7.10.0": denied: denied

However, when I authenticate first (i.e., docker login ghcr.io), I can pull that image just fine.

In my past experience, that generally happens when I leave an image marked as private (i.e., I don't mark it as public).

So, question is, "is that what's happening here? if so, is that intentional?"

The workaround for us is to authenticate first before running Megalinter (e.g., https://github.com/oxsecurity/megalinter/blob/main/.github/workflows/deploy-RELEASE-flavors.yml#L85-L90 ) when running an Action.. just curious if what we're seeing is intentional or not.

@nvuillam
Copy link
Member

Thanks for reporting @wesley-dean-flexion

Hmm if the images are private, it's not on purpose :/

In the settings it's flagged as public... I have no idea why we have to be logged :/

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request nostale This issue or pull request is not stale, keep it open
Projects
None yet
Development

No branches or pull requests

4 participants