Skip to content

fix(ci): use unique docker container names - #9852

Open
RerankerGuo wants to merge 1 commit into
modelscope:mainfrom
RerankerGuo:fix/unique-ci-container-name
Open

fix(ci): use unique docker container names#9852
RerankerGuo wants to merge 1 commit into
modelscope:mainfrom
RerankerGuo:fix/unique-ci-container-name

Conversation

@RerankerGuo

Copy link
Copy Markdown
Contributor

PR type

  • Bug Fix
  • New Feature
  • Document Updates
  • More Models or Datasets Support

PR information

Background

The GPU CI launcher always names its Docker container swift-ci-0 or
swift-ci-1. On a self-hosted runner, another active or stale workflow
can already own that global Docker name even after the GPU lock for the
current job is available.

This caused run 30896752033
to fail before tests started:

Conflict. The container name "/swift-ci-0" is already in use

Changes

  • Include GITHUB_RUN_ID, GITHUB_RUN_ATTEMPT, and the selected GPU
    slot in each CI container name.
  • Use local-<pid> and attempt 0 as deterministic local fallbacks.
  • Add a CPU regression test that runs the launcher with stubbed
    docker and flock commands and verifies the complete docker run
    invocation.

Verification

  • PYTHONPATH=. .venv/bin/python -m unittest tests.general.test_dockerci
  • PYTHONPATH=. .venv/bin/python tests/run.py --pattern test_dockerci.py
  • bash -n .dev_scripts/dockerci.sh
  • .venv/bin/pre-commit run --all-files
  • git diff --check

Impact

GPU selection and lock files are unchanged. Only the Docker container
name changes, preventing unrelated workflow runs from colliding in the
daemon-wide name namespace.

Experiment results

Before the fix, the stubbed launcher emitted:

--name swift-ci-0

With GITHUB_RUN_ID=12345 and GITHUB_RUN_ATTEMPT=2, it now emits:

--name swift-ci-12345-2-0

Include the GitHub workflow run, attempt, and GPU slot in self-hosted CI container names to avoid collisions across concurrent or stale runs.

Test: python -m unittest tests.general.test_dockerci
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

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.

1 participant