mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 03:55:04 -05:00
chore: add waiting ssh to daily benchmarks action to avoid errors and fix copy logs step
This commit is contained in:
28
.github/workflows/daily-benchmarks.yaml
vendored
28
.github/workflows/daily-benchmarks.yaml
vendored
@@ -10,7 +10,7 @@ jobs:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Configure AWS Credentials
|
||||
uses: aws-actions/configure-aws-credentials@v1
|
||||
uses: aws-actions/configure-aws-credentials@0d9a5be0dceea74e09396820e1e522ba4a110d2f
|
||||
with:
|
||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
@@ -20,10 +20,19 @@ jobs:
|
||||
run: |
|
||||
aws ec2 start-instances --instance-ids ${{ secrets.BENCHMARKS_EC2_INSTANCE_ID }}
|
||||
|
||||
- name: Wait For The Instance To Get An IP Address
|
||||
run: timeout 180 bash -c 'until [[ $(aws ec2 describe-instances --instance-ids ${{ secrets.BENCHMARKS_EC2_INSTANCE_ID }} --query 'Reservations[].Instances[].PublicIpAddress' --output text) != "" ]]; do sleep 0.1; done'
|
||||
|
||||
- name: Get Public IP Address of EC2 Instance
|
||||
id: public-ip
|
||||
run: echo "::set-output name=value::$(aws ec2 describe-instances --region eu-west-3 --instance-ids ${{ secrets.BENCHMARKS_EC2_INSTANCE_ID }} --query 'Reservations[].Instances[].PublicIpAddress' --output text)"
|
||||
|
||||
- name: Hide Public IP Address From GitHub Logs
|
||||
run: echo "::add-mask::${{ steps.public-ip.outputs.value }}"
|
||||
|
||||
- name: Wait For The Instance To Accept SSH Connections
|
||||
run: timeout 180 bash -c 'until nc -z ${{ steps.public-ip.outputs.value }} 22; do sleep 0.1; done'
|
||||
|
||||
- name: Connect To EC2 Instance, Perform Benchmarks, Publish Results
|
||||
uses: appleboy/ssh-action@1d1b21ca96111b1eb4c03c21c14ebb971d2200f6
|
||||
with:
|
||||
@@ -34,14 +43,13 @@ jobs:
|
||||
cd ~/concretefhe-internal
|
||||
make docker_publish_measurements
|
||||
|
||||
- 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: Copy Logs
|
||||
uses: appleboy/scp-action@edc8ec9139a2687bcebf0249d0352ff2a988df00
|
||||
with:
|
||||
host: ${{ steps.public-ip.outputs.value }}
|
||||
username: ${{ secrets.BENCHMARKS_EC2_USERNAME }}
|
||||
key: ${{ secrets.BENCHMARKS_EC2_SSH_KEY }}
|
||||
source: "~/concretefhe-internal/logs/latest.log"
|
||||
target: "~/latest.log"
|
||||
run: scp -o StrictHostKeyChecking=no -i ~/ssh-key ${{ secrets.BENCHMARKS_EC2_USERNAME }}@${{ steps.public-ip.outputs.value }}:~/concretefhe-internal/logs/latest.log ~/latest.log
|
||||
|
||||
- name: Stop EC2 Instance
|
||||
if: ${{ always() }}
|
||||
@@ -49,7 +57,7 @@ jobs:
|
||||
aws ec2 stop-instances --instance-ids ${{ secrets.BENCHMARKS_EC2_INSTANCE_ID }}
|
||||
|
||||
- name: Upload Logs
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@27121b0bdffd731efa15d66772be8dc71245d074
|
||||
with:
|
||||
name: logs
|
||||
path: ~/latest.log
|
||||
@@ -57,7 +65,7 @@ jobs:
|
||||
- name: Send Slack Notification
|
||||
if: ${{ always() }}
|
||||
continue-on-error: true
|
||||
uses: rtCamp/action-slack-notify@v2
|
||||
uses: rtCamp/action-slack-notify@12e36fc18b0689399306c2e0b3e0f2978b7f1ee7
|
||||
env:
|
||||
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
|
||||
SLACK_ICON: https://pbs.twimg.com/profile_images/1274014582265298945/OjBKP9kn_400x400.png
|
||||
|
||||
Reference in New Issue
Block a user