Skip to content

Conversation

@shs96c
Copy link
Contributor

@shs96c shs96c commented Dec 6, 2024

We have observed that making this change makes builds more likely to run successfully on an RBE.

Copy link
Collaborator

@aignas aignas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. Please also include a line in the CHANGELOG.md to inform users about the change in behaviour. It LGTM other than the tag handling.

# Replace the os.replace function with shutil.move to work around os.replace not being able to
# replace or move files across filesystems.
os.replace = shutil.copy
os.replace = shutil.move
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, I am looking at the PR that made the change previously (#1053) and I can't see why one wouldn't want the shutil.move. I also can't see looking at the source of shutil.move if it would be problematic, it will also try to fallback to shutil.copy2, so I think the shutil.move is a robust solution here.


load("//python:defs.bzl", _py_binary = "py_binary", _py_test = "py_test")

_DEFAULT_TAGS = ["no-sandbox", "no-remote-exec", "requires-network"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if we want to drop the requires-network tag if someone specifies their own tags, e.g. manual. That said, I think I see the intention - allow one to drop the no-sandbox and no-remote-exec tags.

Please consider how to implement this differently.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit curious, too, why one would want to drop these tags. Doesn't pip_compile more-or-less assume it's being run using bazel run (i.e its local, does network stuff, and intends to update local files) ?

@shs96c are you, perhaps using bazel build to create requirements using e.g. RBE? (I like that idea)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hah, totally forgot what the title says: ... when running on RBE

Looking at pip_compile, I'm not even sure how you got that working. I don't see anything that runs the tool as an action.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have some other wrappers around this that we use, but the core thing we do is to call pip_compile

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure of a nicer way of handling the tags, but I've added a remoteable parameter, and will append tag values based on that. If you'd like this handled in some other way, just LMK and I'll make the change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aignas, if you've any advice on how to handle tags in the way you'd like, please let me know!

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