Skip to content

Commit 706494a

Browse files
committed
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 <thanh.ha@linuxfoundation.org>
1 parent 0c8ad3d commit 706494a

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Build Windows AMI
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
branch:
7+
description: 'pytorch/test-infra branch to build from. (default: main)'
8+
required: true
9+
default: 'main'
10+
skip_create_ami:
11+
description: 'Skip creating the AMI (default: false)'
12+
required: true
13+
default: false
14+
15+
permissions:
16+
id-token: write
17+
contents: read
18+
19+
env:
20+
PACKER_VERSION: "1.11.2"
21+
22+
jobs:
23+
build-windows-ami:
24+
runs-on: ubuntu-latest
25+
environment: packer-build-env
26+
steps:
27+
- uses: actions/checkout@v4
28+
with:
29+
repository: pytorch/test-infra
30+
ref: ${{ inputs.branch }}
31+
32+
- name: Configure AWS Credentials (PyTorch Account)
33+
uses: aws-actions/configure-aws-credentials@v3
34+
with:
35+
aws-region: us-east-1
36+
role-to-assume: arn:aws:iam::391835788720:role/gha-packer-role
37+
38+
- name: Setup Packer
39+
uses: hashicorp/setup-packer@main
40+
with:
41+
version: ${{ env.PACKER_VERSION }}
42+
43+
- name: Packer Build
44+
run: |
45+
cd aws/ami/windows
46+
packer init .
47+
packer build -var 'skip_create_ami=${{ inputs.skip_create_ami }}' .

0 commit comments

Comments
 (0)