Unverified Commit fc1d74d1 authored by mvdbeek's avatar mvdbeek Committed by Nicola Soranzo
Browse files

Deploy postgresql and rabbitmq in kubernetes

Setting up minikube stops the postgres and rabbitmq containers that are
set up by the workflow. These are setup with custom docker networks, so
it isn't trivial to restart them. Instead we just deploy them to
minikube.
parent cf50e90f
Loading
Loading
Loading
Loading
+32 −0
Original line number Diff line number Diff line
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/name: testing
  name: testing
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: test
  template:
    metadata:
      labels:
        app.kubernetes.io/name: test
    spec:
      containers:
      - image: postgres:12
        name: postgres
        ports:
        - containerPort: 5432
        env:
          - name: POSTGRES_DB
            value: postgres
          - name: POSTGRES_USER
            value:  postgres
          - name: POSTGRES_PASSWORD
            value: postgres
      - image: rabbitmq
        name: rabbitmq
        ports:
        - containerPort: 5672
+12 −0
Original line number Diff line number Diff line
#!/usr/bin/env bash
set -ex

SCRIPTDIR=$(dirname "${BASH_SOURCE[0]}")
kubectl apply -f "$SCRIPTDIR/deployment.yaml"
kubectl expose deployment testing --type=LoadBalancer --name=testing-service

CLUSTER_IP=$(kubectl get service testing-service -o jsonpath='{.spec.clusterIP}')
GALAXY_TEST_DBURI="postgresql://postgres:postgres@${CLUSTER_IP}:5432/galaxy?client_encoding=utf-8"
GALAXY_TEST_AMQP_URL="amqp://${CLUSTER_IP}:5672)//"
export GALAXY_TEST_DBURI
export GALAXY_TEST_AMQP_URL
+48 −37
Original line number Diff line number Diff line
@@ -6,14 +6,15 @@ env:
jobs:
  test:
    name: Test
    runs-on: ubuntu-18.04
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        python-version: [3.7]
        subset: ['upload_datatype', 'extended_metadata', 'kubernetes', 'not (upload_datatype or extended_metadata or kubernetes)']
        python-version: ['3.7']
        subset: ['kubernetes']
    services:
      postgres:
        image: postgres:11
        image: postgres:13
        env:
          POSTGRES_USER: postgres
          POSTGRES_PASSWORD: postgres
@@ -56,5 +57,15 @@ jobs:
          path: ~/.cache/pip
          key: pip-cache-${{ matrix.python-version }}-${{ hashFiles('galaxy root/requirements.txt') }}
      - name: Run tests
        if: matrix.subset != 'kubernetes'
        run: './run_tests.sh -integration test/integration -- -k "${{ matrix.subset }}"'
        working-directory: 'galaxy root'
      - name: Run tests
        if: matrix.subset == 'kubernetes'
        run: 'source .ci/minikube-test-setup/start_services.sh && ./run_tests.sh -integration test/integration -- -k "${{ matrix.subset }}"'
        working-directory: 'galaxy root'
      - uses: actions/upload-artifact@v2
        if: failure()
        with:
          name: Integration test results (${{ matrix.python-version }}, ${{ matrix.subset }})
          path: 'galaxy root/run_integration_tests.html'