Files
concrete/.github/workflows/daily-benchmarks.yaml
dependabot[bot] 9ad4941ee2 chore(deps): bump aws-actions/configure-aws-credentials
Bumps [aws-actions/configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials) from 1.5.11 to 1.6.0.
- [Release notes](https://github.com/aws-actions/configure-aws-credentials/releases)
- [Changelog](https://github.com/aws-actions/configure-aws-credentials/blob/master/CHANGELOG.md)
- [Commits](0d9a5be0dc...ea7b857d8a)

---
updated-dependencies:
- dependency-name: aws-actions/configure-aws-credentials
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-29 09:05:12 +01:00

149 lines
6.8 KiB
YAML

name: Daily Benchmarks
on:
workflow_dispatch:
schedule:
- cron: '0 22 * * *' # Everyday @ 22:00
env:
ACTION_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
jobs:
perform:
name: Run Benchmarks on EC2 and Publish Results to Progress Tracker
runs-on: ubuntu-20.04
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@ea7b857d8a33dc2fb4ef5a724500044281b49a5e
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-3 # Europe (Paris)
- name: Write SSH Key To A File
run: echo "$SSH_KEY" > ~/ssh-key && chmod 400 ~/ssh-key
env:
SSH_KEY: ${{ secrets.BENCHMARKS_EC2_SSH_KEY }}
- name: Start AMD EC2 Instance
run: |
aws ec2 start-instances --instance-ids ${{ secrets.BENCHMARKS_EC2_AMD_INSTANCE_ID }}
- name: Wait For The AMD EC2 Instance To Get An IP Address
run: |
# shellcheck disable=SC2016,2026
timeout 180 bash -c 'until [[ $(aws ec2 describe-instances --instance-ids ${{ secrets.BENCHMARKS_EC2_AMD_INSTANCE_ID }} --query 'Reservations[].Instances[].PublicIpAddress' --output text) != "" ]]; do sleep 0.1; done'
- name: Get Public IP Address of AMD EC2 Instance
id: amd-public-ip
run: echo "::set-output name=value::$(aws ec2 describe-instances --region eu-west-3 --instance-ids ${{ secrets.BENCHMARKS_EC2_AMD_INSTANCE_ID }} --query 'Reservations[].Instances[].PublicIpAddress' --output text)"
- name: Hide Public IP Address of AMD EC2 Instance From GitHub Logs
run: echo "::add-mask::${{ steps.amd-public-ip.outputs.value }}"
- name: Wait For The AMD EC2 Instance To Accept SSH Connections
run: timeout 180 bash -c 'until nc -z ${{ steps.amd-public-ip.outputs.value }} 22; do sleep 0.1; done'
- name: Connect To AMD EC2 Instance, Perform Benchmarks, Publish Results
uses: appleboy/ssh-action@1d1b21ca96111b1eb4c03c21c14ebb971d2200f6
with:
host: ${{ steps.amd-public-ip.outputs.value }}
username: ${{ secrets.BENCHMARKS_EC2_USERNAME }}
key: ${{ secrets.BENCHMARKS_EC2_SSH_KEY }}
command_timeout: 90m
script: |
cd ~/concretefhe-internal
git pull
make docker_publish_measurements
docker system prune -f
- name: Copy AMD EC2 Instance Logs
run: scp -o StrictHostKeyChecking=no -i ~/ssh-key ${{ secrets.BENCHMARKS_EC2_USERNAME }}@${{ steps.amd-public-ip.outputs.value }}:~/concretefhe-internal/logs/latest.log ~/latest.log
- name: Copy AMD EC2 Instance Logs
run: scp -o StrictHostKeyChecking=no -i ~/ssh-key ${{ secrets.BENCHMARKS_EC2_USERNAME }}@${{ steps.amd-public-ip.outputs.value }}:~/concretefhe-internal/.benchmarks/findings.json ~/findings.json
- name: Stop AMD EC2 Instance
if: ${{ always() }}
run: |
aws ec2 stop-instances --instance-ids ${{ secrets.BENCHMARKS_EC2_AMD_INSTANCE_ID }}
- name: Upload Logs of AMD EC2 Instance
uses: actions/upload-artifact@27121b0bdffd731efa15d66772be8dc71245d074
with:
name: amd-logs
path: ~/latest.log
- name: Upload Findings of AMD EC2 Instance
uses: actions/upload-artifact@27121b0bdffd731efa15d66772be8dc71245d074
with:
name: amd-findings
path: ~/findings.json
- name: Start Intel EC2 Instance
run: |
aws ec2 start-instances --instance-ids ${{ secrets.BENCHMARKS_EC2_INTEL_INSTANCE_ID }}
- name: Wait For The Intel EC2 Instance To Get An IP Address
run: |
# shellcheck disable=SC2016,2026
timeout 180 bash -c 'until [[ $(aws ec2 describe-instances --instance-ids ${{ secrets.BENCHMARKS_EC2_INTEL_INSTANCE_ID }} --query 'Reservations[].Instances[].PublicIpAddress' --output text) != "" ]]; do sleep 0.1; done'
- name: Get Public IP Address of Intel EC2 Instance
id: intel-public-ip
run: echo "::set-output name=value::$(aws ec2 describe-instances --region eu-west-3 --instance-ids ${{ secrets.BENCHMARKS_EC2_INTEL_INSTANCE_ID }} --query 'Reservations[].Instances[].PublicIpAddress' --output text)"
- name: Hide Public IP Address of Intel EC2 Instance From GitHub Logs
run: echo "::add-mask::${{ steps.intel-public-ip.outputs.value }}"
- name: Wait For The Intel EC2 Instance To Accept SSH Connections
run: timeout 180 bash -c 'until nc -z ${{ steps.intel-public-ip.outputs.value }} 22; do sleep 0.1; done'
- name: Connect To Intel EC2 Instance, Perform Benchmarks, Publish Results
uses: appleboy/ssh-action@1d1b21ca96111b1eb4c03c21c14ebb971d2200f6
with:
host: ${{ steps.intel-public-ip.outputs.value }}
username: ${{ secrets.BENCHMARKS_EC2_USERNAME }}
key: ${{ secrets.BENCHMARKS_EC2_SSH_KEY }}
command_timeout: 90m
script: |
cd ~/concretefhe-internal
git pull
make docker_publish_measurements
docker system prune -f
- name: Copy Intel EC2 Instance Logs
run: scp -o StrictHostKeyChecking=no -i ~/ssh-key ${{ secrets.BENCHMARKS_EC2_USERNAME }}@${{ steps.intel-public-ip.outputs.value }}:~/concretefhe-internal/logs/latest.log ~/latest.log
- name: Copy Intel EC2 Instance Findings
run: scp -o StrictHostKeyChecking=no -i ~/ssh-key ${{ secrets.BENCHMARKS_EC2_USERNAME }}@${{ steps.intel-public-ip.outputs.value }}:~/concretefhe-internal/.benchmarks/findings.json ~/findings.json
- name: Stop Intel EC2 Instance
if: ${{ always() }}
run: |
aws ec2 stop-instances --instance-ids ${{ secrets.BENCHMARKS_EC2_INTEL_INSTANCE_ID }}
- name: Upload Logs of Intel EC2 Instance
uses: actions/upload-artifact@27121b0bdffd731efa15d66772be8dc71245d074
with:
name: intel-logs
path: ~/latest.log
- name: Upload Findings of Intel EC2 Instance
uses: actions/upload-artifact@27121b0bdffd731efa15d66772be8dc71245d074
with:
name: intel-findings
path: ~/findings.json
- name: Send Slack Notification
if: ${{ always() }}
continue-on-error: true
uses: rtCamp/action-slack-notify@12e36fc18b0689399306c2e0b3e0f2978b7f1ee7
env:
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
SLACK_ICON: https://pbs.twimg.com/profile_images/1274014582265298945/OjBKP9kn_400x400.png
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: "Publishing benchmarks finished with status ${{ job.status }} \
(${{ env.ACTION_RUN_URL }})"
SLACK_USERNAME: ${{ secrets.BOT_USERNAME }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}