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

Python Toolchain Included in .delete Target #710

Open
dfinninger opened this issue Aug 25, 2022 · 0 comments
Open

Python Toolchain Included in .delete Target #710

dfinninger opened this issue Aug 25, 2022 · 0 comments

Comments

@dfinninger
Copy link
Contributor

It seems that the inclusion of reverser.py in the .delete target pulls in the entire Python toolchain into runfiles.

rules_k8s/k8s/object.bzl

Lines 420 to 425 in 8b96841

"reverser": attr.label(
default = Label("//k8s:reverser"),
cfg = "target",
executable = True,
allow_files = True,
),

This causes the .delete target to be much larger than other targets by default.

❯ cat bazel-bin/my-container/k8s_my_container.apply.runfiles/MANIFEST | wc -l
      22

❯ cat bazel-bin/my-container/k8s_my_container.delete.runfiles/MANIFEST | wc -l
    4290

We build 1800 k8s_objects during CI, so this expands to about 8 million runfiles, which causes disk contention populating the runfiles dir on clean builds, which leads to long build times and inode exhaustion issues on some of our (admittedly aging) build infrastructure. This doesn't seem to be an issue with the Go-based resolver included in the other targets, which only adds one target (the built resolver binary).

I can see two ways around this, either by introducing a selector (likely here) that lets us choose which targets we want to generate (resolve, apply, diff, etc) or porting the reverser to Go so that it models the resolver.

I have the time to implement either solution, just looking for some feedback before opening a PR.

dfinninger added a commit to dfinninger/rules_k8s that referenced this issue Sep 6, 2022
dfinninger added a commit to dfinninger/rules_k8s that referenced this issue Sep 6, 2022
Remove the delete target while waiting for bazelbuild#710
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

1 participant