Skip to content

Local test

Local test #59

# This workflow will test that the local k8s setup does not error
# This is useful to keep an eye on version incompatibilities
name: Local test
on:
push:
branches: [ main ]
pull_request:
schedule:
- cron: '0 0 * * 0'
jobs:
test:
name: Start up local kubernetes pods
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: start minikube
id: minikube
uses: medyagh/setup-minikube@latest
with:
cache: false
- name: test cluster
run: kubectl get pods -A
- name: build image
run: |
export SHELL=/bin/bash
eval $(minikube -p minikube docker-env)
docker build local_k8s/containers/omero-server -t omero-server
docker build local_k8s/containers/omero-web -t omero-web
echo -n "verifying images:"
docker images
- name: startup pods
run: kubectl apply -k local_k8s/test
- name: sleep for 5 min
run: sleep 300s
- name: print pods
run: kubectl get pods -A
- name: server logs
run: kubectl logs omero-server
- name: omero logs
run: |
kubectl exec omero-server -- bash -c "tail /opt/omero/server/OMERO.server/var/log/Blitz-0.log"
echo $(kubectl exec omero-server -- bash -c "cat /opt/omero/server/OMERO.server/var/log/Blitz-0.log" | grep ERROR)
kubectl exec omero-server -- bash -c "tail /opt/omero/server/OMERO.server/var/log/master.err"
- name: test servers
run: |
kubectl exec omero-server -- bash -c "/opt/omero/server/server_venv/bin/omero login -u root -w omero -s 127.0.0.1:4064"
- name: test web
run: |
kubectl port-forward svc/omero-web 8080:4080 --address='0.0.0.0' &
sleep 30s
curl -I localhost:8080