Keep .git in the LS_mmseg build context - #27
Open
OleksiiPushkaryk wants to merge 1 commit into
Open
OleksiiPushkaryk wants to merge 1 commit into
OleksiiPushkaryk wants to merge 1 commit into
Conversation
`.dockerignore` excluded `.git`, so `COPY . /mmsegmentation` produced an image with the code but without a git repository. The Label Studio runner switches the training branch inside the already-built container — with WORKDIR /mmsegmentation it runs `git branch --set-upstream-to=origin/main main && git pull && git checkout <branch>` right before `python3 -m auto_training.train` — so every training that requested a branch died with "fatal: not a git repository" before training even started. Trainings without a branch kept working (the prelude degrades to a bare `echo`), which is why this stayed unnoticed since 3645531 (2026-03-24). Drone clones with `git init` + `git remote add` + `git fetch --depth=1`, which leaves a local `main` branch and, opportunistically, `refs/remotes/origin/main`. That is enough for the runner's prelude: `git pull` then populates the remaining branch refs through the remote's wildcard refspec. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
.dockerignoreexcluded.git, soCOPY . /mmsegmentationproduced an image with the code but without a git repository. The Label Studio runner switches the training branch inside the already-built container — with WORKDIR /mmsegmentation it runsgit branch --set-upstream-to=origin/main main && git pull && git checkout <branch>right beforepython3 -m auto_training.train— so every training that requested a branch died with "fatal: not a git repository" before training even started. Trainings without a branch kept working (the prelude degrades to a bareecho), which is why this stayed unnoticed since 3645531 (2026-03-24).Drone clones with
git init+git remote add+git fetch --depth=1, which leaves a localmainbranch and, opportunistically,refs/remotes/origin/main. That is enough for the runner's prelude:git pullthen populates the remaining branch refs through the remote's wildcard refspec.Basic Info
Description of contribution
Reason for change:
Changes in this PR: