Skip to content

Commit

Permalink
Update continuous-benchmarking-teardown.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
kavi-99 authored Jul 25, 2024
1 parent eb04ad1 commit 6ab57af
Showing 1 changed file with 106 additions and 106 deletions.
212 changes: 106 additions & 106 deletions .github/workflows/continuous-benchmarking-teardown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,56 +6,56 @@ on:
- cron: "0 0 * * 3"

jobs:
# teardown-aws-vm:
# runs-on: ubuntu-latest
# env:
# AWS_RUNNER_NAME: stellar-continuous-aws
# steps:
# - uses: actions/checkout@v4

# - 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-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
# aws-region: us-west-1

# - name: Get self-hosted runner ID
# id: get-runner-id
# env:
# GH_TOKEN: ${{ secrets.DEPLOY_SELF_HOSTED_RUNNER_TOKEN_TEST }}
# run: |
# gh api \
# -H "Accept: application/vnd.github+json" \
# -H "X-GitHub-Api-Version: 2022-11-28" \
# /repos/vhive-serverless/STeLLAR/actions/runners \
# | echo id=$(jq '.runners[] | select(.name == "${{ env.AWS_RUNNER_NAME }}") | .id') > $GITHUB_OUTPUT

# response=$(gh api \
# -H "Accept: application/vnd.github+json" \
# -H "X-GitHub-Api-Version: 2022-11-28" \
# /repos/vhive-serverless/STeLLAR/actions/runners)
teardown-aws-vm:
runs-on: ubuntu-latest
env:
AWS_RUNNER_NAME: stellar-continuous-aws
steps:
- uses: actions/checkout@v4

- 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-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
aws-region: us-west-1

- name: Get self-hosted runner ID
id: get-runner-id
env:
GH_TOKEN: ${{ secrets.DEPLOY_SELF_HOSTED_RUNNER_TOKEN_TEST }}
run: |
gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/vhive-serverless/STeLLAR/actions/runners \
| echo id=$(jq '.runners[] | select(.name == "${{ env.AWS_RUNNER_NAME }}") | .id') > $GITHUB_OUTPUT
response=$(gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/vhive-serverless/STeLLAR/actions/runners)
# echo "$response"

# - name: Remove self-hosted runner
# env:
# GH_TOKEN: ${{ secrets.DEPLOY_SELF_HOSTED_RUNNER_TOKEN_TEST }}
# run: |
# gh api \
# --method DELETE \
# -H "Accept: application/vnd.github+json" \
# -H "X-GitHub-Api-Version: 2022-11-28" \
# /repos/vhive-serverless/STeLLAR/actions/runners/${{ steps.get-runner-id.outputs.id }}

# - name: Get AWS EC2 instance ID
# run: |
# echo id=$(aws ec2 describe-instances --filters "Name=tag:Name,Values=${{ env.AWS_RUNNER_NAME }}" --query "Reservations[*].Instances[*].InstanceId" --output text) > $GITHUB_OUTPUT
# id: get-instance-id

# - name: Terminate AWS EC2 instance
# run: |
# aws ec2 terminate-instances --instance-ids ${{ steps.get-instance-id.outputs.id }}
echo "$response"
- name: Remove self-hosted runner
env:
GH_TOKEN: ${{ secrets.DEPLOY_SELF_HOSTED_RUNNER_TOKEN_TEST }}
run: |
gh api \
--method DELETE \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/vhive-serverless/STeLLAR/actions/runners/${{ steps.get-runner-id.outputs.id }}
- name: Get AWS EC2 instance ID
run: |
echo id=$(aws ec2 describe-instances --filters "Name=tag:Name,Values=${{ env.AWS_RUNNER_NAME }}" --query "Reservations[*].Instances[*].InstanceId" --output text) > $GITHUB_OUTPUT
id: get-instance-id

# - name: Terminate AWS EC2 instance
# run: |
# aws ec2 terminate-instances --instance-ids ${{ steps.get-instance-id.outputs.id }}

# teardown-cloudflare-vm:
# runs-on: ubuntu-latest
Expand Down Expand Up @@ -101,85 +101,85 @@ jobs:
# run: |
# aws ec2 terminate-instances --instance-ids ${{ steps.get-instance-id.outputs.id }}

teardown-azure-vm:
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@v4

- name: Setup Azure CLI
uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS_TEST }}

- name: Get self-hosted runner ID
id: get-runner-id
env:
GH_TOKEN: ${{ secrets.DEPLOY_SELF_HOSTED_RUNNER_TOKEN }}
run: |
gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/vhive-serverless/STeLLAR/actions/runners \
| echo id=$(jq '.runners[] | select(.name == "stellar-continuous-azure") | .id') > $GITHUB_OUTPUT
- name: Remove self-hosted runner
env:
GH_TOKEN: ${{ secrets.DEPLOY_SELF_HOSTED_RUNNER_TOKEN }}
run: |
gh api \
--method DELETE \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/vhive-serverless/STeLLAR/actions/runners/${{ steps.get-runner-id.outputs.id }}
- name: Delete Azure resource group
run: az group delete --resource-group github-actions-runners --yes

