-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Packer Build job for Windows AMI
Add a job to create Windows AMIs in the PyTorch AWS Account. Issue: #5992 Signed-off-by: Thanh Ha <[email protected]>
- Loading branch information
Showing
1 changed file
with
47 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Build Windows AMI | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: 'pytorch/test-infra branch to build from. (default: main)' | ||
required: true | ||
default: 'main' | ||
skip_create_ami: | ||
description: 'Skip creating the AMI (default: false)' | ||
required: true | ||
default: false | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
env: | ||
PACKER_VERSION: "1.11.2" | ||
|
||
jobs: | ||
build-windows-ami: | ||
runs-on: ubuntu-latest | ||
environment: packer-build-env | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: pytorch/test-infra | ||
ref: ${{ inputs.branch }} | ||
|
||
- name: Configure AWS Credentials (PyTorch Account) | ||
uses: aws-actions/configure-aws-credentials@v3 | ||
with: | ||
aws-region: us-east-1 | ||
role-to-assume: arn:aws:iam::391835788720:role/gha-packer-role | ||
|
||
- name: Setup Packer | ||
uses: hashicorp/setup-packer@main | ||
with: | ||
version: ${{ env.PACKER_VERSION }} | ||
|
||
- name: Packer Build | ||
run: | | ||
cd aws/ami/windows | ||
packer init . | ||
packer build -var 'skip_create_ami=${{ inputs.skip_create_ami }}' . |