Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Drop dependency on rules_docker #723

Open
alexeagle opened this issue Apr 5, 2023 · 2 comments
Open

Drop dependency on rules_docker #723

alexeagle opened this issue Apr 5, 2023 · 2 comments

Comments

@alexeagle
Copy link

alexeagle commented Apr 5, 2023

Because it is in "minimal maintenance mode"
https://github.com/bazelbuild/rules_docker#status
and also I think it's a layering violation, it shouldn't matter to rules_k8s how the images were constructed. At most, it might want to load some Provider symbols from rules_docker just to have a deeper understanding of the inputs it receives.

Related to #722

alexeagle added a commit to alexeagle/rules_k8s that referenced this issue Apr 5, 2023
Note: I think it might be better to introduce a dep on aspect_bazel_lib instead, which is a very-well maintained utility library
that's a superset of bazel_skylib, and evidently rules_docker wished for such a thing as well since it had this folder.

Baby steps towards bazelbuild#723
I'd like to start small and gauge interest from rules_k8s maintainers before spending too much time here.
@mrmeku
Copy link

mrmeku commented Apr 7, 2023

This is the only tricky bit of dropping rules_docker entirely

image = _get_layers(ctx, ctx.label.name, image_target_dict[target])

Other than that, rules_docker can be easily replaced by rules_oci for packaging or by inlining helper functions which are currently imported from rules_docker which @alexeagle has already mostly taken care of with a PR.

Translating the above into something that's compatible with rules_oci will be a bit different since oci_image produces a directory artifact as its only output where as rules_docker seems to have shipped with a provider which made it easier to consume in the bazel layer.

However, that artifact will always follow the OCI image-spec
https://github.com/opencontainers/image-spec/blob/main/image-layout.md

It seems practical to teach rules_k8s resolver how to consume directory artifacts that fit that layout rather than consuming that layout in the bazel layer. Following that, the above line would translate into pointing the resolver to one or more image directories and leaving it to the go program to understand how to interpret different possible directory structures (starting with OCI image layouts to start and adding more as needed to the resolver)

mrmeku pushed a commit to mrmeku/rules_k8s that referenced this issue Apr 7, 2023
@realtimetodie
Copy link

I would take care of this, but I think that the PR would never be reviewed. Unfortunately, this repository appears to be unmaintained.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants