Skip to content

Commit

Permalink
Allow keeping EC2 instances after workflow failures
Browse files Browse the repository at this point in the history
  • Loading branch information
hanno-becker committed Sep 7, 2024
1 parent 3138820 commit 684fdc3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/bench_ec2_any.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ on:
store_results:
description: Indicates if results should be pushed to github pages
default: false
always_terminate:
description: Indicates if EC2 instance should always be terminated
default: true
jobs:
bench-ec2-any:
name: Ad-hoc benchmark on $${{ github.event.inputs.ec2_instance_type }}
Expand All @@ -31,4 +34,5 @@ jobs:
archflags: ${{ github.event.inputs.archflags }}
name: ${{ github.event.inputs.name }}
store_results: ${{ github.event.inputs.store_results }}
always_terminate: ${{ github.event.inputs.always_terminate }}
secrets: inherit
6 changes: 5 additions & 1 deletion .github/workflows/bench_ec2_reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ on:
type: string
description: Indicates if results should be pushed to github pages
default: 'false'
always_terminate:
type: string
description: Indicates if instance should always be terminated, even on failure
default: 'true'
env:
AWS_ROLE: arn:aws:iam::559050233797:role/mlkem-c-aarch64-gh-action
AWS_REGION: us-east-1
Expand Down Expand Up @@ -106,7 +110,7 @@ jobs:
- start-ec2-runner
- bench # 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
if: ${{ (inputs.always_terminate == 'true' && always()) || success() }} # 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@v4
Expand Down

0 comments on commit 684fdc3

Please sign in to comment.