Skip to content

Commit

Permalink
Merge pull request #28 from dm4/dm4/add-workflows
Browse files Browse the repository at this point in the history
ci: add workflow to run and test node
  • Loading branch information
juntao authored Apr 10, 2024
2 parents d46aa3b + be52716 commit 91635e9
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/runNode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Run a GaiaNet Node

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
- 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: ./install.sh
- name: Run start script
run: ./start.sh
- name: Sleep 10 seconds
run: sleep 10
- name: Test localhost API
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
run: |
ADDRESS=$(jq -r '.address' $HOME/gaianet/config.json)
curl --fail -X POST https://$ADDRESS.gaianet.xyz/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: Run stop script
run: ./stop.sh

0 comments on commit 91635e9

Please sign in to comment.