Integration with SandD - #17
Open
kerthcet wants to merge 3 commits into
Open
Conversation
Signed-off-by: kerthcet <kerthcet@gmail.com>
Signed-off-by: kerthcet <kerthcet@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Suppressed comments (3)
pkg/provider/aws/translate.go:86
- When SandD is enabled, the shim ultimately runs
exec "$@", butrunArgsis built fromspec.Commandthenspec.Args. Ifspec.Commandis empty (a valid Kubernetes case where the image ENTRYPOINT should run),$@starts with the first arg fromspec.Args(or is empty), which will fail and break workloads. Consider only enabling the shim when an explicit Command is present; otherwise fall back to the normal Docker ENTRYPOINT/CMD mapping to preserve Kubernetes semantics.
var runArgs []string
if spec.Sandd.Enabled() {
runArgs = writeSanddEntrypoint(&b, spec)
} else {
// No shim: map Command/Args straight onto Docker's --entrypoint/CMD as before.
pkg/provider/provider.go:340
SanddConfig.Enabled()only checksAuthKey, but the struct doc statesControlServerandServerURLare required when AuthKey is set. As written, a partially configured SandD setup will be treated as enabled and attempt injection with empty values. Either validate elsewhere or makeEnabled()reflect the documented requirements.
// Enabled reports whether the SandD daemon should be injected. A missing AuthKey
// means the operator did not opt in, so an adapter emits its plain bootstrap.
func (s SanddConfig) Enabled() bool { return s.AuthKey != "" }
cmd/main.go:364
- SandD env configuration is read from process env, but there is no validation/logging if
SANDD_TUNNEL_AUTHKEYis set whileSANDD_TUNNEL_SERVERorSANDD_SERVER_URLare missing. With the current fail-open shim this can silently disable the access channel (or attempt to start it with empty values) while still launching workloads. Add a guard that logs the missing required vars (without logging the auth key) and disables SandD injection when incomplete.
sanddCfg := provider.SanddConfig{
AuthKey: os.Getenv("SANDD_TUNNEL_AUTHKEY"),
ControlServer: os.Getenv("SANDD_TUNNEL_SERVER"),
ServerURL: os.Getenv("SANDD_SERVER_URL"),
}
Comment on lines
+105
to
+110
| // sanddBinaryURL is the statically-linked (musl) SandD daemon release asset. Being | ||
| // static, this one binary runs in any container image regardless of its libc, so the | ||
| // shim can fetch it into an arbitrary user image at boot. It is pinned to the same | ||
| // asset name install.sh resolves; amd64 matches the x86_64 GPU instance types. | ||
| const sanddBinaryURL = "https://github.com/InftyAI/SandD/releases/latest/download/sandd-linux-amd64" | ||
|
|
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.
What this PR does / why we need it
Which issue(s) this PR fixes
Fixes #
Special notes for your reviewer
Does this PR introduce a user-facing change?