Skip to content

[Buildbot] Add script for setting up environment for debug/reproduction - #2278

Merged
Kewen12 merged 3 commits into
aomp-devfrom
add-dev-script
Aug 4, 2026
Merged

[Buildbot] Add script for setting up environment for debug/reproduction#2278
Kewen12 merged 3 commits into
aomp-devfrom
add-dev-script

Conversation

@Kewen12

@Kewen12 Kewen12 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

This PR provides a script to help developers quickly set up a local environment for debugging or reproducing issues surfaced by our upstream buildbots. Updated readme for detailed instructions.

This script:

  • Pulls the Rock manylinux Dockerfile and the necessary files for building the base image;
  • Builds the same images that our buildbot run, based on the base image;
  • Creates and run the container;
  • Clean up the container and images;
  • Supports flexible use cases.

Tested locally.

@jplehr jplehr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for putting this together!

I think it would be great if a user could point to a local LLVM tree and then have that mounted into the container as a volume mount. This reduces the need for re-cloning.

The other question that I had: Do these docker commands that the script uses require a certain docker version to be available?

@Kewen12

Kewen12 commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for putting this together!

I think it would be great if a user could point to a local LLVM tree and then have that mounted into the container as a volume mount. This reduces the need for re-cloning.

Good idea! I added a new flag --llvm-src to support the mounting.

The other question that I had: Do these docker commands that the script uses require a certain docker version to be available?

The docker cmds and options are fundamental which should be available for the versions widely used. So I think we don't have to enforce the version here.

Comment thread upstream-buildbots/README.md
Comment thread upstream-buildbots/README.md
Comment thread upstream-buildbots/README.md Outdated
Comment thread upstream-buildbots/run.py Outdated
Comment thread upstream-buildbots/run.py Outdated
Comment thread upstream-buildbots/run.py Outdated
Comment thread upstream-buildbots/run.py Outdated
Comment thread upstream-buildbots/run.py
name = container_name(args, args.target)

log(f"Removing container {name}")
run_cmd(["docker", "rm", "-f", name], check=False)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should we check if the docker exists first?
This fails when the container is still running, right?

Comment thread upstream-buildbots/run.py Outdated
@Kewen12

Kewen12 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

The revision has the following changes to address comment feedback:

  • Added --rebuild-base to force rebuilding base image;
  • Added logic to generate unique container name by default;
  • Updated README for UID/GID: no UID/GID remapping, bind mount preserves host ownership;
  • Added --clean-all option to clean container and image;
  • Renamed functions and variables;
  • Removed comments.

@jplehr jplehr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LG overall just one comment.

Comment thread upstream-buildbots/run.py
return args.name or f"test-{target}"
def generated_container_name(target):
for _ in range(10):
name = f"test-{target}-{random.randint(0, 99999):05d}"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Instead of randint does it make sense to use linux time stamp?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, I actually thought about it. For a 5-digits id using milliseconds, it means the id will repeat every 100 seconds. Comparing to timestamps, the random number is less likely to collide. I will go ahead to land this PR and file a separate PR for the changes if we prefer time stamp.

@Kewen12
Kewen12 merged commit 6e031bb into aomp-dev Aug 4, 2026
1 check passed
@Kewen12
Kewen12 deleted the add-dev-script branch August 4, 2026 23:03
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.

2 participants