Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

dump client to 0.2.4 #100

dump client to 0.2.4

dump client to 0.2.4 #100

name: benchmark-group-2
on: [pull_request, push]
jobs:
start-benchmark-runner:
name: Start self-hosted EC2 runner
runs-on: ubuntu-latest
outputs:
benchmark-label: ${{ steps.start-benchmark-ec2-runner.outputs.label }}
benchmark-ec2-instance-id: ${{ steps.start-benchmark-ec2-runner.outputs.ec2-instance-id }}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.GROUP_2_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.GROUP_2_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
- name: Start Benchmark EC2 runner
id: start-benchmark-ec2-runner
uses: machulav/ec2-github-runner@v2
with:
mode: start
github-token: ${{ secrets.GROUP_2_GH_PERSONAL_ACCESS_TOKEN }}
ec2-image-id: ami-0a1fee7d1926e55ce
ec2-instance-type: c5.xlarge
subnet-id: subnet-0f0b102aeba4b75f7
security-group-id: sg-01dbe69e3eaf89995
start-server-runner:
name: Start self-hosted EC2 runner
runs-on: ubuntu-latest
outputs:
server-label: ${{ steps.start-server-ec2-runner.outputs.label }}
server-ec2-instance-id: ${{ steps.start-server-ec2-runner.outputs.ec2-instance-id }}
private-ip: ${{ steps.get-private-ip.outputs.private-ip }}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.GROUP_2_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.GROUP_2_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
- name: Start Server EC2 runner
id: start-server-ec2-runner
uses: machulav/ec2-github-runner@v2
with:
mode: start
github-token: ${{ secrets.GROUP_2_GH_PERSONAL_ACCESS_TOKEN }}
ec2-image-id: ami-0a1fee7d1926e55ce
ec2-instance-type: c5.xlarge
subnet-id: subnet-0f0b102aeba4b75f7
security-group-id: sg-01dbe69e3eaf89995
- name: Get private IP address
id: get-private-ip
run: |
echo "private-ip=$(aws ec2 describe-instances \
--instance-id ${{ steps.start-server-ec2-runner.outputs.ec2-instance-id }} \
--query 'Reservations[0].Instances[0].PrivateIpAddress' | tr -d '"')" \
>> $GITHUB_OUTPUT
run-server:
name: Start the ISTZIIO server
needs: start-server-runner # required to start the main job when the runner is ready
runs-on: ${{ needs.start-server-runner.outputs.server-label }} # run the job on the newly created runner
env:
SERVER_ROOT: ${{ github.workspace }}/server
AWS_ACCESS_KEY_ID: ${{ secrets.GROUP_2_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.GROUP_2_AWS_SECRET_ACCESS_KEY }}
SERVER_IP: ${{ needs.start-server-runner.outputs.private-ip }}
steps:
- name: Clone Server
uses: actions/checkout@v4
with:
repository: cmu-db/15721-s24-cache2
ref: main
- name: Build Server
run: |
cargo build --bin istziio_server_node
- name: start server nodes
run: ${{ github.workspace }}/server/run.sh
- name: wait for server completing setups
run: |
sleep 5
cat ${{ github.workspace }}/logs/app_6379.log
- name: spin
run: sleep 120
- name: Server shut down and log
run: cat ${{ github.workspace }}/logs/app_6379.log
run-benchmark:
name: Run Benchmark
needs:
- start-server-runner
- start-benchmark-runner
runs-on: ${{ needs.start-benchmark-runner.outputs.benchmark-label }} # run the job on the newly created runner
env:
SERVER_URL: http://${{ needs.start-server-runner.outputs.private-ip }}:26379
SERVER_1_URL: http://${{ needs.start-server-runner.outputs.private-ip }}:26379
SERVER_2_URL: http://${{ needs.start-server-runner.outputs.private-ip }}:26380
SERVER_3_URL: http://${{ needs.start-server-runner.outputs.private-ip }}:26381
steps:
- name: Clone Server
uses: actions/checkout@v4
- name: Build Benchmark driver
run: cargo build
- name: Wait for server
run: |
until curl --output /dev/null --silent --head --fail $SERVER_URL/; do
printf '.'
sleep 5
done
- name: Run Benchmark
run: cargo run
stop-runner:
name: Stop self-hosted EC2 runner
needs:
- start-server-runner
- start-benchmark-runner # required to get output from the start-server-runner job
- run-server # required to wait when the main job is done
- run-benchmark
runs-on: ubuntu-latest
if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.GROUP_2_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.GROUP_2_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
- name: Stop Server EC2 runner
uses: machulav/ec2-github-runner@v2
with:
mode: stop
github-token: ${{ secrets.GROUP_2_GH_PERSONAL_ACCESS_TOKEN }}
label: ${{ needs.start-server-runner.outputs.server-label }}
ec2-instance-id: ${{ needs.start-server-runner.outputs.server-ec2-instance-id }}
- name: Stop Benchmark EC2 runner
uses: machulav/ec2-github-runner@v2
with:
mode: stop
github-token: ${{ secrets.GROUP_2_GH_PERSONAL_ACCESS_TOKEN }}
label: ${{ needs.start-benchmark-runner.outputs.benchmark-label }}
ec2-instance-id: ${{ needs.start-benchmark-runner.outputs.benchmark-ec2-instance-id }}