Skip to content

feat(controller): add s3:// model source via curl --aws-sigv4 (#1098)#1125

Merged
Defilan merged 1 commit into
defilantech:mainfrom
Defilan:feat/1098-s3-model-source
Jul 14, 2026
Merged

feat(controller): add s3:// model source via curl --aws-sigv4 (#1098)#1125
Defilan merged 1 commit into
defilantech:mainfrom
Defilan:feat/1098-s3-model-source

Conversation

@Defilan

@Defilan Defilan commented Jul 14, 2026

Copy link
Copy Markdown
Member

What

Adds s3:// (S3-compatible: MinIO, etc.) as a Model.spec.source, fetched by the model-downloader init container using curl --aws-sigv4. One additive slice of the #53 air-gapped epic; the existing string source is untouched (no CRD refactor).

Why

Operators in private/air-gapped networks want to stage models from internal S3-compatible storage so no public egress is required. This wires that path end-to-end with the runtime already in the init image (curlimages/curl 8.x supports SigV4), so no new image or air-gap mirror is needed.

How

  • isS3Source / parseS3Source in source.go; isHFRepoSource now rejects s3:// so an s3 URL is never misclassified as a HuggingFace repo.
  • ModelSpec.SourceSecretRef (corev1.LocalObjectReference) supplies the S3 credentials/endpoint/region via a Secret, wired as EnvFrom on the init container (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION, AWS_ENDPOINT_URL).
  • Source validation Pattern widened to allow the s3 scheme (single-backslash raw-string marker; CRDs regenerated).
  • buildModelInitCommand emits a path-style curl --aws-sigv4 aws:amz:${AWS_REGION}:s3 ... download with the same idempotency wrapper as the http branch; modelInitEnvVars adds S3_BUCKET / S3_KEY.
  • config/samples/model_s3_source.yaml: a Secret + Model example.
  • Unit tests (Ginkgo) for parse, classification, init-command construction, and env wiring.

Testing

Checklist

  • make test / envtest green
  • make manifests + make chart-crds produce no drift
  • make validate-samples passes
  • DCO sign-off
  • Fixes #1098

AI assistance

Implemented via the Foreman agentic-coding harness (declared-then-verified coder gate), then verified and rebased onto current main by the author. Band-3 disclosure per the project's AI-assisted contribution policy.

Fixes #1098

…ntech#1098)

Support s3:// (S3-compatible: MinIO, etc.) as a Model.spec.source, fetched
by the model-downloader init container using curl SigV4. Additive to the
existing string source; no CRD refactor.

- isS3Source / parseS3Source in source.go; isHFRepoSource rejects s3:// so
  an s3 URL is never misclassified as a HuggingFace repo.
- ModelSpec.SourceSecretRef (corev1.LocalObjectReference) supplies the
  S3-compatible credentials/endpoint/region via a Secret, wired as EnvFrom
  on the init container (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY,
  AWS_REGION, AWS_ENDPOINT_URL).
- Source validation Pattern widened to allow the s3 scheme.
- buildModelInitCommand emits a curl --aws-sigv4 path-style download with
  the same idempotency wrapper as the http branch; modelInitEnvVars adds
  S3_BUCKET / S3_KEY.
- config/samples/model_s3_source.yaml (Secret + Model).
- Unit tests for parse, classification, init command, and env wiring.

Full end-to-end pull requires a live S3/MinIO and is validated manually;
the parse plus command/env construction is the in-workspace-provable slice.

Fixes defilantech#1098

Signed-off-by: Christopher Maher <chris@mahercode.io>
@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.48936% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
api/v1alpha1/zz_generated.deepcopy.go 0.00% 3 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@Defilan Defilan merged commit ed35142 into defilantech:main Jul 14, 2026
23 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 14, 2026
eleboucher pushed a commit to eleboucher/homelab that referenced this pull request Jul 14, 2026
…5 ➔ 0.9.6) (#1591)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [ghcr.io/defilantech/charts/llmkube](https://github.com/defilantech/LLMKube) | patch | `0.9.5` → `0.9.6` |

---

### Release Notes

<details>
<summary>defilantech/LLMKube (ghcr.io/defilantech/charts/llmkube)</summary>

### [`v0.9.6`](https://github.com/defilantech/LLMKube/blob/HEAD/CHANGELOG.md#096-2026-07-14)

[Compare Source](defilantech/LLMKube@v0.9.5...v0.9.6)

##### Features

- **api:** add GPUQuota CRD types for multi-tenant GPU governance ([#&#8203;1101](defilantech/LLMKube#1101)) ([5dd867a](defilantech/LLMKube@5dd867a))
- **controller:** add GPUQuota status reconciler ([#&#8203;1117](defilantech/LLMKube#1117)) ([1d583e4](defilantech/LLMKube@1d583e4))
- **controller:** add GPUQuota validating webhook for InferenceService ([#&#8203;1118](defilantech/LLMKube#1118)) ([26804bd](defilantech/LLMKube@26804bd))
- **controller:** add s3:// model source via curl --aws-sigv4 ([#&#8203;1098](defilantech/LLMKube#1098)) ([#&#8203;1125](defilantech/LLMKube#1125)) ([ed35142](defilantech/LLMKube@ed35142))
- **foreman:** preserve a coder's gate-failed branch instead of discarding it ([#&#8203;1115](defilantech/LLMKube#1115)) ([bc39c77](defilantech/LLMKube@bc39c77))
- **helm:** gate InferenceService quota webhook and tenant RBAC behind multitenancy toggle ([#&#8203;1122](defilantech/LLMKube#1122)) ([26a994e](defilantech/LLMKube@26a994e))
- **quota:** add GPUQuota admission decision function ([#&#8203;1107](defilantech/LLMKube#1107)) ([4897093](defilantech/LLMKube@4897093))
- **runtime:** close out the SGLang kitchen-sink ([#&#8203;1060](defilantech/LLMKube#1060)): minor flags, accept thresholds, typed LoRA adapters, LoRAAdapter CRD ([#&#8203;1103](defilantech/LLMKube#1103)) ([8edf8bd](defilantech/LLMKube@8edf8bd))

##### Bug Fixes

- **foreman:** honor GateProfile source extensions in scope-overlap issue-ref extraction ([#&#8203;1120](defilantech/LLMKube#1120)) ([0c20431](defilantech/LLMKube@0c20431))

##### Documentation

- **samples:** add air-gapped local file-path model source example ([#&#8203;1099](defilantech/LLMKube#1099)) ([#&#8203;1124](defilantech/LLMKube#1124)) ([913ff3d](defilantech/LLMKube@913ff3d))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMDEuMSIsInVwZGF0ZWRJblZlciI6IjQzLjEwMS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL3BhdGNoIl19-->

Reviewed-on: https://git.erwanleboucher.dev/eleboucher/homelab/pulls/1591
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.

[FEATURE] Air-gapped: s3:// model source support (#53)

1 participant