packer #103
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
name: packer | |
on: | |
push: | |
paths: | |
- packer/** | |
branches: | |
- main | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * 0" | |
concurrency: | |
group: packer_build | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./packer | |
env: | |
PKR_VAR_aws_access_key: ${{ secrets.PACKER_AWS_ACCESS_KEY_ID }} | |
PKR_VAR_aws_secret_key: ${{ secrets.PACKER_AWS_SECRET_ACCESS_KEY }} | |
steps: | |
- | |
name: Pull repository | |
uses: actions/checkout@v2 | |
- | |
name: Build AWS base AMI | |
uses: hashicorp/packer-github-actions@master | |
env: | |
WORKSPACE_DIR: jenkins-agents/stock | |
PKR_VAR_image_prefix: ci-base | |
with: | |
command: build | |
target: packer/base-images/aws | |
- | |
name: Build stock Jenkins agent | |
uses: hashicorp/packer-github-actions@master | |
env: | |
WORKSPACE_DIR: jenkins-agents/stock | |
PKR_VAR_source_image_family: ci-base | |
PKR_VAR_image_prefix: jenkins-stock-agent | |
with: | |
command: build | |
target: packer/jenkins-agents/stock | |
- | |
name: Build GPU Jenkins agent | |
uses: hashicorp/packer-github-actions@master | |
env: | |
WORKSPACE_DIR: jenkins-agents/stock | |
PKR_VAR_source_image_family: jenkins-stock-agent | |
PKR_VAR_image_prefix: jenkins-gpu-agent | |
#This driver version below is the latest recommended given our requirements (T4 GPU, CUDA 12.2, Linux X64). Furthermore, the corresponding run script is compatible with Linux kernel version 5.13. | |
PKR_VAR_nvidia_driver_version: "535.129.03" | |
PKR_VAR_nvidia_driver_base_url: "https://us.download.nvidia.com/tesla" | |
with: | |
command: build | |
target: packer/jenkins-agents/gpu |