Skip to content
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

ci: add workflow to run and test node #27

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/runNode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
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: 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 -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":"Llama-2-7b-chat-hf-Q5_K_M"}'
- name: Test frp API
run: |
ls -l $HOME/
cat $HOME/gaianet/config.json
ADDRESS=$(jq -r '.address' $HOME/gaianet/config.json)
echo $ADDRESS
echo https://$ADDRESS.gaianet.xyz/v1/chat/completions
curl -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":"Llama-2-7b-chat-hf-Q5_K_M"}'
- name: Sleep 600 seconds
run: sleep 600
- name: Run stop script
run: ./stop.sh