Cluster build and helloworld test #128
Workflow file for this run
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: 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 |