# teardown-gcr-vm:
# teardown-azure-vm:
# runs-on: ubuntu-latest
# permissions: write-all
# steps:
# - uses: actions/checkout@v4

# - id: auth
# name: Configure GCR credentials
# uses: google-github-actions/auth@v1
# - name: Setup Azure CLI
# uses: azure/login@v2
# with:
# credentials_json: ${{ secrets.GCR_CREDENTIALS }}

# - name: Set up gcloud
# uses: google-github-actions/setup-gcloud@v1
# with:
# version: ">= 363.0.0"
# creds: ${{ secrets.AZURE_CREDENTIALS_TEST }}

# - name: Get self-hosted runner ID
# id: get-runner-id
# env:
# GH_TOKEN: ${{ secrets.DEPLOY_SELF_HOSTED_RUNNER_TOKEN_TEST }}
# GH_TOKEN: ${{ secrets.DEPLOY_SELF_HOSTED_RUNNER_TOKEN }}
# run: |
# gh api \
# -H "Accept: application/vnd.github+json" \
# -H "X-GitHub-Api-Version: 2022-11-28" \
# /repos/vhive-serverless/STeLLAR/actions/runners \
# | echo id=$(jq '.runners[] | select(.name == "stellar-continuous-gcr") | .id') > $GITHUB_OUTPUT

# response=$(gh api \
# -H "Accept: application/vnd.github+json" \
# -H "X-GitHub-Api-Version: 2022-11-28" \
# /repos/vhive-serverless/STeLLAR/actions/runners)

# echo "$response"
# | echo id=$(jq '.runners[] | select(.name == "stellar-continuous-azure") | .id') > $GITHUB_OUTPUT

# - name: Remove self-hosted runner
# env:
# GH_TOKEN: ${{ secrets.DEPLOY_SELF_HOSTED_RUNNER_TOKEN_TEST }}
# GH_TOKEN: ${{ secrets.DEPLOY_SELF_HOSTED_RUNNER_TOKEN }}
# run: |
# gh api \
# --method DELETE \
# -H "Accept: application/vnd.github+json" \
# -H "X-GitHub-Api-Version: 2022-11-28" \
# /repos/vhive-serverless/STeLLAR/actions/runners/${{ steps.get-runner-id.outputs.id }}

# - name: Delete GCloud Compute Engine VM
# run: gcloud compute instances delete github-actions-runner-gcr --zone=us-west1-a
# - name: Delete Azure resource group
# run: az group delete --resource-group github-actions-runners --yes

# # teardown-gcr-vm:
# # runs-on: ubuntu-latest
# # permissions: write-all
# # steps:
# # - uses: actions/checkout@v4

# # - id: auth
# # name: Configure GCR credentials
# # uses: google-github-actions/auth@v1
# # with:
# # credentials_json: ${{ secrets.GCR_CREDENTIALS }}

# # - name: Set up gcloud
# # uses: google-github-actions/setup-gcloud@v1
# # with:
# # version: ">= 363.0.0"

# # - name: Get self-hosted runner ID
# # id: get-runner-id
# # env:
# # GH_TOKEN: ${{ secrets.DEPLOY_SELF_HOSTED_RUNNER_TOKEN_TEST }}
# # run: |
# # gh api \
# # -H "Accept: application/vnd.github+json" \
# # -H "X-GitHub-Api-Version: 2022-11-28" \
# # /repos/vhive-serverless/STeLLAR/actions/runners \
# # | echo id=$(jq '.runners[] | select(.name == "stellar-continuous-gcr") | .id') > $GITHUB_OUTPUT

# # response=$(gh api \
# # -H "Accept: application/vnd.github+json" \
# # -H "X-GitHub-Api-Version: 2022-11-28" \
# # /repos/vhive-serverless/STeLLAR/actions/runners)

# # echo "$response"

# # - name: Remove self-hosted runner
# # env:
# # GH_TOKEN: ${{ secrets.DEPLOY_SELF_HOSTED_RUNNER_TOKEN_TEST }}
# # run: |
# # gh api \
# # --method DELETE \
# # -H "Accept: application/vnd.github+json" \
# # -H "X-GitHub-Api-Version: 2022-11-28" \
# # /repos/vhive-serverless/STeLLAR/actions/runners/${{ steps.get-runner-id.outputs.id }}

# # - name: Delete GCloud Compute Engine VM
# # run: gcloud compute instances delete github-actions-runner-gcr --zone=us-west1-a

0 comments on commit 6ab57af

Please sign in to comment.