Add documentation for FunctionConfig CRD and reconciler #1401
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
| # Copyright 2025-2026 The Nephio Authors | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| name: End-to-End Tests | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| IMAGE_REPO: porch-kind | |
| KIND_CONTEXT_NAME: porch-test | |
| PORCH_FUNCTION_RUNNER_IMAGE: porch-function-runner | |
| PORCH_WRAPPER_SERVER_IMAGE: porch-wrapper-server | |
| PORCH_SERVER_IMAGE: porch-server | |
| PORCH_CONTROLLERS_IMAGE: porch-controllers | |
| jobs: | |
| check-changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| code: ${{ steps.filter.outputs.code }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| code: | |
| - '!docs/**' | |
| build: | |
| name: Build Dev Images | |
| runs-on: ubuntu-latest | |
| needs: check-changes | |
| if: needs.check-changes.outputs.code == 'true' | |
| timeout-minutes: 15 | |
| env: | |
| IMAGE_TAG: ${{ github.sha }} | |
| GOTOOLCHAIN: auto | |
| outputs: | |
| image-tag: ${{ steps.vars.outputs.image-tag }} | |
| steps: | |
| - name: Checkout Porch | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: ./.github/actions/setup-go-kpt | |
| with: | |
| install-kpt: "false" | |
| go-cache: "true" | |
| - name: Set variables | |
| id: vars | |
| run: | | |
| echo "image-tag=${IMAGE_TAG:0:8}" >> $GITHUB_OUTPUT | |
| echo "alpine-version=$(make --eval='print: ; @echo $(ALPINE_VERSION)' print)" >> $GITHUB_OUTPUT | |
| echo "golang-bookworm=$(make --eval='print: ; @echo $(GOLANG_BOOKWORM_VERSION)' print)" >> $GITHUB_OUTPUT | |
| echo "golang-alpine=$(make --eval='print: ; @echo $(GOLANG_ALPINE_VERSION)' print)" >> $GITHUB_OUTPUT | |
| - name: Build images in parallel | |
| run: | | |
| set -e | |
| export IMAGE_TAG=${IMAGE_TAG:0:8} | |
| export ALPINE_VERSION=${{ steps.vars.outputs.alpine-version }} | |
| export GOLANG_BOOKWORM_VERSION=${{ steps.vars.outputs.golang-bookworm }} | |
| export GOLANG_ALPINE_VERSION=${{ steps.vars.outputs.golang-alpine }} | |
| IMAGE_NAME=${PORCH_FUNCTION_RUNNER_IMAGE} WRAPPER_SERVER_IMAGE_NAME=${PORCH_WRAPPER_SERVER_IMAGE} make -C func/ build-image & | |
| pid1=$! | |
| IMAGE_NAME=${PORCH_SERVER_IMAGE} make -C build/ build-image & | |
| pid2=$! | |
| IMAGE_NAME=${PORCH_CONTROLLERS_IMAGE} make -C controllers/ build-image & | |
| pid3=$! | |
| wait $pid1 && wait $pid2 && wait $pid3 | |
| - name: Verify images exist | |
| run: | | |
| export IMAGE_TAG=${IMAGE_TAG:0:8} | |
| docker images | |
| docker inspect ${IMAGE_REPO}/${PORCH_SERVER_IMAGE}:${IMAGE_TAG} | |
| docker inspect ${IMAGE_REPO}/${PORCH_CONTROLLERS_IMAGE}:${IMAGE_TAG} | |
| docker inspect ${IMAGE_REPO}/${PORCH_FUNCTION_RUNNER_IMAGE}:${IMAGE_TAG} | |
| docker inspect ${IMAGE_REPO}/${PORCH_WRAPPER_SERVER_IMAGE}:${IMAGE_TAG} | |
| - name: Save all images | |
| run: | | |
| export IMAGE_TAG=${IMAGE_TAG:0:8} | |
| docker save \ | |
| ${IMAGE_REPO}/${PORCH_SERVER_IMAGE}:${IMAGE_TAG} \ | |
| ${IMAGE_REPO}/${PORCH_CONTROLLERS_IMAGE}:${IMAGE_TAG} \ | |
| ${IMAGE_REPO}/${PORCH_FUNCTION_RUNNER_IMAGE}:${IMAGE_TAG} \ | |
| ${IMAGE_REPO}/${PORCH_WRAPPER_SERVER_IMAGE}:${IMAGE_TAG} \ | |
| | gzip > porch-images.tar.gz | |
| - name: Upload images | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: porch-images | |
| path: porch-images.tar.gz | |
| compression-level: 0 | |
| retention-days: 1 | |
| tests: | |
| name: ${{ matrix.name }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| needs: [check-changes, build] | |
| if: needs.check-changes.outputs.code == 'true' | |
| env: | |
| IMAGE_TAG: ${{ needs.build.outputs.image-tag }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: "Porch E2E Tests" | |
| make_target: "run-in-kind" | |
| test_path: "${GITHUB_WORKSPACE}/test/e2e/api" | |
| test_env: "E2E=1" | |
| log_prefix: "porch-e2e" | |
| - name: "Porch E2E Tests (DB Cache)" | |
| make_target: "run-in-kind-db-cache-push-drafts" | |
| test_path: "${GITHUB_WORKSPACE}/test/e2e/api" | |
| test_env: "E2E=1 DB_CACHE=1" | |
| log_prefix: "porch-e2e-dbcache" | |
| - name: "Porch CLI E2E Tests" | |
| make_target: "run-in-kind" | |
| test_path: "${GITHUB_WORKSPACE}/test/e2e/cli" | |
| test_env: "E2E=1" | |
| log_prefix: "porch-cli-e2e" | |
| - name: "Porch CLI E2E Tests (DB Cache)" | |
| make_target: "run-in-kind-db-cache-push-drafts" | |
| test_path: "${GITHUB_WORKSPACE}/test/e2e/cli" | |
| test_env: "E2E=1" | |
| log_prefix: "porch-cli-e2e-dbcache" | |
| - name: "Porch CRD E2E Tests (v1alpha2)" | |
| make_target: "run-in-kind-v1alpha2" | |
| test_path: "${GITHUB_WORKSPACE}/test/e2e/crd -ginkgo.v" | |
| test_env: "E2E=1" | |
| log_prefix: "porch-crd-e2e" | |
| steps: | |
| - name: Checkout Porch | |
| uses: actions/checkout@v4 | |
| - name: Set up Go and kpt | |
| uses: ./.github/actions/setup-go-kpt | |
| with: | |
| go-cache: "true" | |
| - name: Install Kind | |
| uses: helm/kind-action@v1 | |
| with: | |
| version: v0.30.0 | |
| install_only: true | |
| - name: Set up Git config | |
| run: | | |
| git config --global user.name "Porch E2E" | |
| git config --global user.email "porch-e2e@porch.dev" | |
| - name: Setup dev env | |
| run: ${GITHUB_WORKSPACE}/scripts/setup-dev-env.sh | |
| - name: Download image artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: porch-images | |
| - name: Load images to kind | |
| run: | | |
| gunzip -c porch-images.tar.gz | docker load | |
| kind load docker-image ${IMAGE_REPO}/${PORCH_SERVER_IMAGE}:${{ needs.build.outputs.image-tag }} -n ${KIND_CONTEXT_NAME} | |
| kind load docker-image ${IMAGE_REPO}/${PORCH_CONTROLLERS_IMAGE}:${{ needs.build.outputs.image-tag }} -n ${KIND_CONTEXT_NAME} | |
| kind load docker-image ${IMAGE_REPO}/${PORCH_FUNCTION_RUNNER_IMAGE}:${{ needs.build.outputs.image-tag }} -n ${KIND_CONTEXT_NAME} | |
| kind load docker-image ${IMAGE_REPO}/${PORCH_WRAPPER_SERVER_IMAGE}:${{ needs.build.outputs.image-tag }} -n ${KIND_CONTEXT_NAME} | |
| - name: Deploy porch kpt pkg | |
| timeout-minutes: 10 | |
| run: IMAGE_TAG=${{ needs.build.outputs.image-tag }} SKIP_IMG_BUILD=true make ${{ matrix.make_target }} | |
| - name: Dump cluster state on deploy failure | |
| if: failure() | |
| run: | | |
| echo "=== Pods (all namespaces) ===" | |
| kubectl get pods -A | |
| echo "=== Events (porch-system) ===" | |
| kubectl get events -n porch-system --sort-by='.lastTimestamp' | tail -40 | |
| echo "=== Non-running pods details ===" | |
| kubectl get pods -A -o json | jq -r '.items[] | select(.status.phase != "Running" and .status.phase != "Succeeded") | "\n--- \(.metadata.namespace)/\(.metadata.name) (\(.status.phase)) ---"' | |
| for pod in $(kubectl get pods -A -o json | jq -r '.items[] | select(.status.phase != "Running" and .status.phase != "Succeeded") | "\(.metadata.namespace)/\(.metadata.name)"'); do | |
| ns=$(echo $pod | cut -d/ -f1) | |
| name=$(echo $pod | cut -d/ -f2) | |
| echo "--- Describe $ns/$name ---" | |
| kubectl describe pod -n $ns $name | tail -20 | |
| echo "--- Logs $ns/$name ---" | |
| kubectl logs -n $ns $name --all-containers --tail=30 2>/dev/null || true | |
| done | |
| - name: Run E2E tests | |
| run: ${{ matrix.test_env }} go test -v -timeout 20m ${{ matrix.test_path }} | |
| - name: Export porch server logs | |
| if: always() | |
| run: | | |
| name=$(kubectl -n porch-system get pod -l app=porch-server -o custom-columns=NAME:.metadata.name --no-headers=true) | |
| kubectl -n porch-system logs $name > ${{ matrix.log_prefix }}-server.log | |
| - name: Export porch controllers logs | |
| if: always() | |
| run: | | |
| name=$(kubectl -n porch-system get pod -l k8s-app=porch-controllers -o custom-columns=NAME:.metadata.name --no-headers=true 2>/dev/null || true) | |
| if [ -n "$name" ]; then | |
| kubectl -n porch-system logs $name > ${{ matrix.log_prefix }}-controllers.log 2>/dev/null || true | |
| fi | |
| - name: Archive logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.log_prefix }}-logs | |
| path: "*.log" | |
| compression-level: 0 | |
| retention-days: 2 | |
| e2e-summary: | |
| name: E2E Tests Summary | |
| if: always() | |
| needs: [check-changes, build, tests] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - run: exit 1 | |
| if: | | |
| needs.check-changes.outputs.code == 'true' && | |
| (contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')) | |
| - run: echo "All tests passed or skipped" |