Update runNode.yml #169
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
name: Run a GaiaNet Node v2 | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
push: | |
branches: [ '*' ] | |
pull_request: | |
branches: [ '*' ] | |
jobs: | |
run-node-and-test: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install apt packages | |
run: sudo apt-get update && sudo apt-get install -y curl git jq lsof supervisor | |
# - name: Use TinyLlama instead of Llama-2-7B | |
# run: | | |
# GAIANET_DIR=$HOME/gaianet | |
# mkdir -p $GAIANET_DIR | |
# cp config.json $GAIANET_DIR/config.json | |
# sed -i 's|Llama-2-7B-Chat-GGUF/resolve/main/Llama-2-7b-chat-hf-Q5_K_M.gguf|TinyLlama-1.1B-Chat-v1.0-GGUF/resolve/main/TinyLlama-1.1B-Chat-v1.0-Q5_K_M.gguf|g' $GAIANET_DIR/config.json | |
# sed -i 's|llama-2-chat|chatml|g' $GAIANET_DIR/config.json | |
# cat $GAIANET_DIR/config.json | |
- name: Run install script | |
run: | | |
chmod +x ./install.sh | |
./install.sh | |
gaianet --help | |
- name: Use TinyLlama-1.1B-Chat | |
run: | | |
gaianet config --chat-url "https://huggingface.co/second-state/TinyLlama-1.1B-Chat-v1.0-GGUF/resolve/main/TinyLlama-1.1B-Chat-v1.0-Q5_K_M.gguf" --chat-ctx-size 1024 --prompt-template chatml | |
- name: Initialize | |
run: | | |
gaianet init | |
- name: Run | |
run: | | |
gaianet start | |
- name: Sleep 20 seconds | |
run: sleep 20 | |
- name: Test localhost API | |
continue-on-error: true | |
run: | | |
curl --fail -X POST http://localhost:8080/v1/chat/completions \ | |
-H 'accept: application/json' \ | |
-H 'Content-Type: application/json' \ | |
-d '{"messages":[{"role":"system", "content": "You are a helpful assistant."}, {"role":"user", "content": "Where is Paris?"}], "model":"TinyLlama-1.1B-Chat-v1.0-Q5_K_M"}' | |
- name: Test frp API | |
continue-on-error: true | |
run: | | |
ADDRESS=$(jq -r '.address' $HOME/gaianet/config.json) | |
echo $ADDRESS | |
curl --fail -X POST https://$ADDRESS.gaianet.network/v1/chat/completions \ | |
-H 'accept: application/json' \ | |
-H 'Content-Type: application/json' \ | |
-d '{"messages":[{"role":"system", "content": "You are a helpful assistant."}, {"role":"user", "content": "Where is Paris?"}], "model":"TinyLlama-1.1B-Chat-v1.0-Q5_K_M"}' | |
- name: Stop | |
run: | | |
gaianet stop | |
echo "LOGFILE: start-llamaedge.log\n\n" | |
cat ~/gaianet/log/start-llamaedge.log | |
echo "LOGFILE: init-qdrant.log\n\n" | |
cat ~/gaianet/log/init-qdrant.log | |
echo "LOGFILE: start-qdrant.log\n\n" | |
cat ~/gaianet/log/start-qdrant.log | |
echo "LOGFILE: start-gaianet-domain.log\n\n" | |
cat ~/gaianet/log/start-gaianet-domain.log |