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

docker: switch to valkey #7515

Merged
merged 1 commit into from
Jun 5, 2024
Merged

docker: switch to valkey #7515

merged 1 commit into from
Jun 5, 2024

Conversation

emersion
Copy link
Member

Recently-ish redis has switched to another license which isn't open-source. An open-source fork named valkey has been established under the Linux Foundation umbrella:
https://www.linuxfoundation.org/press/linux-foundation-launches-open-source-valkey-community

See also this LWN article:
https://lwn.net/Articles/966631/

valkey is a drop-in replacement for redis. Switch to valkey to avoid depending on proprietary software.

(Note, I've only done some basic testing to make sure this works as expected, by playing with the UI a bit.)

@emersion emersion changed the title Switch to valkey docker: switch to valkey May 28, 2024
@emersion
Copy link
Member Author

Fixed up the commit message prefix.

@emersion
Copy link
Member Author

Hm, seems like there is some kind of permission error:

ERROR: failed to solve: failed to push ghcr.io/openrailassociation/osrd-edge/osrd-front:pr-7515-954eda7a5a979f95f3a0c8714d8b1d63980b2d00-devel: unexpected status from POST request to https://ghcr.io/v2/openrailassociation/osrd-edge/osrd-front/blobs/uploads/: 403 Forbidden

Maybe this only happens for external contributors?

@multun
Copy link
Contributor

multun commented May 29, 2024

Yup, seems like it. I'll have a look

@multun
Copy link
Contributor

multun commented May 29, 2024

The build is pretty darn long, so we're using ghcr to cache build artifacts across commits on development branches.

@emersion
Copy link
Member Author

We could probably either (1) ignore permission errors for PRs or (2) pull & push to the fork's prefix instead of the hardcoded one.

@multun
Copy link
Contributor

multun commented May 29, 2024

We can't really ignore permission errors, as further steps download the built artifacts from the build stage. So yeah either we push artifacts to the fork's registry, or use pull_request_target

@multun
Copy link
Contributor

multun commented May 29, 2024

I'll have a go at making it work for forks

@multun
Copy link
Contributor

multun commented May 29, 2024

@emersion can you rebase and try again?

@emersion
Copy link
Member Author

Thanks! 2e929c8 looks good to me :)

@multun
Copy link
Contributor

multun commented May 29, 2024

ERROR: failed to solve: failed to push ghcr.io/emersion/osrd/osrd-front:pr-7515-dc0dd3dba9f97a4f802d55886dc7c5fd279e70c8-devel: unexpected status from POST request to https://ghcr.io/v2/emersion/osrd/osrd-front/blobs/uploads/: 403 Forbidden :(

@multun
Copy link
Contributor

multun commented May 29, 2024

seems like build artifacts is the only way: https://docs.docker.com/build/ci/github-actions/share-image-jobs/
I'll have a go at it.

@emersion
Copy link
Member Author

That's weird, I can push locally with a write:packages access token:

> podman push --creds=emersion alpine:latest ghcr.io/emersion/osrd/osrd-front:pr-7515-dc0dd3dba9f97a4f802d5588
6dc7c5fd279e70c8-devel
Password: 
Getting image source signatures
Copying blob ef8b9bca8ee8 skipped: already exists  
Copying config 1d34ffeaf1 done   | 
Writing manifest to image destination

Probably GITHUB_TOKEN is generated with permissions in the base repo context?

@emersion
Copy link
Member Author

Yeah, and this circles back to your pull_request_target suggestion above.

@multun
Copy link
Contributor

multun commented May 29, 2024

Yeah, and this circles back to your pull_request_target suggestion above.

Well we can't really do that without giving up the right of anyone messing up with releases. Github's own docs describe this is a bad idea. It would be a lot easier though!

@emersion
Copy link
Member Author

Ah, of course… Got the "target" repository mixed up with the "head"/"base" when reading the docs…

@Khoyo
Copy link
Contributor

Khoyo commented May 29, 2024

I've given you write permissions on the repository, you need to accept them though

(and you should also have an org membership invite)

@emersion
Copy link
Member Author

Thanks! (It would still be super nice to fix CI for external contributors!)

@multun
Copy link
Contributor

multun commented May 29, 2024

Thanks! (It would still be super nice to fix CI for external contributors!)

Yeah leaving it broken isn't really an option, I'll keep working on it

Recently-ish redis has switched to another license which isn't
open-source. An open-source fork named valkey has been established
under the Linux Foundation umbrella:
https://www.linuxfoundation.org/press/linux-foundation-launches-open-source-valkey-community

See also this LWN article:
https://lwn.net/Articles/966631/

valkey is a drop-in replacement for redis. Switch to valkey to
avoid depending on proprietary software.
@emersion
Copy link
Member Author

emersion commented Jun 4, 2024

This should be ready now that the CI has been fixed.

@multun multun added this pull request to the merge queue Jun 5, 2024
Merged via the queue into OpenRailAssociation:dev with commit 44a5843 Jun 5, 2024
17 checks passed
@emersion emersion deleted the valkey branch June 5, 2024 09:37
@Khoyo Khoyo mentioned this pull request Oct 11, 2024
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.

3 participants