Skip to content

GG fibonacci End-to-End Tests #183

GG fibonacci End-to-End Tests

GG fibonacci End-to-End Tests #183

# MIT License
#
# Copyright (c) 2021 Michal Baczun and EASE lab
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
name: GG fibonacci End-to-End Tests
on:
workflow_dispatch:
schedule:
- cron: '0 9 * * 1'
push:
branches: [ main ]
paths:
- 'benchmarks/gg/*'
pull_request:
branches: [ main ]
paths:
- 'benchmarks/gg/*'
env:
GOOS: linux
GO111MODULE: on
KUBECONFIG: /etc/kubernetes/admin.conf
jobs:
build-and-push:
name: Build and Push all images
runs-on: ubuntu-20.04
strategy:
fail-fast: false
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
lfs: 'true'
- 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 Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- run: chmod +x ./benchmarks/gg/docker_build.sh
- run: chmod +x ./benchmarks/gg/benchmarks/setup_gg.sh
- name: Build and Push executor
working-directory: benchmarks/gg
env:
GOPRIVATE_KEY: ${{ secrets.XDT_REPO_ACCESS_KEY }}
run: sudo make gg-image-push
- name: Build and Push driver
working-directory: benchmarks/gg/benchmarks
env:
GOPRIVATE_KEY: ${{ secrets.XDT_REPO_ACCESS_KEY }}
run: make gg-driver-fibonacci-image-push
test-knative:
name: Test Knative Deployment
needs: build-and-push
env:
GOCACHE: /root/tmp/gocache
GOPATH: /root/tmp/gopath
runs-on: [stock-knative]
strategy:
fail-fast: false
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'
- name: Deploy executor function
working-directory: benchmarks
env:
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
run: ../tools/kn_deploy.sh ./gg/gg_framework.yaml
- name: Deploy driver function
working-directory: benchmarks
env:
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
run: ../tools/kn_deploy.sh ./gg/benchmarks/service-driver-fibonacci.yaml
- name: Test
working-directory: tools/test-client
run: |
set -x
NODEPORT=$(kubectl get svc kourier-ingress -n kourier-system -o=jsonpath='{.spec.ports[0].nodePort}')
HOSTNAME=$(kubectl get ksvc gg-driver-fibonacci -n default -o jsonpath='{.status.url}' | cut -c8-)
go build ./test-client.go
./test-client -addr $HOSTNAME:$NODEPORT
- name: Print logs
if: ${{ always() }}
run: |
set -x
kubectl logs -n default -c user-container -l serving.knative.dev/service=gg-port-0
kubectl logs -n default -c user-container -l serving.knative.dev/service=gg-driver-fibonacci
- name: Down
if: ${{ always() }}
run: kn service delete --all --namespace default --wait