-
Notifications
You must be signed in to change notification settings - Fork 44
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
Add support for the Pebble entrypoint #205
Add support for the Pebble entrypoint #205
Conversation
'pebble enter' is the OCI entrypoint for all ROCKs. This commit is therefore deprecating the use of the 'entrypoint' and 'cmd' fields in rockcraft.yaml, in favour of a new 'services' field, representing the Pebble services to be written into a new Pebble layer inside the ROCK's filesystem.
321b160
to
448551c
Compare
canonical/pebble#188 is already approved and should be getting merged any time now...I've already created a Pebble snap with that version of Pebble, so this PR can now be reviewed |
fyi: multi-arch snaps in https://snapcraft.io/pebble |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the work! I only reviewed the code in rockcraft/
so far; once we agree on the points and the tests and docs are updated I'll review them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did another pass at the code in rockcraft/, and also reviewed the tests and docs. Many thanks for all this work meu amigo ;)
Here's a question for @sergiusens and @cjdcordeiro ; when we merge this PR, everyone's rockcraft.yaml files will be broken. Do we want to pre-warn the users, via I don't know Mattermost, a few days in advance? It's not like they can do anything until the update drops, but at least they won't be caught completely by surprise. |
I'd say so. More than that, it would probably be worth creating a |
Docker Hub is fast but the Ubuntu images are updated infrequently and the registry itself has pull limits for anonymous users. This limit is annoying because currently rockcraft does not caching of base images. The caching is coming, but in the meantime switch to Amazon ECR. The registry has newer images and is only a little bit slower (from testing) than Docker Hub).
Split the walking of the layer directory into a new function, which returns the mapping from paths to arcnames. This is a step to simplify usrmerge handling, as the original function was already too crowded. No functional changes.
The situation is this: the primed payload has two distinct directories (e.g. bin/dir1 and usr/bin/dir1) that, because of the usrmerge handling, "point" to the same location (in this case, /usr/bin/dir1). We check that the two directories have the same attributes (ownership and mode) and then add a single entry to the layer (either one, they are all equivalent). All other cases (dirs with different attributes, conflicts between files) raise errors. The reason for this is that we haven't seen this come up "in the wild" yet, and it's hard to choose a behavior when we don't know the circunstances. Fixes canonical#203
Signed-off-by: Callahan Kovacs <[email protected]>
The runner is EoL. actions/runner-images#6002 Signed-off-by: Callahan Kovacs <[email protected]>
…ical#207) When rockcraft is installed or refreshed, the snap configure hook will remove outdated images and instances from LXD. Signed-off-by: Callahan Kovacs <[email protected]>
Craft-parts 1.18.4 makes the /dev rbind mount private, fixing chroot and overlayfs mounts when using lxd 5.11. Fixes canonical#195. Signed-off-by: Claudio Matsuoka <[email protected]>
Lxd was pinned down to version 5.9 to work around the overlayfs issue reported in canonical#195. With this fix, this should no longer be necessary. Signed-off-by: Claudio Matsuoka <[email protected]>
When Rockcraft creates the tar archive from the priming area, subdirs symlinks are skipped from archive. Solution is to add subdirs when they are symlinks. Fix canonical#208 --------- Co-authored-by: Tiago Nobrega <[email protected]>
…anonical#214) * deps: Add jammy version of python-apt
Craft-parts 1.19.0 requires overlays to be enabled. Signed-off-by: Claudio Matsuoka <[email protected]>
Signed-off-by: Claudio Matsuoka <[email protected]>
Co-authored-by: Tiago Nobrega <[email protected]> fix: spread tests fix: linting fix: re-add set_entrypoint to lifecycle and fix tasks fix: small refactoring and updates Update rockcraft/pebble.py Co-authored-by: Tiago Nobrega <[email protected]> Update tests/unit/test_pebble.py Co-authored-by: Tiago Nobrega <[email protected]> fix: add missing imports
30f2351
to
1c88fdc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm, added a comment about the Pydantic alias generator.
Needs canonical/pebble#188.
TODO:Once the above PRs are merged:- re-run the tests- update the Tutorials and How-to guidesIn this PR:
the
services
field is added to the Rockcraft project, with a lightweight validation according to the spec from https://github.com/canonical/pebble#layer-specificationthe OCI entrypoint is fixed to always be
pebble enter
the OCI cmd is
null
the implicit
pebble
part now also creates the$PEBBLE
path, where the Pebble layer is later be writtenentrypoint
andcmd
are kept, but marked as deprecated, printing an error message and exiting the build whenever they are usedthe Reference docs are updated
updated how-to guides and tutorial
adjusted all spread tests
Have you signed the CLA?