Skip to content

Commit

Permalink
Add step to collect DSPO logs in case of test failures
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo M. Oliveira <rmartine@redhat.com>
  • Loading branch information
rimolive committed Jul 22, 2024
1 parent 2cb9707 commit c8dfd9c
Showing 1 changed file with 124 additions and 1 deletion.
125 changes: 124 additions & 1 deletion .github/workflows/kind-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,127 @@ jobs:
- name: Run test
working-directory: ${{ github.workspace }}/.github/scripts/tests
run: |
sh kind-integration.sh
kubectl apply -f ${{ env.RESOURCES_DIR }}/crds
kubectl apply -f ${{ env.CONFIG_DIR }}/crd/external/route.openshift.io_routes.yaml
- name: Build image
env:
DSPO_IMAGE: ${{env.REGISTRY_ADDRESS}}/data-science-pipelines-operator
run: |
make podman-build -e IMG="${DSPO_IMAGE}"
- name: Create opendatahub namespace
run: |
kubectl create namespace opendatahub
- name: Deploy Argo Lite
working-directory: ${{ github.workspace }}/.github/resources/argo-lite
run: |
kustomize build . | kubectl apply -f -
- name: Deploy DSPO
env:
DSPO_IMAGE: ${{env.REGISTRY_ADDRESS}}/data-science-pipelines-operator
run: |
make podman-push -e IMG="${DSPO_IMAGE}"
make deploy-kind -e IMG="${DSPO_IMAGE}"
- name: Create Minio Namespace
run: |
kubectl create namespace ${{ env.MINIO_NAMESPACE }}
- name: Deploy Minio
working-directory: ${{ github.workspace }}/.github/resources/minio
run: |
kustomize build . | oc -n ${{ env.MINIO_NAMESPACE }} apply -f -
- name: Create MariaDB Namespace
run: |
kubectl create namespace ${{ env.MARIADB_NAMESPACE }}
- name: Deploy MariaDB
working-directory: ${{ github.workspace }}/.github/resources/mariadb
run: |
kustomize build . | oc -n ${{ env.MARIADB_NAMESPACE }} apply -f -
- name: Create Pypiserver Namespace
run: |
kubectl create namespace ${{ env.PYPISERVER_NAMESPACE }}
- name: Deploy pypi-server
working-directory: ${{ github.workspace }}/.github/resources/pypiserver/base
run: |
kustomize build . | oc -n ${{ env.PYPISERVER_NAMESPACE }} apply -f -
- name: Wait for Dependencies (DSPO, Minio, Mariadb, Pypi server)
run: |
kubectl wait -n opendatahub --timeout=60s --for=condition=Available=true deployment data-science-pipelines-operator-controller-manager
kubectl wait -n ${{ env.MARIADB_NAMESPACE }} --timeout=60s --for=condition=Available=true deployment mariadb
kubectl wait -n ${{ env.MINIO_NAMESPACE }} --timeout=60s --for=condition=Available=true deployment minio
kubectl wait -n ${{ env.PYPISERVER_NAMESPACE }} --timeout=60s --for=condition=Available=true deployment pypi-server
- name: Upload Python Packages to pypi-server
working-directory: ${{ github.workspace }}/.github/scripts/python_package_upload
run: |
sh package_upload.sh
- name: Create DSPA Namespace
run: |
kubectl create namespace ${{ env.DSPA_NAMESPACE }}
- name: Create Namespace for DSPA with External connections
run: |
kubectl create namespace ${{ env.DSPA_EXTERNAL_NAMESPACE }}
- name: Apply MariaDB and Minio Secrets and Configmaps in the External Namespace
working-directory: ${{ github.workspace }}/.github/resources/external-pre-reqs
run: |
kustomize build . | oc -n ${{ env.DSPA_EXTERNAL_NAMESPACE }} apply -f -
- name: Apply PIP Server ConfigMap
env:
RESOURCES_DIR: ${{ github.workspace }}/.github/resources/pypiserver/base
run: |
kubectl apply -f $RESOURCES_DIR/nginx-tls-config.yaml -n ${{ env.DSPA_NAMESPACE }}
- name: Run tests
working-directory: ${{ github.workspace }}
env:
NAMESPACE: ${{ env.DSPA_NAMESPACE }}
DSPA_NAME: ${{ env.DSPA_NAME }}
DSPA_PATH: ${{ env.DSPA_PATH }}
run: |
make integrationtest K8SAPISERVERHOST=$(oc whoami --show-server) DSPANAMESPACE=${NAMESPACE} DSPAPATH=${DSPA_PATH}
- name: Run tests for DSPA with External Connections
working-directory: ${{ github.workspace }}
env:
NAMESPACE: ${{ env.DSPA_EXTERNAL_NAMESPACE }}
DSPA_NAME: ${{ env.DSPA_EXTERNAL_NAME }}
DSPA_EXTERNAL_PATH: ${{ env.DSPA_EXTERNAL_PATH }}
run: |
make integrationtest K8SAPISERVERHOST=$(oc whoami --show-server) DSPANAMESPACE=${NAMESPACE} DSPAPATH=${DSPA_EXTERNAL_PATH}
- name: Collect DSPO Logs if any tests failed
if: failure()
run: |
tmp_dir=$(mktemp -d)
DSPO=$(kubectl get pod -n opendatahub --no-headers -o custom-columns=NAME:.metadata.name)
echo "DSPO Pod: $DSPO"
kubectl logs -n opendatahub $DSPO > $tmp_dir/$DSPO.log
kubectl get -n $DSPA_NAMESPACE events > $tmp_dir/events.log
kubectl get -n $DSPA_NAMESPACE all > $tmp_dir/resources.log
kubectl get -n $DSPA_NAMESPACE sa > $tmp_dir/serviceaccounts.log
kubectl get -n $DSPA_NAMESPACE secret > $tmp_dir/secrets.log
kubectl describe -n $DSPA_NAMESPACE deployment ds-pipeline-metadata-envoy-$DSPA_NAME > $tmp_dir/envoy.log
- name: Collect test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: integration-test-artifacts
path: /tmp/tmp.*/*

- name: Clean up
run: |
make undeploy-kind

0 comments on commit c8dfd9c

Please sign in to comment.