WIP: test: Fix CI to pass the TLS client flags #483
Workflow file for this run
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: KFP API Integration V2 (Legacy) | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
paths: | |
- '.github/workflows/legacy-v2-api-integration-tests.yml' | |
- '.github/actions/create-cluster/**' | |
- '.github/resources/**' | |
- 'api/**' | |
- 'go.mod' | |
- 'go.sum' | |
- 'backend/**' | |
- 'manifests/kustomize/**' | |
- 'test/**' | |
- '!**/*.md' | |
- '!**/OWNERS' | |
jobs: | |
build: | |
uses: ./.github/workflows/image-builds-with-cache.yml | |
api-integration-tests-v2: | |
runs-on: ubuntu-latest | |
needs: build | |
strategy: | |
matrix: | |
pipeline_store: [ "database", "kubernetes" ] | |
k8s_version: [ "v1.31.0" ] | |
pod_to_pod_tls_enabled: [ true, false ] | |
exclude: | |
# Pod to Pod TLS manifests are not yet implemented for Kubernetes Native API mode | |
- pipeline_store: "kubernetes" | |
pod_to_pod_tls_enabled: true | |
name: API integration tests v2 - K8s with ${{ matrix.pipeline_store }} ${{ matrix.k8s_version }} pod_to_pod_tls_enabled=${{ matrix.pod_to_pod_tls_enabled }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v5 | |
- name: Free up disk space | |
run: ./.github/resources/scripts/free-disk-space.sh | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Create KFP cluster | |
id: create-kfp-cluster | |
uses: ./.github/actions/create-cluster | |
with: | |
k8s_version: ${{ matrix.k8s_version }} | |
continue-on-error: true | |
- name: Deploy | |
id: deploy | |
uses: ./.github/actions/deploy | |
if: ${{ steps.create-kfp-cluster.outcome == 'success' }} | |
with: | |
image_path: ${{ needs.build.outputs.IMAGE_PATH }} | |
image_tag: ${{ needs.build.outputs.IMAGE_TAG }} | |
image_registry: ${{ needs.build.outputs.IMAGE_REGISTRY }} | |
pipeline_store: ${{ matrix.pipeline_store }} | |
pod_to_pod_tls_enabled: ${{ matrix.pod_to_pod_tls_enabled }} | |
- name: Configure Cluster CA Cert for TLS-Enabled Tests | |
shell: bash | |
id: configure-cluster-ca-cert | |
if: ${{ matrix.pod_to_pod_tls_enabled }} | |
run: | | |
CA_CERT_FILE="${GITHUB_WORKSPACE}/ca.crt" | |
kubectl get secret kfp-api-tls-cert -n kubeflow -o jsonpath='{.data.ca\.crt}' | base64 -d > "$CA_CERT_FILE" | |
echo "TLS certificate retrieved and saved to $CA_CERT_FILE" | |
echo "CA_CERT_PATH=$CA_CERT_FILE" >> $GITHUB_OUTPUT | |
- name: Configure Input Variables | |
shell: bash | |
id: configure | |
if: ${{ steps.deploy.outcome == 'success' }} | |
run: | | |
CA_CERT_PATH="" | |
TLS_ENABLED="false" | |
if [ "${{ matrix.pod_to_pod_tls_enabled }}" == "true" ]; then | |
CA_CERT_PATH="${{ steps.configure-cluster-ca-cert.outputs.CA_CERT_PATH }}" | |
TLS_ENABLED="true" | |
fi | |
echo "CA_CERT_PATH=$CA_CERT_PATH" >> $GITHUB_OUTPUT | |
echo "TLS_ENABLED=$TLS_ENABLED" >> $GITHUB_OUTPUT | |
- name: Forward MLMD port | |
id: forward-mlmd-port | |
if: ${{ steps.deploy.outcome == 'success' }} | |
run: kubectl -n kubeflow port-forward svc/metadata-grpc-service 8080:8080 & | |
continue-on-error: true | |
- name: API integration tests v2 | |
id: tests | |
if: ${{ steps.forward-mlmd-port.outcome == 'success' }} | |
working-directory: ./backend/test/v2/integration | |
run: go test -v ./... -args -runIntegrationTests=true -namespace=kubeflow -tlsEnabled=${{ steps.configure.outputs.TLS_ENABLED }} -caCertPath=${{ steps.configure.outputs.CA_CERT_PATH }} | |
env: | |
PULL_NUMBER: ${{ github.event.pull_request.number }} | |
PIPELINE_STORE: ${{ matrix.pipeline_store }} | |
continue-on-error: true | |
- name: Collect failed logs | |
if: ${{ steps.deploy.outcome != 'success' || steps.forward-mlmd-port.outcome != 'success' || steps.tests.outcome != 'success' }} | |
run: | | |
./.github/resources/scripts/collect-logs.sh --ns kubeflow --output /tmp/tmp_pod_log.txt | |
exit 1 | |
- name: Collect test results | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: kfp-api-integration-tests-v2-artifacts-k8s-${{ matrix.k8s_version }}-${{ matrix.pipeline_store }} | |
path: /tmp/tmp*/* |