Skip to content
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

Lexically split entrypoint command for modal shell #1806

Merged
merged 1 commit into from
May 9, 2024

Conversation

irfansharif
Copy link
Member

@irfansharif irfansharif commented May 9, 2024

Something like this didn't previously work:

  $ modal shell --cmd 'bash -c bash'
  Failed to run command: No such file or directory

Because we were translating it to CMD ["bash -c bash"] underneath, which tries to execute a binary literally named "bash -c bash". The right thing to do is to translate it to CMD ["bash", "-c", "bash"], which we now do.

Basically now you can pass in arbitrarily sophisticated commands through --cmd, like:

  $ modal shell ollama-modal.py \
    --cmd 'bash -c "systemctl start ollama; ollama run llama3:instruct"'

(Maybe there's appetite for everything being passed through 'bash -c' by default?)

Something like this didn't previously work:

  $ modal shell --cmd 'bash -c bash'
  Failed to run command: No such file or directory

Because we were translating it to `CMD ["bash -c bash"]` underneath,
which tries to execute a binary literally named "bash -c bash". The
right thing to do is to translate it to `CMD ["bash", "-c", "bash"]`,
which we now do.

Basically now you can pass in arbitrarily sophisticated
commands through --cmd, like:

  $ modal shell ollama-modal.py \
    --cmd 'bash -c "systemctl start ollama; sleep 1; ollama run llama3:instruct"'

(Maybe there's appetite for everything being passed through 'bash -c' by
default?)
@irfansharif irfansharif requested a review from mwaskom May 9, 2024 03:51
Copy link

@modal-pr-review-automation modal-pr-review-automation bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approved 👍. This diff qualified for automatic approval and doesn't need follow up review.

@irfansharif
Copy link
Member Author

@prbot automerge

Copy link

@modal-pr-review-automation modal-pr-review-automation bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some required workflows are pending. Will automerge once they complete successfully. Please bear with us in this difficult time.

@modal-pr-review-automation modal-pr-review-automation bot merged commit ce0e48c into main May 9, 2024
24 checks passed
@modal-pr-review-automation modal-pr-review-automation bot deleted the irfansharif/240509.shlex-split branch May 9, 2024 04:00
irfansharif added a commit to irfansharif/ollama-modal that referenced this pull request May 9, 2024
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.

1 participant