Skip to content

Commit 841f5b1

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 841f5b1

File tree

1 file changed

+48
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)