From 0d8aea6085eb44ac170d657cb208ca4a670d4d63 Mon Sep 17 00:00:00 2001 From: David Schall Date: Thu, 18 Jul 2024 05:21:36 -0600 Subject: [PATCH] Add workflows for new functions Signed-off-by: David Schall --- .github/workflows/e2e-image-rotate.yml | 205 ++++++++++++++++++ .github/workflows/e2e-rnn-serving.yml | 187 ++++++++++++++++ .../e2e-video-analytics-standalone.yml | 201 +++++++++++++++++ .github/workflows/e2e-video-processing.yml | 201 +++++++++++++++++ 4 files changed, 794 insertions(+) create mode 100644 .github/workflows/e2e-image-rotate.yml create mode 100644 .github/workflows/e2e-rnn-serving.yml create mode 100644 .github/workflows/e2e-video-analytics-standalone.yml create mode 100644 .github/workflows/e2e-video-processing.yml diff --git a/.github/workflows/e2e-image-rotate.yml b/.github/workflows/e2e-image-rotate.yml new file mode 100644 index 00000000..8d879599 --- /dev/null +++ b/.github/workflows/e2e-image-rotate.yml @@ -0,0 +1,205 @@ +name: Image Rotate End-to-End Tests + +on: + workflow_dispatch: + schedule: + - cron: "0 9 * * 1" + push: + branches: [main] + paths: + - "benchmarks/image-rotate/**" + - "utils/**" + - "tools/**" + - "runner/**" + + pull_request: + branches: [main] + paths: + - "benchmarks/image-rotate/**" + - "utils/**" + - "tools/**" + - "runner/**" + +env: + GOOS: linux + GO111MODULE: on + PORT: 50051 + PLATFORMS: linux/amd64,linux/arm64 + +jobs: + build-and-push: + name: Build and push all images + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + include: + - service: image-rotate-init-database + target: databaseInit + - service: image-rotate-go + target: imageRotateGo + - service: image-rotate-python + target: imageRotatePython + + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v4 + with: + lfs: "true" + + - uses: actions/setup-go@v5 + with: + go-version: '1.21' + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push + env: + GOPRIVATE_KEY: ${{ secrets.XDT_REPO_ACCESS_KEY }} + uses: docker/build-push-action@v5 + with: + push: true + file: benchmarks/image-rotate/docker/Dockerfile + platforms: ${{ env.PLATFORMS }} + target: ${{ matrix.target }} + tags: vhiveease/${{ matrix.service }}:latest + context: . + + test-compose: + name: Test Docker Compose + needs: build-and-push + env: + YAML_DIR: benchmarks/image-rotate/yamls/docker-compose/ + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + service: + [ + image-rotate-go, + image-rotate-python + ] + + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v4 + with: + lfs: "true" + + - name: start docker-compose benchmark + run: | + docker-compose -f ${{ env.YAML_DIR }}/dc-${{ matrix.service }}.yaml pull + docker-compose -f ${{ env.YAML_DIR }}/dc-${{ matrix.service }}.yaml up &> log_file & + sleep 60s + cat log_file + + - name: invoke the chain + run: | + ./tools/bin/grpcurl -plaintext localhost:50000 helloworld.Greeter.SayHello + + - name: show docker-compose log + run: cat log_file + + test-knative: + name: Test Knative Deployment + needs: build-and-push + env: + KIND_VERSION: v0.14.0 + K8S_VERSION: v1.23 + YAML_DIR: benchmarks/image-rotate/yamls/knative/ + + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + service: + [ + image-rotate-go, + image-rotate-python + ] + steps: + - uses: actions/checkout@v4 + with: + lfs: "true" + - name: Checkout LFS objects + run: git lfs checkout + + - uses: actions/setup-go@v5 + with: + go-version: '1.21' + + ## Setup a Knative cluster to test the service + - name: Create k8s Kind Cluster + run: bash ./runner/scripts/01-kind.sh + + - name: Install Serving + run: bash ./runner/scripts/02-serving.sh + + - name: Install Kourier + run: bash ./runner/scripts/02-kourier.sh + + - name: Setup domain + run: | + INGRESS_HOST="127.0.0.1" + KNATIVE_DOMAIN=$INGRESS_HOST.sslip.io + kubectl patch configmap -n knative-serving config-domain -p "{\"data\": {\"$KNATIVE_DOMAIN\": \"\"}}" + + + ## Test the service + - name: Deploy database + working-directory: benchmarks/image-rotate/yamls/knative/ + run: | + kubectl apply -f image-rotate-database.yaml + + - name: Deploy knative + run: | + kubectl apply -f ${{ env.YAML_DIR }}/kn-${{ matrix.service }}.yaml + + - name: Check if service is ready + run: | + kubectl wait --for=condition=Ready -f ${{ env.YAML_DIR }}/kn-${{ matrix.service }}.yaml --timeout 120s + kubectl get service + kubectl get -f ${{ env.YAML_DIR }}/kn-${{ matrix.service }}.yaml + + - name: Test invoking once + working-directory: tools/test-client + run: | + set -x + go build ./test-client.go + + NODEPORT=80 + url=$(kubectl get kservice ${{ matrix.service }} | awk '$2 ~ /http/ {sub(/http\:\/\//,""); print $2}') + + ./test-client --addr $url:$NODEPORT --name "Example text for CI" + + - name: Print logs + if: ${{ always() }} + run: | + set -x + container_list=$(kubectl get pods -n default -o jsonpath="{.items[*].spec.containers[*].name}") + for container_name in $container_list + do + kubectl logs -n default -c $container_name -l serving.knative.dev/service=${{ matrix.service }} + done + + - name: Print logs from database + if: ${{ always() }} + run: | + set -x + kubectl logs deployment/image-rotate-database + + - name: Down + if: ${{ always() }} + run: | + kubectl delete -f ${{ env.YAML_DIR }}/kn-${{ matrix.service }}.yaml --namespace default --wait diff --git a/.github/workflows/e2e-rnn-serving.yml b/.github/workflows/e2e-rnn-serving.yml new file mode 100644 index 00000000..a68ecb26 --- /dev/null +++ b/.github/workflows/e2e-rnn-serving.yml @@ -0,0 +1,187 @@ +name: RNN Serving End-to-End Tests + +on: + workflow_dispatch: + schedule: + - cron: "0 9 * * 1" + push: + branches: [main] + paths: + - "benchmarks/rnn-serving/**" + - "utils/**" + - "tools/**" + - "runner/**" + + pull_request: + branches: [main] + paths: + - "benchmarks/rnn-serving/**" + - "utils/**" + - "tools/**" + - "runner/**" + +env: + GOOS: linux + GO111MODULE: on + PORT: 50051 + PLATFORMS: linux/amd64,linux/arm64 + +jobs: + build-and-push: + name: Build and push all images + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + include: + - service: rnn-serving-python + target: rnnServingPython + + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v4 + with: + lfs: "true" + + - uses: actions/setup-go@v5 + with: + go-version: '1.21' + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push + env: + GOPRIVATE_KEY: ${{ secrets.XDT_REPO_ACCESS_KEY }} + uses: docker/build-push-action@v5 + with: + push: true + file: benchmarks/rnn-serving/docker/Dockerfile + platforms: ${{ env.PLATFORMS }} + target: ${{ matrix.target }} + tags: vhiveease/${{ matrix.service }}:latest + context: . + + test-compose: + name: Test Docker Compose + needs: build-and-push + env: + YAML_DIR: benchmarks/rnn-serving/yamls/docker-compose/ + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + service: + [ + rnn-serving-python + ] + + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v4 + with: + lfs: "true" + + - name: start docker-compose benchmark + run: | + docker-compose -f ${{ env.YAML_DIR }}/dc-${{ matrix.service }}.yaml pull + docker-compose -f ${{ env.YAML_DIR }}/dc-${{ matrix.service }}.yaml up &> log_file & + sleep 60s + cat log_file + + - name: invoke the chain + run: | + ./tools/bin/grpcurl -plaintext localhost:50000 helloworld.Greeter.SayHello + + - name: show docker-compose log + run: cat log_file + + test-knative: + name: Test Knative Deployment + needs: build-and-push + env: + KIND_VERSION: v0.14.0 + K8S_VERSION: v1.23 + YAML_DIR: benchmarks/rnn-serving/yamls/knative/ + + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + service: + [ + rnn-serving-python + ] + steps: + - uses: actions/checkout@v4 + with: + lfs: "true" + - name: Checkout LFS objects + run: git lfs checkout + + - uses: actions/setup-go@v5 + with: + go-version: '1.21' + + ## Setup a Knative cluster to test the service + - name: Create k8s Kind Cluster + run: bash ./runner/scripts/01-kind.sh + + - name: Install Serving + run: bash ./runner/scripts/02-serving.sh + + - name: Install Kourier + run: bash ./runner/scripts/02-kourier.sh + + - name: Setup domain + run: | + INGRESS_HOST="127.0.0.1" + KNATIVE_DOMAIN=$INGRESS_HOST.sslip.io + kubectl patch configmap -n knative-serving config-domain -p "{\"data\": {\"$KNATIVE_DOMAIN\": \"\"}}" + + ## Test the service + - name: Deploy knative + run: | + kubectl apply -f ${{ env.YAML_DIR }}/kn-${{ matrix.service }}.yaml + + - name: Check if service is ready + run: | + kubectl wait --for=condition=Ready -f ${{ env.YAML_DIR }}/kn-${{ matrix.service }}.yaml --timeout 120s + kubectl get service + kubectl get -f ${{ env.YAML_DIR }}/kn-${{ matrix.service }}.yaml + + - name: Test invoking once + working-directory: tools/test-client + run: | + set -x + go build ./test-client.go + + NODEPORT=80 + url=$(kubectl get kservice ${{ matrix.service }} | awk '$2 ~ /http/ {sub(/http\:\/\//,""); print $2}') + + ./test-client --addr $url:$NODEPORT --name "Example text for CI" + + - name: Print logs + if: ${{ always() }} + run: | + set -x + container_list=$(kubectl get pods -n default -o jsonpath="{.items[*].spec.containers[*].name}") + for container_name in $container_list + do + kubectl logs -n default -c $container_name -l serving.knative.dev/service=${{ matrix.service }} + done + + - name: Down + if: ${{ always() }} + run: | + kubectl delete -f ${{ env.YAML_DIR }}/kn-${{ matrix.service }}.yaml --namespace default --wait diff --git a/.github/workflows/e2e-video-analytics-standalone.yml b/.github/workflows/e2e-video-analytics-standalone.yml new file mode 100644 index 00000000..c2127a67 --- /dev/null +++ b/.github/workflows/e2e-video-analytics-standalone.yml @@ -0,0 +1,201 @@ +name: Video Analytics Standalone End-to-End Tests + +on: + workflow_dispatch: + schedule: + - cron: "0 9 * * 1" + push: + branches: [main] + paths: + - "benchmarks/video-analytics-standalone/**" + - "utils/**" + - "tools/**" + - "runner/**" + + pull_request: + branches: [main] + paths: + - "benchmarks/video-analytics-standalone/**" + - "utils/**" + - "tools/**" + - "runner/**" + +env: + GOOS: linux + GO111MODULE: on + PORT: 50051 + PLATFORMS: linux/amd64,linux/arm64 + +jobs: + build-and-push: + name: Build and push all images + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + include: + - service: video-analytics-standalone-init-database + target: databaseInit + - service: video-analytics-standalone-python + target: videoAnalyticsStandalonePython + + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v4 + with: + lfs: "true" + + - uses: actions/setup-go@v5 + with: + go-version: '1.21' + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push + env: + GOPRIVATE_KEY: ${{ secrets.XDT_REPO_ACCESS_KEY }} + uses: docker/build-push-action@v5 + with: + push: true + file: benchmarks/video-analytics-standalone/docker/Dockerfile + platforms: ${{ env.PLATFORMS }} + target: ${{ matrix.target }} + tags: vhiveease/${{ matrix.service }}:latest + context: . + + test-compose: + name: Test Docker Compose + needs: build-and-push + env: + YAML_DIR: benchmarks/video-analytics-standalone/yamls/docker-compose/ + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + service: + [ + video-analytics-standalone-python + ] + + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v4 + with: + lfs: "true" + + - name: start docker-compose benchmark + run: | + docker-compose -f ${{ env.YAML_DIR }}/dc-${{ matrix.service }}.yaml pull + docker-compose -f ${{ env.YAML_DIR }}/dc-${{ matrix.service }}.yaml up &> log_file & + sleep 60s + cat log_file + + - name: invoke the chain + run: | + ./tools/bin/grpcurl -plaintext localhost:50000 helloworld.Greeter.SayHello + + - name: show docker-compose log + run: cat log_file + + test-knative: + name: Test Knative Deployment + needs: build-and-push + env: + KIND_VERSION: v0.14.0 + K8S_VERSION: v1.23 + YAML_DIR: benchmarks/video-analytics-standalone/yamls/knative/ + + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + service: + [ + video-analytics-standalone-python + ] + steps: + - uses: actions/checkout@v4 + with: + lfs: "true" + - name: Checkout LFS objects + run: git lfs checkout + + - uses: actions/setup-go@v5 + with: + go-version: '1.21' + + ## Setup a Knative cluster to test the service + - name: Create k8s Kind Cluster + run: bash ./runner/scripts/01-kind.sh + + - name: Install Serving + run: bash ./runner/scripts/02-serving.sh + + - name: Install Kourier + run: bash ./runner/scripts/02-kourier.sh + + - name: Setup domain + run: | + INGRESS_HOST="127.0.0.1" + KNATIVE_DOMAIN=$INGRESS_HOST.sslip.io + kubectl patch configmap -n knative-serving config-domain -p "{\"data\": {\"$KNATIVE_DOMAIN\": \"\"}}" + + ## Test the service + - name: Deploy database + working-directory: benchmarks/video-analytics-standalone/yamls/knative/ + run: | + kubectl apply -f video-analytics-standalone-database.yaml + + ## Test the service + - name: Deploy knative + run: | + kubectl apply -f ${{ env.YAML_DIR }}/kn-${{ matrix.service }}.yaml + + - name: Check if service is ready + run: | + kubectl wait --for=condition=Ready -f ${{ env.YAML_DIR }}/kn-${{ matrix.service }}.yaml --timeout 120s + kubectl get service + kubectl get -f ${{ env.YAML_DIR }}/kn-${{ matrix.service }}.yaml + + - name: Test invoking once + working-directory: tools/test-client + run: | + set -x + go build ./test-client.go + + NODEPORT=80 + url=$(kubectl get kservice ${{ matrix.service }} | awk '$2 ~ /http/ {sub(/http\:\/\//,""); print $2}') + + ./test-client --addr $url:$NODEPORT --name "Example text for CI" + + - name: Print logs + if: ${{ always() }} + run: | + set -x + container_list=$(kubectl get pods -n default -o jsonpath="{.items[*].spec.containers[*].name}") + for container_name in $container_list + do + kubectl logs -n default -c $container_name -l serving.knative.dev/service=${{ matrix.service }} + done + + - name: Print logs from database + if: ${{ always() }} + run: | + set -x + kubectl logs deployment/video-analytics-standalone-database + + - name: Down + if: ${{ always() }} + run: | + kubectl delete -f ${{ env.YAML_DIR }}/kn-${{ matrix.service }}.yaml --namespace default --wait diff --git a/.github/workflows/e2e-video-processing.yml b/.github/workflows/e2e-video-processing.yml new file mode 100644 index 00000000..85d38eb5 --- /dev/null +++ b/.github/workflows/e2e-video-processing.yml @@ -0,0 +1,201 @@ +name: Video Processing End-to-End Tests + +on: + workflow_dispatch: + schedule: + - cron: "0 9 * * 1" + push: + branches: [main] + paths: + - "benchmarks/video-processing/**" + - "utils/**" + - "tools/**" + - "runner/**" + + pull_request: + branches: [main] + paths: + - "benchmarks/video-processing/**" + - "utils/**" + - "tools/**" + - "runner/**" + +env: + GOOS: linux + GO111MODULE: on + PORT: 50051 + PLATFORMS: linux/amd64,linux/arm64 + +jobs: + build-and-push: + name: Build and push all images + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + include: + - service: video-processing-init-database + target: databaseInit + - service: video-processing-python + target: videoProcessingPython + + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v4 + with: + lfs: "true" + + - uses: actions/setup-go@v5 + with: + go-version: '1.21' + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push + env: + GOPRIVATE_KEY: ${{ secrets.XDT_REPO_ACCESS_KEY }} + uses: docker/build-push-action@v5 + with: + push: true + file: benchmarks/video-processing/docker/Dockerfile + platforms: ${{ env.PLATFORMS }} + target: ${{ matrix.target }} + tags: vhiveease/${{ matrix.service }}:latest + context: . + + test-compose: + name: Test Docker Compose + needs: build-and-push + env: + YAML_DIR: benchmarks/video-processing/yamls/docker-compose/ + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + service: + [ + video-processing-python + ] + + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v4 + with: + lfs: "true" + + - name: start docker-compose benchmark + run: | + docker-compose -f ${{ env.YAML_DIR }}/dc-${{ matrix.service }}.yaml pull + docker-compose -f ${{ env.YAML_DIR }}/dc-${{ matrix.service }}.yaml up &> log_file & + sleep 60s + cat log_file + + - name: invoke the chain + run: | + ./tools/bin/grpcurl -plaintext localhost:50000 helloworld.Greeter.SayHello + + - name: show docker-compose log + run: cat log_file + + test-knative: + name: Test Knative Deployment + needs: build-and-push + env: + KIND_VERSION: v0.14.0 + K8S_VERSION: v1.23 + YAML_DIR: benchmarks/video-processing/yamls/knative/ + + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + service: + [ + video-processing-python + ] + steps: + - uses: actions/checkout@v4 + with: + lfs: "true" + - name: Checkout LFS objects + run: git lfs checkout + + - uses: actions/setup-go@v5 + with: + go-version: '1.21' + + ## Setup a Knative cluster to test the service + - name: Create k8s Kind Cluster + run: bash ./runner/scripts/01-kind.sh + + - name: Install Serving + run: bash ./runner/scripts/02-serving.sh + + - name: Install Kourier + run: bash ./runner/scripts/02-kourier.sh + + - name: Setup domain + run: | + INGRESS_HOST="127.0.0.1" + KNATIVE_DOMAIN=$INGRESS_HOST.sslip.io + kubectl patch configmap -n knative-serving config-domain -p "{\"data\": {\"$KNATIVE_DOMAIN\": \"\"}}" + + ## Test the service + - name: Deploy database + working-directory: benchmarks/video-processing/yamls/knative/ + run: | + kubectl apply -f video-processing-database.yaml + + ## Test the service + - name: Deploy knative + run: | + kubectl apply -f ${{ env.YAML_DIR }}/kn-${{ matrix.service }}.yaml + + - name: Check if service is ready + run: | + kubectl wait --for=condition=Ready -f ${{ env.YAML_DIR }}/kn-${{ matrix.service }}.yaml --timeout 120s + kubectl get service + kubectl get -f ${{ env.YAML_DIR }}/kn-${{ matrix.service }}.yaml + + - name: Test invoking once + working-directory: tools/test-client + run: | + set -x + go build ./test-client.go + + NODEPORT=80 + url=$(kubectl get kservice ${{ matrix.service }} | awk '$2 ~ /http/ {sub(/http\:\/\//,""); print $2}') + + ./test-client --addr $url:$NODEPORT --name "Example text for CI" + + - name: Print logs + if: ${{ always() }} + run: | + set -x + container_list=$(kubectl get pods -n default -o jsonpath="{.items[*].spec.containers[*].name}") + for container_name in $container_list + do + kubectl logs -n default -c $container_name -l serving.knative.dev/service=${{ matrix.service }} + done + + - name: Print logs from database + if: ${{ always() }} + run: | + set -x + kubectl logs deployment/video-processing-database + + - name: Down + if: ${{ always() }} + run: | + kubectl delete -f ${{ env.YAML_DIR }}/kn-${{ matrix.service }}.yaml --namespace default --wait