Skip to content

Run Linux Python package build entirely in container#3214

Merged
ScottTodd merged 2 commits into
mainfrom
users/scotttodd/python-packages-container
Feb 4, 2026
Merged

Run Linux Python package build entirely in container#3214
ScottTodd merged 2 commits into
mainfrom
users/scotttodd/python-packages-container

Conversation

@ScottTodd
Copy link
Copy Markdown
Member

@ScottTodd ScottTodd commented Feb 3, 2026

Motivation

Progress on #1559.

The build_tools/linux_portable_build.py script is an unnecessary layer of indirection in a github actions context that makes our Windows and Linux workflows look quite different. Future work will also use either the AWS CLI (installed in the build container already) or boto3 to upload the Python packages that were built.

Technical Details

I've also included some related workflow cleanups in this PR to better align the Windows and Linux workflows.

We should also be able to simplify .github/workflows/release_portable_linux_packages.yml (on its own, or by calling this workflow) and then either delete that script or keep it relevant only in documentation like https://github.com/ROCm/TheRock/blob/main/docs/environment_setup_guide.md#reference-build-environments (there may be better options like Dev Containers that wouldn't involve a custom script)

One reason to keep the script instead of running the entire job under the container is this "prefetch" code that tries to run multiple async steps in parallel:

- name: Fetch sources
timeout-minutes: 30
run: |
# Prefetch docker container in background.
docker pull ${{ env.BUILD_IMAGE }} &

With GitHub Actions, the "Initialize containers" step does block all workflow progress until complete (this takes about 1 minute). A better solution there could be to preload the docker container on our build VM runners.

Test Plan

Submission Checklist

Changes the Linux Python package workflow to run all steps inside the
manylinux container rather than just the build step via linux_portable_build.py.
This simplifies the workflow and prepares for adding S3 upload steps that need
AWS CLI available.

Changes:
- Add container directive to run all steps in manylinux image
- Call build_python_packages.py directly instead of linux_portable_build.py
- Use requirements.txt for pip dependencies
- Remove setup-python action (container has Python)
- Move IS_PR_FROM_FORK to job-level env (both workflows)
- Minor cleanups: add step names, consistent formatting

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
These are called from ci*.yml.
Copy link
Copy Markdown
Member

@marbre marbre left a comment

Choose a reason for hiding this comment

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

Nice, thanks!

@ScottTodd ScottTodd merged commit 56f38ce into main Feb 4, 2026
90 of 93 checks passed
@ScottTodd ScottTodd deleted the users/scotttodd/python-packages-container branch February 4, 2026 22:15
@github-project-automation github-project-automation Bot moved this from TODO to Done in TheRock Triage Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants