Skip to content

Mark copied git repo as a safe directory#114

Merged
demandal25 merged 1 commit intoROCm:amd-integrationfrom
diptorupd:fix/docker-build-wheel-version
Jan 13, 2026
Merged

Mark copied git repo as a safe directory#114
demandal25 merged 1 commit intoROCm:amd-integrationfrom
diptorupd:fix/docker-build-wheel-version

Conversation

@diptorupd
Copy link
Copy Markdown
Collaborator

The rocm ci build system fetches the git repo separately and then copies it into the final docker image. Both steps use different uids that causes git to fail inside the docker image due to invalid directory ownership issues. A corollary of git failing is that our wheel versioning that depends on git describe fails and we end up with 0.0.0 as the fallback version.

The PR adds a RUN git config --global --add safe.directory /root/flashinfer step in our CI docker file to temporarily workaround the issue.

Copilot AI review requested due to automatic review settings January 13, 2026 16:40
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses git ownership issues in the ROCm CI Docker build by marking the copied repository as a safe directory. The build system fetches the git repo separately and copies it into the docker image using different UIDs, which causes git commands to fail and results in incorrect wheel versioning (falling back to 0.0.0 instead of using git describe).

Changes:

  • Added git config --global --add safe.directory command to the ROCm CI Dockerfile

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docker/Dockerfile.rocm_ci
COPY . /root/flashinfer/
RUN git config --global --add safe.directory /root/flashinfer

RUN curl -L micro.mamba.pm/install.sh | bash && \
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

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

This line downloads and executes a remote shell script from micro.mamba.pm/install.sh without any integrity verification, running it as part of the image build (likely as root) and giving it full control over the build environment and any produced artifacts. If the remote host, DNS, TLS, or network is compromised, an attacker can modify the script to execute arbitrary commands, exfiltrate secrets used in CI, or inject backdoors into the resulting wheels or other build outputs. In a production CI/CD context this represents a high-impact software supply chain risk; prefer using a mechanism that verifies the publisher's authenticity and the script integrity (for example, using a package manager with signed packages, or verifying a pinned checksum/signature for the downloaded installer) instead of executing it directly via curl | bash.

Severity: HIGH. Confidence: 9

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator

@demandal25 demandal25 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 fix!

@demandal25 demandal25 merged commit ee152a9 into ROCm:amd-integration Jan 13, 2026
7 checks passed
@diptorupd diptorupd deleted the fix/docker-build-wheel-version branch January 13, 2026 16:57
diptorupd added a commit that referenced this pull request Jan 13, 2026
Mark copied git repo as a safe directory (#114)
diptorupd added a commit to diptorupd/flashinfer that referenced this pull request Jan 28, 2026
The rocm ci build system fetches the git repo separately and then copies
it into the final docker image. Both steps use different uids that
causes git to fail inside the docker image due to invalid directory
ownership issues. A corollary of `git` failing is that our wheel
versioning that depends on `git describe` fails and we end up with
`0.0.0` as the fallback version.

The PR adds a `RUN git config --global --add safe.directory
/root/flashinfer` step in our CI docker file to temporarily workaround
the issue.
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