Skip to content

fix(gcp): remove unsupported --include flags from gcloud storage rsync#799

Merged
arniechops merged 15 commits intomainfrom
arnavchopra/fix-gcs-rsync-include-flags
Apr 13, 2026
Merged

fix(gcp): remove unsupported --include flags from gcloud storage rsync#799
arniechops merged 15 commits intomainfrom
arnavchopra/fix-gcs-rsync-include-flags

Conversation

@arniechops
Copy link
Copy Markdown
Collaborator

@arniechops arniechops commented Apr 3, 2026

Summary

  • gcloud storage rsync only supports --exclude (Python regex), not --include
  • The --include flags caused model weight downloads to fail on GCP with: unrecognized arguments: --include=*.model
  • Removed --include flags and kept only --exclude="optimizer.*" since all other files in the checkpoint bucket are needed

Test plan

  • Deploy model-engine with this fix on GCP cluster
  • Create an endpoint and verify vLLM container successfully downloads weights from GCS
  • Verify optimizer files are still excluded

🤖 Generated with Claude Code

Greptile Summary

This PR fixes a runtime error on GCP where gcloud storage rsync received unsupported --include flags (unrecognized arguments: --include=*.model). The fix switches from an allowlist (--include) to a denylist (--exclude) approach using proper Python regex syntax, and preserves the trust_remote_code security guard by appending --exclude=".*\.py$" when trust_remote_code=False.

Confidence Score: 5/5

Safe to merge — fixes a real runtime crash with correct regex syntax and preserves the trust_remote_code security guard.

No P0/P1 findings. The fix directly addresses the root cause (unsupported --include flags), the trust_remote_code guard raised in prior review threads is now properly implemented via --exclude, regex patterns are syntactically correct for gcloud's Python re.search() semantics, and tests cover both trust_remote_code=True and False branches.

No files require special attention.

Important Files Changed

Filename Overview
model-engine/model_engine_server/domain/use_cases/llm_model_endpoint_use_cases.py Replaces unsupported --include flags with --exclude flags (Python regex) for gcloud storage rsync, and preserves trust_remote_code guard via --exclude=".*.py$"
model-engine/tests/unit/domain/test_llm_use_cases.py Test expectations updated to match new --exclude-only command format for both trust_remote_code=True and False cases

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[load_model_weights_sub_commands_gcs] --> B[Install gcloud CLI]
    B --> C["Start excludes list:\n--exclude=\"optimizer.*\""]
    C --> D{trust_remote_code?}
    D -- False --> E["Append --exclude=\".*\\.py$\""]
    D -- True --> F[No additional excludes]
    E --> G["gcloud storage rsync -r\n{excludes} {src} {dest}"]
    F --> G
Loading

Reviews (4): Last reviewed commit: "Merge branch 'main' into arnavchopra/fix..." | Re-trigger Greptile

Comment thread model-engine/model_engine_server/domain/use_cases/llm_model_endpoint_use_cases.py Outdated
@arniechops arniechops enabled auto-merge (squash) April 3, 2026 01:48
@arniechops arniechops disabled auto-merge April 3, 2026 01:49
@arniechops arniechops enabled auto-merge (squash) April 5, 2026 21:30
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@arniechops arniechops merged commit 5a17ba8 into main Apr 13, 2026
8 checks passed
@arniechops arniechops deleted the arnavchopra/fix-gcs-rsync-include-flags branch April 13, 2026 19:59
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