-
Notifications
You must be signed in to change notification settings - Fork 125
cli: hint when install-runner options are ignored #938
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
YasharthPanwar-2003
wants to merge
1
commit into
docker:main
Choose a base branch
from
YasharthPanwar-2003:fix-install-runner-existing-options
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+177
−7
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -245,6 +245,39 @@ type runnerOptions struct { | |||||||||||||||||||||||||
| tlsKey string | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| func commandFlagChanged(cmd *cobra.Command, name string) bool { | ||||||||||||||||||||||||||
| if cmd == nil { | ||||||||||||||||||||||||||
| return false | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
| flag := cmd.Flags().Lookup(name) | ||||||||||||||||||||||||||
| return flag != nil && flag.Changed | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| func existingRunnerOptionsHint(cmd *cobra.Command, opts runnerOptions) string { | ||||||||||||||||||||||||||
| backendChanged := commandFlagChanged(cmd, "backend") | ||||||||||||||||||||||||||
| gpuChanged := commandFlagChanged(cmd, "gpu") | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| if !backendChanged && !gpuChanged { | ||||||||||||||||||||||||||
| return "" | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| reinstallArgs := []string{"docker", "model", "reinstall-runner"} | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| if backendChanged && opts.backend != "" { | ||||||||||||||||||||||||||
| reinstallArgs = append(reinstallArgs, "--backend", fmt.Sprintf("%q", opts.backend)) | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
| if gpuChanged && opts.gpuMode != "" { | ||||||||||||||||||||||||||
| reinstallArgs = append(reinstallArgs, "--gpu", fmt.Sprintf("%q", opts.gpuMode)) | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
Comment on lines
+266
to
+271
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical
Following the Security principle (Repository Style Guide, line 12), input must be handled safely when crossing boundaries, including when displayed back to the user as a suggested command.
Suggested change
|
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| return fmt.Sprintf( | ||||||||||||||||||||||||||
| "\nThe requested runner options were not applied because the Model Runner container is already running.\n"+ | ||||||||||||||||||||||||||
| "To recreate the runner with the requested options, run:\n\n"+ | ||||||||||||||||||||||||||
| " %s\n", | ||||||||||||||||||||||||||
| strings.Join(reinstallArgs, " "), | ||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| // runInstallOrStart is shared logic for install-runner and start-runner commands | ||||||||||||||||||||||||||
| func runInstallOrStart(cmd *cobra.Command, opts runnerOptions, debug bool) error { | ||||||||||||||||||||||||||
| // On macOS ARM64, the vllm backend requires deferred installation | ||||||||||||||||||||||||||
|
|
@@ -343,6 +376,9 @@ func runInstallOrStart(cmd *cobra.Command, opts runnerOptions, debug bool) error | |||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||
| cmd.Printf("Model Runner container %s is already running\n", ctrID[:12]) | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| cmd.Print(existingRunnerOptionsHint(cmd, opts)) | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| return nil | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason why you change this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. The reason was the failing
Validate model-cli / preparecheck.So , previously before new commit , it showed as gvien below . further , I understood to do changes in CI as per asked by ericcurtin
The failure log showed:
actions/github-script@v8 is not allowed in docker/model-runner because all actions must be pinned to a full-length commit SHAThat check comes from this workflow (
Validate model-cli) and specifically thepreparejob. The directdocker/bake-action/subaction/matrixreference is pinned, but the subaction path was still causing GitHub to resolveactions/github-script@v8, which is blocked by the repo/org full-SHA action policy.GitHub documents that repositories/organizations can require actions to be pinned to a full-length commit SHA:
https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository
Since
cmd/cli/docker-bake.hclcurrently has only two validation targets under thevalidategroup (validate-docsandvalidate-tests), I replaced the dynamic matrix generation with an explicit matrix output while keeping the existingprepareandvalidatejob structure.If you prefer to keep the bake matrix subaction and handle this CI policy another way, I can revert the workflow change and keep this PR scoped to the install-runner behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should not do this change in the CI. I think what @ericcurtin mentioned was to fix reason if any changes done from this PR breaks the CI.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking same ealier . Thanks for feedback , I will undo it and keep the relevant ones .
Updated based on the review feedback.
I reverted the CI workflow change and kept this PR scoped to the install-runner behavior only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All these changes to this file should be reverted like @sathiraumesh said... I meant the build was failing in this PR, we cannot merge until it's green