-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Better scripts ✨
- Loading branch information
Showing
33 changed files
with
261 additions
and
143 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash -e | ||
|
||
if command -v ollama &>/dev/null; then | ||
echo "ollama is already installed" | ||
exit 0 | ||
fi | ||
|
||
curl -fsSL https://ollama.com/install.sh | sh |
This file contains 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash -e | ||
|
||
if ! command -v openssl &>/dev/null; then | ||
sudo apt-get install -y openssl &>>./log/setup.log | ||
fi | ||
|
File renamed without changes.
This file contains 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash -e | ||
|
||
if ! command -v ollama &>/dev/null; then | ||
echo "ollama is not installed" | ||
exit 0 | ||
fi | ||
|
||
curl -fsSL https://ollama.com/install.sh | sh |
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash -e | ||
|
||
if ! command -v ollama &>/dev/null; then | ||
echo "ollama is not installed" | ||
exit 0 | ||
fi | ||
|
||
if [ -n "$LLM_MODEL" ]; then | ||
ollama pull $LLM_MODEL | ||
else | ||
ollama pull qwen2.5 | ||
fi | ||
ollama pull bespoke-minicheck | ||
ollama pull nomic-embed-text |
This file contains 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 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 |
---|---|---|
|
@@ -4,4 +4,3 @@ | |
./script/dev/setup-asdf | ||
./script/dev/setup-ruby | ||
./bin/setup | ||
./script/ollama/setup |
This file contains 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 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 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash -e | ||
|
||
. ./script/concerns/loader | ||
|
||
start_loader "Setting up OpenSSL" | ||
./script/concerns/linux/setup-openssl &>>./log/setup.log | ||
stop_loader | ||
|
||
if [ "$OLLAMA_BASE_URL" == "http://localhost:11434" ]; then | ||
start_loader "Setting up Ollama" | ||
./script/concerns/linux/setup-ollama &>>./log/setup.log | ||
stop_loader | ||
|
||
start_loader "Pulling models. This may take a while..." | ||
./script/concerns/pull-models &>>./log/setup.log | ||
stop_loader | ||
fi | ||
|
||
start_loader "Setting up Docker" | ||
./script/concerns/linux/setup-docker &>>./log/setup.log | ||
stop_loader | ||
|
||
start_loader "Setting up Nosia" | ||
# Set environment variables for Nosia | ||
./script/concerns/setup-env &>>./log/setup.log | ||
# Build Nosia | ||
docker compose --env-file .env build &>>./log/setup.log | ||
stop_loader |
This file contains 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
. ./script/concerns/loader | ||
|
||
start_loader "Starting ollama" | ||
sudo systemctl start ollama.service &>>./log/ollama.log | ||
stop_loader | ||
|
||
start_loader "Starting Nosia" | ||
docker compose --env-file .env up -d &>>./log/docker.log | ||
stop_loader |
This file contains 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
. ./script/concerns/loader | ||
|
||
start_loader "Stopping Nosia" | ||
docker compose down &>>./log/docker.log | ||
stop_loader | ||
|
||
start_loader "Stopping ollama" | ||
sudo systemctl stop ollama.service &>>./log/ollama.log | ||
stop_loader |
This file contains 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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash -e | ||
|
||
. ./script/concerns/loader | ||
|
||
if command -v ollama &>/dev/null; then | ||
start_loader "Upgrading ollama" | ||
./script/concerns/linux/upgrade-ollama &>>./log/upgrade.log | ||
stop_loader | ||
|
||
start_loader "Pulling models. This may take a while..." | ||
./script/concerns/pull-models &>>./log/upgrade.log | ||
stop_loader | ||
fi | ||
|
||
start_loader "Upgrading Nosia" | ||
# Pull latest changes | ||
git pull &>>./log/upgrade.log | ||
# Build Nosia | ||
docker compose --env-file .env build &>>./log/upgrade.log | ||
stop_loader |
This file contains 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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/bash | ||
|
||
. ./script/concerns/loader | ||
|
||
start_loader "Setting up prerequisites: brew and openssl" | ||
|
||
# Install brew if not installed | ||
if ! command -v brew &>/dev/null; then | ||
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh | sh &>./log/setup.log | ||
fi | ||
|
||
# Install openssl if not installed | ||
if ! brew list openssl &>/dev/null; then | ||
brew install openssl &>./log/setup.log | ||
fi | ||
|
||
stop_loader | ||
|
||
start_loader "Setting up ollama" | ||
# Install ollama if not installed | ||
if ! brew list ollama &>/dev/null; then | ||
brew install ollama &>./log/setup.log | ||
fi | ||
stop_loader | ||
|
||
start_loader "Pulling models. This may take a while..." | ||
# Start ollama | ||
brew services start ollama &>./log/setup.log | ||
# Wait for ollama to start | ||
sleep 5 | ||
# Pull models | ||
ollama pull $LLM_MODEL &>./log/setup.log | ||
ollama pull bespoke-minicheck &>./log/setup.log | ||
ollama pull nomic-embed-text &>./log/setup.log | ||
stop_loader | ||
|
||
start_loader "Setting up podman" | ||
# Install podman if not installed | ||
if ! brew list podman &>/dev/null; then | ||
brew install podman podman-compose &>./log/setup.log | ||
fi | ||
stop_loader | ||
|
||
start_loader "Setting up Nosia" | ||
# Initialize podman machine | ||
podman machine init &>./log/setup.log | ||
# Set podman to rootful mode | ||
podman machine set --rootful &>./log/setup.log | ||
# Start podman machine | ||
podman machine start &>./log/setup.log | ||
# Set environment variables for Nosia | ||
OLLAMA_BASE_URL=http://host.containers.internal:11434 ./script/concerns/setup-env &>./log/setup.log | ||
# Build Nosia | ||
podman-compose --env-file .env build &>./log/setup.log | ||
stop_loader |
This file contains 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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
. ./script/concerns/loader | ||
|
||
start_loader "Starting ollama" | ||
OLLAMA_MAX_LOADED_MODELS=3 ollama serve &>./log/ollama.log & | ||
stop_loader | ||
|
||
start_loader "Starting Nosia" | ||
podman machine start &>./log/podman.log | ||
podman-compose --env-file .env up -d &>./log/podman.log | ||
stop_loader |
This file contains 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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
. ./script/concerns/loader | ||
|
||
start_loader "Stopping Nosia" | ||
podman-compose down &>./log/podman.log | ||
podman machine stop &>./log/podman.log | ||
stop_loader | ||
|
||
start_loader "Stopping ollama" | ||
killall "ollama" &>./log/ollama.log | ||
stop_loader |
Oops, something went wrong.