Skip to content

Commit

Permalink
feat: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
luboszima committed Mar 31, 2024
1 parent 0262ce5 commit b263201
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
5 changes: 5 additions & 0 deletions scripts/restart-webui.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

MY_IP=$(terragrunt output --terragrunt-working-dir ./terragrunt/ai/server ipv4 | xargs)
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o GlobalKnownHostsFile=/dev/null "devops@$MY_IP" docker restart webui 2>/dev/null
echo "restarted webui on $MY_IP"
8 changes: 1 addition & 7 deletions scripts/ssh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,4 @@

MY_IP=$(terragrunt output --terragrunt-working-dir ./terragrunt/ai/server ipv4 | xargs)
ssh-keygen -R "$MY_IP"
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "devops@$MY_IP"


# cycle through a list of items
echo "llama2-uncensored, llama2:13b" | sed 's/,/\n/g' | xargs -I {} echo "{}" | while read -r item; do
echo "item: $item"
done
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o GlobalKnownHostsFile=/dev/null "devops@$MY_IP" 2>/dev/null
2 changes: 1 addition & 1 deletion scripts/upload-rag-docs.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash

MY_IP=$(terragrunt output --terragrunt-working-dir ./terragrunt/ai/server ipv4 | xargs)
scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o GlobalKnownHostsFile=/dev/null -r ./RAG-docs devops@$MY_IP:/home/devops/data/docs
scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o GlobalKnownHostsFile=/dev/null -r ./RAG-docs devops@$MY_IP:/home/devops/data/docs 2>/dev/null
7 changes: 4 additions & 3 deletions terragrunt/ai/server/cloud_init.yaml.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ write_files:
expose:
- 11434
volumes:
- ollama_vol:/root/.ollama
- /home/${user_name}/data/ollama:/root/.ollama
networks:
- ollama_net
restart: always
Expand All @@ -147,8 +147,8 @@ write_files:
environment:
- OLLAMA_BASE_URL=http://ollama:11434
- ENABLE_#=true
volumes:
ollama_vol:
volumes:
- /home/${user_name}/data/docs:/data/docs

networks:
ollama_net:
Expand All @@ -160,6 +160,7 @@ write_files:
# - ollama pull llama2-uncensored
runcmd:
- mkdir -p /home/${user_name}/data/docs
- mkdir -p /home/${user_name}/data/ollama
- chown ${user_name}:${user_name} -R /home/${user_name}

# Change default ssh port, disable root login and allow new user login
Expand Down
2 changes: 1 addition & 1 deletion terragrunt/ai/server/terragrunt.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ generate "cloud_init" {
user_name = "devops"
init_ssh_public_key = local.env["secrets"]["pub_ssh_key"]
timezone = local.region["timezone"]
ai_models = local.env["ai"]["models"]
ai_models = local.env["ai"]["models"]
})
}

0 comments on commit b263201

Please # to comment.