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

Commit

Permalink
Group2 add new workflows (#5)
Browse files Browse the repository at this point in the history
* add multi instance server workflow

* fix typo

* add node ip env var

* correctly stop runner

* test workflow

* typo

* add local request benchmark

* setup ec2 instance concurrently

* typo

* wait for all server to start benchmark

* start servers after all ec2 created

* update local request workflow

* fix working dir

* test workflow trigger

* fix working dir

* fix working dir

* using main branch of istziio and log server

* fix ip to 127.0.0.1 for local request workflow

* add http protocol in url

* fix typo

* update main to run two trace

* can build table file map from hardcoded list

* use real trace

* discard 10m traces

---------

Co-authored-by: Shuning Lin <[email protected]>
Co-authored-by: Ubuntu <[email protected]>
  • Loading branch information
3 people authored May 1, 2024
1 parent a1b0841 commit d4a57d9
Show file tree
Hide file tree
Showing 8 changed files with 531 additions and 44 deletions.
56 changes: 36 additions & 20 deletions .github/workflows/benchmark_group_2.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
name: benchmark-group-2
on: [pull_request, push]

jobs:
start-runner:
start-benchmark-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 }}
benchmark-label: ${{ steps.start-benchmark-ec2-runner.outputs.label }}
benchmark-ec2-instance-id: ${{ steps.start-benchmark-ec2-runner.outputs.ec2-instance-id }}
steps:
Expand All @@ -17,8 +15,8 @@ jobs:
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
- name: Start Benchmark EC2 runner
id: start-benchmark-ec2-runner
uses: machulav/ec2-github-runner@v2
with:
mode: start
Expand All @@ -27,8 +25,22 @@ jobs:
ec2-instance-type: c5.xlarge
subnet-id: subnet-0f0b102aeba4b75f7
security-group-id: sg-01dbe69e3eaf89995
- name: Start Benchmark EC2 runner
id: start-benchmark-ec2-runner
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
Expand All @@ -46,19 +58,19 @@ jobs:
>> $GITHUB_OUTPUT
run-server:
name: Start the ISTZIIO server
needs: start-runner # required to start the main job when the runner is ready
runs-on: ${{ needs.start-runner.outputs.server-label }} # run the job on the newly created runner
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-runner.outputs.private-ip }}
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: benchmark
ref: main
- name: Build Server
run: |
cargo build --bin istziio_server_node
Expand All @@ -70,13 +82,16 @@ jobs:
cat ${{ github.workspace }}/logs/app_6379.log
- name: spin
run: sleep 60
- name: Server shut down and log
run: cat ${{ github.workspace }}/logs/app_6379.log
run-benchmark:
name: Run Benchmark
needs:
- start-runner
runs-on: ${{ needs.start-runner.outputs.benchmark-label }} # run the job on the newly created runner
- 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-runner.outputs.private-ip }}:26379
SERVER_URL: http://${{ needs.start-server-runner.outputs.private-ip }}:26379
steps:
- name: Clone Server
uses: actions/checkout@v4
Expand All @@ -93,7 +108,8 @@ jobs:
stop-runner:
name: Stop self-hosted EC2 runner
needs:
- start-runner # required to get output from the start-runner job
- 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
Expand All @@ -110,13 +126,13 @@ jobs:
with:
mode: stop
github-token: ${{ secrets.GROUP_2_GH_PERSONAL_ACCESS_TOKEN }}
label: ${{ needs.start-runner.outputs.server-label }}
ec2-instance-id: ${{ needs.start-runner.outputs.server-ec2-instance-id }}
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-runner.outputs.benchmark-label }}
ec2-instance-id: ${{ needs.start-runner.outputs.benchmark-ec2-instance-id }}
label: ${{ needs.start-benchmark-runner.outputs.benchmark-label }}
ec2-instance-id: ${{ needs.start-benchmark-runner.outputs.benchmark-ec2-instance-id }}

97 changes: 97 additions & 0 deletions .github/workflows/benchmark_group_2_local_client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: benchmark-group-2-local-client
on: [pull_request, push]

jobs:
start-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-runner # required to start the main job when the runner is ready
runs-on: ${{ needs.start-runner.outputs.server-label }} # run the job on the newly created runner
env:
SERVER_ROOT: ${{ github.workspace }}/istziio/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: 127.0.0.1
SERVER_URL: http://127.0.0.1:26379
steps:
- name: Clone Server
uses: actions/checkout@v4
with:
path: 'istziio'
repository: cmu-db/15721-s24-cache2
ref: main
- name: Build Server
working-directory: ${{ github.workspace }}/istziio
run: |
cargo build --bin istziio_server_node
- name: Clone benchmark
uses: actions/checkout@v4
with:
path: 'benchmark'
- name: Build Benchmark driver
working-directory: ${{ github.workspace }}/benchmark
run: cargo build
- name: start server nodes
working-directory: ${{ github.workspace }}/istziio
run: server/run.sh
- name: wait for server completing setups
run: |
sleep 5
cat ${{ github.workspace }}/istziio/logs/app_6379.log
- name: Run Benchmark
working-directory: ${{ github.workspace }}/benchmark
run: cargo run
- name: Server shut down and log
run: cat ${{ github.workspace }}/istziio/logs/app_6379.log
stop-runner:
name: Stop self-hosted EC2 runner
needs:
- start-runner # required to get output from the start-runner job
- run-server # required to wait when the main job is done
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-runner.outputs.server-label }}
ec2-instance-id: ${{ needs.start-runner.outputs.server-ec2-instance-id }}

Loading

0 comments on commit d4a57d9

Please sign in to comment.