-
Notifications
You must be signed in to change notification settings - Fork 13
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
Improve ollama startup script for linux #159
Improve ollama startup script for linux #159
Conversation
f86d6ab
to
ebae717
Compare
6798093
to
14f4bf1
Compare
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.
Overall, this is a nice clean up. It makes the script much tidier than it was before, but I wouldn't really say the script is more optimized (at least optimize is a loaded word that usually connotes runtime efficiency).
I'd change the commit message to something like this
start_ollama.sh: Refactor Ollama startup script for readability
The start_ollama.sh script is used by paver on Linux to help ensure
ollama gets started if it's not already running.
The script is functional, but largely open coded, and can be improved
for readability and maintainability sake.
This commit makes a few changes to improve the script:
- Introduce `readonly` constants for timeout and API endpoint URL
- Add and use helper functions (`ollama_is_running()`, `in_container()`, `command_exists()`) for legibility
- Add `main()` function entry point
0837a30
to
afe38d3
Compare
The start_ollama.sh script is used by paver on Linux to help ensure ollama gets started if it's not already running. The script is functional, but largely open coded, and can be improved for readability and maintainability sake. This commit makes a few changes to improve the script: - Introduce `readonly` constants for timeout and API endpoint URL - Add and use helper functions (`ollama_is_running()`, `in_container()`, `command_exists()`) for legibility - Add `main()` function entry point Signed-off-by: Fred Bricon <[email protected]>
afe38d3
to
a3e806c
Compare
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.
lgtm
Signed-off-by: Fred Bricon [email protected]