-
Notifications
You must be signed in to change notification settings - Fork 123
96 lines (84 loc) · 2.47 KB
/
cluster-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Build FarmVibes.AI cluster
run-name: Cluster build and helloworld test
on: [push, pull_request, workflow_dispatch]
env:
FARMVIBES_AI_SKIP_DOCKER_FREE_SPACE_CHECK: yes
jobs:
build:
name: Build and test
runs-on: ubuntu-latest
steps:
- name: Free space before cleanup
shell: bash
run: |
echo "Memory and swap:"
free -h
echo
echo "Available storage:"
df -h
echo
- name: Remove unused software
shell: bash
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -fr /usr/local/lib/android
sudo rm -fr /opt/ghc
- name: Free space after cleanup
shell: bash
run: |
echo "Memory and swap:"
free -h
echo
echo "Available storage:"
df -h
echo
- name: Update pip version
shell: bash
run: pip install --upgrade pip
- name: Checkout
uses: actions/checkout@v3
- name: Install Python requirements
shell: bash
run: pip install --user ./src/vibe_core
- name: Actually build cluster
shell: bash
run: farmvibes-ai local setup
- name: Cluster status
shell: bash
run: |
echo "Deployments:"
kubectl get deployments
kubectl describe deployments
echo "Pods:"
kubectl get pods
echo "Events:"
kubectl get events
- name: Free space after cluster creation
shell: bash
run: |
echo "Memory and swap:"
free -h
echo
echo "Available storage:"
df -h
echo
- name: Run Hello World workflow
shell: bash
run: python -m vibe_core.farmvibes_ai_hello_world 300
- name: Install tool to view helloworld output
shell: bash
run: yes | sudo apt install caca-utils || echo
- name: Show helloworld output
shell: bash
run: find ~/.cache/farmvibes-ai/data -type f -name '*.tif' -exec img2txt {} \; 2> /dev/null
- name: Restart cluster
shell: bash
run: farmvibes-ai local restart
- name: Wait a bit before submitting a new run (as documented)
shell: bash
run: sleep 90
- name: Run Hello World workflow again
shell: bash
run: |
rm -fr ~/.cache/farmvibes-ai/data/{assets,stac}
python -m vibe_core.farmvibes_ai_hello_world 300