-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
) * Factor deploy.yaml out into a reusable workflow * Try specifying packages:write permission in build-and-run-model.yaml * Simplify names of build/run steps in deploy.yaml * Clean up docs in workflows * Temporarily simplify Dockerfile CMD to speed up CI test * Rename deploy.yaml to build-and-run-batch-job.yaml * Factor out vCPU and memory allocations to workflow input variables * Revert "Temporarily simplify Dockerfile CMD to speed up CI test" This reverts commit a86e0f1. * Add terraform-working-directory arg to workflows * Factor out cleanup-terraform into a reusable workflow * Temporarily run cleanup-model on PRs for testing purposes * Revert "Temporarily run cleanup-model on PRs for testing purposes" This reverts commit 51813b2. * Fix indentation error in cleanup-model.yaml * Document empty backend block in main.tf * Use github.event.repository.name for setup-terraform repo arg
- Loading branch information
1 parent
f51c35b
commit 90b6e4c
Showing
6 changed files
with
187 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Workflow that builds a Docker image containing the model code, | ||
# pushes it to the GitHub Container Registry, and then optionally uses | ||
# that container image to run the model using an AWS Batch job. | ||
# | ||
# Images are built on every commit to a PR or main branch in order to ensure | ||
# that the build continues to work properly, but Batch jobs are gated behind | ||
# a `deploy` environment that requires manual approval from a | ||
# @ccao-data/core-team member. | ||
# | ||
name: build-and-run-model | ||
|
||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
build-and-run-model: | ||
permissions: | ||
# contents:read and id-token:write permissions are needed to interact | ||
# with GitHub's OIDC Token endpoint so that we can authenticate with AWS | ||
contents: read | ||
id-token: write | ||
# While packages:write is usually not required for workflows, it is | ||
# required in order to allow the reusable called workflow to push to | ||
# GitHub Container Registry | ||
packages: write | ||
uses: ./.github/workflows/build-and-run-batch-job.yaml | ||
with: | ||
vcpu: "16.0" | ||
memory: "65536" | ||
role-duration-seconds: 14400 # Worst-case time for a full model run | ||
terraform-working-directory: terraform | ||
secrets: | ||
AWS_IAM_ROLE_TO_ASSUME_ARN: ${{ secrets.AWS_IAM_ROLE_TO_ASSUME_ARN }} | ||
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Workflow that runs whenever a PR is closed or merged and deletes any | ||
# AWS resources created for the pull request. | ||
|
||
name: cleanup-model | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
|
||
jobs: | ||
cleanup-model: | ||
permissions: | ||
# These permissions are needed to interact with GitHub's OIDC Token endpoint | ||
# so that we can authenticate with AWS | ||
id-token: write | ||
contents: read | ||
uses: ./.github/workflows/cleanup-terraform.yaml | ||
with: | ||
terraform-working-directory: terraform | ||
secrets: | ||
AWS_IAM_ROLE_TO_ASSUME_ARN: ${{ secrets.AWS_IAM_ROLE_TO_ASSUME_ARN }} | ||
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters