-
Notifications
You must be signed in to change notification settings - Fork 83
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
Running CI on PR's - Permissions #31
Comments
I think I could life with that.
I don't really like this option.
I think I'd try with that approach. I guess the containers don't need to be stored forever. I've used ttl.sh for ephemeral container images in the past. |
I tried this, but images maybe to big for this service. Having trouble pushing the images there... |
Hm, seems our image is huuge 😰 Hm, it doesn't seem like ttl.sh should have a size limit, but maybe we run into what is described in replicatedhq/ttl.sh#104 (comment) ? 🤔 Anyhow, the pushing the image fails for me:
Maybe we should only include tooling and not the whole SDK? But then, we need to download the SDK for every build. I guess it is container image download vs git lfs download... What is better/easier? 🤔 |
Yep and its all Gecko SDK gobbling up that space! yes buildx push hits that cloudflare issue straight up per that issue, however even docker cli push get stuck on retrying the gecko SDK layer and eventually fails with same 500 error you saw. Cloning the SDK is a very slow operation, takes about 6-7mins (on a github runner) just for that step when no cache is involved. So its probably better to have it there in the container, with the sdk layer mostly pulled from cache for the duration of the release cycle... Not sure if this applies though when the containers are hosted off github infrastructure, may make less of a difference? I do run quite a few more builds in my fork though! Probably the easiest thing will be to go with my original idea, create a PAT token and manually approve all PR workflows! |
#32 brings that layer down to 3.6GB, not sure if it is enough.
Yeah I guess. |
still fails to push to ttl.sh with same 500 errors |
I had another thought on this, we could probably just pass the container through as an artifact to the firmware jobs. That should bypass the size issues (and permission issues) for PR builds. |
This is completely horrible performance wise also. |
There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. |
not stale, still need to clean up patches though |
There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. |
I've taken a slightly different approach with #54 that I think should work. It will only build a container if it does not already exist under both the original repo and the the fork. This should allow you to make firmware code PRs (since they will reuse the old container) and also make PRs to edit the |
Implemented in #54. |
I took a brief look at this, and while tagging the container images with PR number is straight forward getting the correct permissions is a bit more challenging!
When running a workflow on an external PR, all write permissions are stripped from the
GITHUB_TOKEN
, thus no way to write the container image. The recommended way around this is to create a PAT withwrite:packages
permissions but this also gets pretty broad access to the repo, that could easily be abused with a malicious PR.So if to go the PAT approach probably want to enforce manual approval for all PR workflow runs (after code review).
@agners does this approach work for you?
Other options maybe:
The text was updated successfully, but these errors were encountered: