|
| 1 | +name: Graph BFS End-to-End Tests |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + schedule: |
| 6 | + - cron: "0 9 * * 1" |
| 7 | + push: |
| 8 | + branches: [main] |
| 9 | + paths: |
| 10 | + - "benchmarks/graph-bfs/**" |
| 11 | + - "utils/**" |
| 12 | + - "tools/**" |
| 13 | + - "runner/**" |
| 14 | + |
| 15 | + pull_request: |
| 16 | + branches: [main] |
| 17 | + paths: |
| 18 | + - "benchmarks/graph-bfs/**" |
| 19 | + - "utils/**" |
| 20 | + - "tools/**" |
| 21 | + - "runner/**" |
| 22 | + |
| 23 | +env: |
| 24 | + GOOS: linux |
| 25 | + GO111MODULE: on |
| 26 | + PORT: 50051 |
| 27 | + PLATFORMS: linux/amd64,linux/arm64 |
| 28 | + |
| 29 | +jobs: |
| 30 | + build-and-push: |
| 31 | + name: Build and push all images |
| 32 | + runs-on: ubuntu-24.04 |
| 33 | + strategy: |
| 34 | + fail-fast: false |
| 35 | + matrix: |
| 36 | + service: |
| 37 | + [ |
| 38 | + graph-bfs-python |
| 39 | + ] |
| 40 | + steps: |
| 41 | + - name: Check out code into the Go module directory |
| 42 | + uses: actions/checkout@v4 |
| 43 | + with: |
| 44 | + lfs: "true" |
| 45 | + |
| 46 | + - uses: actions/setup-go@v5 |
| 47 | + with: |
| 48 | + go-version: '1.21' |
| 49 | + |
| 50 | + - name: Login to Docker Hub |
| 51 | + uses: docker/login-action@v3 |
| 52 | + with: |
| 53 | + username: ${{ secrets.DOCKER_HUB_USERNAME }} |
| 54 | + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} |
| 55 | + |
| 56 | + - name: Set up QEMU |
| 57 | + uses: docker/setup-qemu-action@v3 |
| 58 | + |
| 59 | + - name: Set up Docker Buildx |
| 60 | + id: buildx |
| 61 | + uses: docker/setup-buildx-action@v3 |
| 62 | + |
| 63 | + - name: Build and push |
| 64 | + env: |
| 65 | + GOPRIVATE_KEY: ${{ secrets.XDT_REPO_ACCESS_KEY }} |
| 66 | + uses: docker/build-push-action@v6 |
| 67 | + with: |
| 68 | + push: true |
| 69 | + file: benchmarks/graph-bfs/Dockerfile |
| 70 | + platforms: ${{ env.PLATFORMS }} |
| 71 | + target: ${{ matrix.target }} |
| 72 | + tags: vhiveease/${{ matrix.service }}:latest |
| 73 | + build-args: SERVICE=${{ matrix.service }} |
| 74 | + context: . |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | + test-compose: |
| 79 | + name: Test Docker Compose |
| 80 | + needs: build-and-push |
| 81 | + env: |
| 82 | + YAML_DIR: benchmarks/graph-bfs/yamls/docker-compose/ |
| 83 | + runs-on: ubuntu-24.04 |
| 84 | + strategy: |
| 85 | + fail-fast: false |
| 86 | + matrix: |
| 87 | + service: |
| 88 | + [ |
| 89 | + graph-bfs-python, |
| 90 | + ] |
| 91 | + |
| 92 | + steps: |
| 93 | + - name: Check out code into the Go module directory |
| 94 | + uses: actions/checkout@v4 |
| 95 | + with: |
| 96 | + lfs: "true" |
| 97 | + |
| 98 | + - name: start docker compose benchmark |
| 99 | + run: | |
| 100 | + docker compose -f ${{ env.YAML_DIR }}/dc-${{ matrix.service }}.yaml pull |
| 101 | + docker compose -f ${{ env.YAML_DIR }}/dc-${{ matrix.service }}.yaml up &> log_file & |
| 102 | + sleep 60s |
| 103 | + cat log_file |
| 104 | +
|
| 105 | + - name: invoke the chain |
| 106 | + run: | |
| 107 | + ./tools/bin/grpcurl -plaintext localhost:50000 helloworld.Greeter.SayHello |
| 108 | +
|
| 109 | + - name: invoke the relay |
| 110 | + working-directory: tools/test-client |
| 111 | + run: | |
| 112 | + go build ./test-client.go |
| 113 | + ./test-client --addr localhost:50000 --name "Example text for CI" |
| 114 | +
|
| 115 | + - name: show docker compose log |
| 116 | + run: cat log_file |
| 117 | + |
| 118 | + test-knative: |
| 119 | + name: Test Knative Deployment |
| 120 | + needs: build-and-push |
| 121 | + env: |
| 122 | + KIND_VERSION: v0.14.0 |
| 123 | + K8S_VERSION: v1.23 |
| 124 | + YAML_DIR: benchmarks/graph-bfs/yamls/knative/ |
| 125 | + |
| 126 | + runs-on: ubuntu-24.04 |
| 127 | + strategy: |
| 128 | + fail-fast: false |
| 129 | + matrix: |
| 130 | + include: |
| 131 | + - service: graph-bfs-python |
| 132 | + file: kn-graph-bfs-python.yaml |
| 133 | + steps: |
| 134 | + - uses: actions/checkout@v4 |
| 135 | + with: |
| 136 | + lfs: "true" |
| 137 | + - name: Checkout LFS objects |
| 138 | + run: git lfs checkout |
| 139 | + |
| 140 | + - uses: actions/setup-go@v5 |
| 141 | + with: |
| 142 | + go-version: '1.21' |
| 143 | + |
| 144 | + ## Setup a Knative cluster to test the service |
| 145 | + - name: Create k8s Kind Cluster |
| 146 | + run: bash ./runner/scripts/01-kind.sh |
| 147 | + |
| 148 | + - name: Install Serving |
| 149 | + run: bash ./runner/scripts/02-serving.sh |
| 150 | + |
| 151 | + - name: Install Kourier |
| 152 | + run: bash ./runner/scripts/02-kourier.sh |
| 153 | + |
| 154 | + - name: Setup domain |
| 155 | + run: | |
| 156 | + INGRESS_HOST="127.0.0.1" |
| 157 | + KNATIVE_DOMAIN=$INGRESS_HOST.sslip.io |
| 158 | + kubectl patch configmap -n knative-serving config-domain -p "{\"data\": {\"$KNATIVE_DOMAIN\": \"\"}}" |
| 159 | +
|
| 160 | + - name: Deploy knative |
| 161 | + run: | |
| 162 | + kubectl apply -f ${{ env.YAML_DIR }}/${{ matrix.file }} |
| 163 | +
|
| 164 | + - name: Check if service is ready |
| 165 | + run: | |
| 166 | + kubectl wait --for=condition=Ready -f ${{ env.YAML_DIR }}/${{ matrix.file }} --timeout 900s |
| 167 | + kubectl get service |
| 168 | + kubectl get -f ${{ env.YAML_DIR }}/${{ matrix.file }} |
| 169 | +
|
| 170 | + - name: Test invoking once |
| 171 | + working-directory: tools/test-client |
| 172 | + run: | |
| 173 | + set -x |
| 174 | + go build ./test-client.go |
| 175 | +
|
| 176 | + NODEPORT=80 |
| 177 | + url=$(kubectl get kservice ${{ matrix.service }} | awk '$2 ~ /http/ {sub(/http\:\/\//,""); print $2}') |
| 178 | +
|
| 179 | + ./test-client --addr $url:$NODEPORT --name "Example text for CI" |
| 180 | +
|
| 181 | +
|
| 182 | + - name: Print logs |
| 183 | + if: ${{ always() }} |
| 184 | + run: | |
| 185 | + set -x |
| 186 | +
|
| 187 | + pod_list=$(kubectl get pods -n default -o jsonpath="{.items[*].name}") |
| 188 | + for pod in $pod_list |
| 189 | + do |
| 190 | + kubectl logs $pod |
| 191 | + done |
| 192 | +
|
| 193 | + - name: Down |
| 194 | + if: ${{ always() }} |
| 195 | + run: | |
| 196 | + kubectl delete -f ${{ env.YAML_DIR }}/${{ matrix.file }} --namespace default --wait |
0 commit comments