Corral (word count) Benchmark #330
This file contains 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
# MIT License | |
# | |
# Copyright (c) 2021 Mert Bora Alper 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: Corral (word count) Benchmark | |
# > Concurrency ensures that only a single job or workflow using the | |
# > same concurrency group will run at a time. | |
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency | |
# | |
# Since we are using Docker Hub for our images, this helps us prevent | |
# concurrency bugs related to using the same image:tag across different | |
# CI pipelines. | |
concurrency: word_count | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 9 * * 1' | |
push: | |
branches: [ main ] | |
paths: | |
- 'benchmarks/corral/*' | |
- 'utils/*' | |
pull_request: | |
branches: [ main ] | |
paths: | |
- 'benchmarks/corral/*' | |
- 'utils/*' | |
env: | |
GOOS: linux | |
GO111MODULE: on | |
KUBECONFIG: /etc/kubernetes/admin.conf | |
jobs: | |
push: | |
name: Push Docker Image | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- uses: docker/setup-buildx-action@v3 | |
- uses: docker/build-push-action@v6 | |
with: | |
file: benchmarks/corral/Dockerfile | |
push: true | |
tags: vhiveease/word_count:volatile | |
test: | |
name: Test | |
needs: push | |
env: | |
GOCACHE: /root/tmp/gocache | |
GOPATH: /root/tmp/gopath | |
TMPDIR: /root/tmp | |
runs-on: [stock-knative] | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Setup TMPDIR | |
run: mkdir -p $TMPDIR | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Checkout LFS objects | |
run: git lfs checkout | |
- name: Configure AWS credentials using EASE lab account | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} | |
aws-region: us-west-1 | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} | |
- name: Install AWS CLI | |
shell: bash | |
run: | | |
set -x | |
if ! command -v aws &> /dev/null | |
then | |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" | |
unzip -qq awscliv2.zip | |
sudo ./aws/install | |
fi | |
- name: Apply | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }} | |
working-directory: benchmarks/corral/knative_yamls | |
run: | | |
set -x | |
kn service apply --wait-timeout 60 --filename worker.yml --env AWS_REGION=us-west-1 --env AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" --env AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" || { kubectl describe ksvc/word-count-worker; exit 1; } | |
kn service apply --wait-timeout 60 --filename driver.yml --env AWS_REGION=us-west-1 --env AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" --env AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" || { kubectl describe ksvc/word-count-driver; exit 1; } | |
- name: Test | |
run: ./tools/bin/grpcurl -max-time 180 -plaintext word-count-driver.default.127.0.0.1.nip.io:31080 helloworld.Greeter.SayHello | |
- name: Print logs | |
if: ${{ always() }} | |
run: | | |
set -x | |
kubectl logs -c user-container -l serving.knative.dev/service=word-count-worker | |
kubectl logs -c user-container -l serving.knative.dev/service=word-count-driver | |
- name: Verify | |
working-directory: benchmarks/corral | |
run: | | |
aws s3 cp s3://vhive-corral-bench/word_count/vhive-ubench/out/output-part-0 - | LC_ALL=C sort - | cmp expected-sorted-output.txt - | |
- name: Cleaning | |
if: ${{ always() }} | |
run: | | |
kn service delete --all --namespace default --wait | |
- name: Clean up S3 | |
if: ${{ always() }} | |
run: | | |
aws s3 rm s3://vhive-corral-bench/word_count/vhive-ubench/out --recursive |