Merge pull request #546 from ksuderman/fix-init-db-schema-race #746
This file contains hidden or 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: Linting and deployment test on K3S | |
| on: | |
| push: | |
| branches: [master, dev] | |
| pull_request: {} | |
| workflow_dispatch: {} | |
| workflow_call: {} # Allow calling from release workflow | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| jobs: | |
| linting: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install Kubectl | |
| run: curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" && chmod +x ./kubectl && sudo mv ./kubectl /usr/local/bin/kubectl && kubectl version || true | |
| - name: Install Helm | |
| id: install-helm | |
| run: | | |
| if ! command -v helm &> /dev/null; then | |
| curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash | |
| fi | |
| helm version | |
| - uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - name: Helm linting for galaxy | |
| run: helm lint galaxy/ | |
| test: | |
| runs-on: ubuntu-latest | |
| name: test (${{ matrix.mode }}) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # Default chart config is a multi-user Galaxy instance. | |
| - mode: multi-user | |
| extra_args: "" | |
| # single_user pins Galaxy to a single user instance. | |
| - mode: single-user | |
| extra_args: "--set 'configs.galaxy\\.yml.galaxy.single_user=admin@galaxy.org'" | |
| steps: | |
| - name: Install Helm | |
| id: install-helm | |
| run: | | |
| if ! command -v helm &> /dev/null; then | |
| curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash | |
| fi | |
| helm version | |
| - uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - name: Start k8s locally | |
| uses: jupyterhub/action-k3s-helm@v4 | |
| with: | |
| k3s-version: v1.34.7+k3s1 # releases: https://github.com/k3s-io/k3s/tags | |
| metrics-enabled: false | |
| traefik-enabled: false | |
| - name: Verify function of k8s, kubectl, and helm | |
| run: | | |
| echo "kubeconfig: $KUBECONFIG" | |
| kubectl version | |
| kubectl get pods --all-namespaces | |
| helm version | |
| helm list | |
| - name: Helm repo add galaxy | |
| run: helm repo add galaxy https://github.com/CloudVE/helm-charts/raw/master | |
| - name: Helm install galaxy-helm-deps | |
| run: time bash -c 'helm install --create-namespace --wait -n "galaxy-deps" "galaxy-deps" galaxy/galaxy-deps --set cvmfs.cvmfscsi.cache.alien.enabled=false --wait --timeout=1200s' | |
| - name: Helm install Galaxy (${{ matrix.mode }}) | |
| run: | | |
| time helm install --create-namespace -n galaxy galaxy ./galaxy \ | |
| --set persistence.accessMode="ReadWriteOnce" \ | |
| --set resources.requests.memory=0Mi,resources.requests.cpu=0m \ | |
| ${{ matrix.extra_args }} \ | |
| --wait --timeout=1200s | |
| - name: Get events | |
| run: kubectl get events -n galaxy; kubectl get events -n csi-drivers; | |
| if: always() | |
| - name: Get pods, pvc, and pv | |
| run: kubectl get pods -n galaxy; kubectl get pvc -n galaxy; kubectl get pv -n galaxy | |
| if: always() | |
| - name: Print handler logs | |
| run: | | |
| echo "=== Collecting Galaxy handler logs ===" | |
| for handler in web job workflow; do | |
| echo "--- ${handler} handler logs ---" | |
| POD_NAME=$(kubectl get pods -n galaxy -l "app.kubernetes.io/component=galaxy-${handler}-handler" -o jsonpath='{.items[0].metadata.name}' 2>/dev/null || echo "") | |
| if [[ -n "$POD_NAME" ]]; then | |
| echo "Pod: $POD_NAME" | |
| kubectl logs -n galaxy "$POD_NAME" --tail=100 || echo "Failed to get logs for $POD_NAME" | |
| else | |
| # Fallback to old method if label selector doesn't work | |
| POD_NAME=$(kubectl get pods -n galaxy -o name | grep "galaxy-${handler}" | head -1 | cut -d/ -f2 2>/dev/null || echo "") | |
| if [[ -n "$POD_NAME" ]]; then | |
| echo "Pod (fallback): $POD_NAME" | |
| kubectl logs -n galaxy "$POD_NAME" --tail=100 || echo "Failed to get logs for $POD_NAME" | |
| else | |
| echo "No ${handler} handler pod found" | |
| fi | |
| fi | |
| echo "" | |
| done | |
| if: always() | |
| - name: Check appVersion | |
| if: always() | |
| run: | | |
| kubectl get svc -n galaxy | |
| kubectl describe svc -n galaxy galaxy-nginx | |
| appVersion=$(cat galaxy/Chart.yaml | grep ^appVersion: | awk '{print $2}' | tr -d '"') | |
| address=$(kubectl get svc -n galaxy galaxy-nginx -o jsonpath="http://{.spec.clusterIP}:{.spec.ports[0].port}/galaxy/api/version") | |
| echo "Address is $address" | |
| apiVersion=$(curl $address | jq -r '"\(.version_major).\(.version_minor)"') | |
| echo "appVersion: $appVersion" | |
| echo "apiVersion: $apiVersion" | |
| if [ "$appVersion" != "$apiVersion" ]; then | |
| exit 1 | |
| fi |