Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wip] [3006.x] Migrate workflows off AWS #67005

Open
wants to merge 72 commits into
base: 3006.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
6759191
Add some gh runners
dwoz Oct 28, 2024
badfa1b
Add runners to linter and disbale cache for salt onedir builds
dwoz Oct 28, 2024
685a9fd
Migrate build-deps-onedir step to gh runners
dwoz Oct 28, 2024
87d223e
Do not cache relenv for now
dwoz Oct 28, 2024
6578559
Disable more caches
dwoz Oct 28, 2024
417dada
Update constraints for python 3.12
dwoz Oct 28, 2024
7b1b009
Fix download location
dwoz Oct 29, 2024
680d77c
Set use s3 cache env to false
dwoz Oct 29, 2024
f9bbeb0
Build packages on gh runners
dwoz Oct 29, 2024
39fabf3
Migrate build deps ci action
dwoz Oct 29, 2024
ede2a3e
Add test-action-linux-ng.yml
dwoz Oct 29, 2024
04cae39
Fix workflow name
dwoz Oct 29, 2024
1521e93
Change template not generated files
dwoz Oct 29, 2024
6a5cce5
Disable s3 cache for build deps ci
dwoz Oct 29, 2024
c7b2cdc
Do not use tools vm for deps ci action
dwoz Oct 29, 2024
5ae3b6d
wean of aws bits
dwoz Oct 29, 2024
106bf9b
Setup python
dwoz Oct 30, 2024
6ae2d85
Migrate windows to gh runners
dwoz Oct 30, 2024
89a8e42
be more specific with python version
dwoz Oct 30, 2024
8411278
check python binary
dwoz Oct 30, 2024
4665b33
no container
dwoz Oct 30, 2024
c3fb1d7
revert cache change
dwoz Oct 30, 2024
85790c4
Disable more s3 caching
dwoz Oct 30, 2024
fd4767d
Do not install any system dependencies yet
dwoz Oct 30, 2024
1a2023e
Do not build 'source' packages for PRs
dwoz Oct 30, 2024
a1dc1a4
Fix nox tarball name
dwoz Oct 30, 2024
cfdc058
Build windows deps on github runner
dwoz Oct 30, 2024
ffbfd50
Fix decompress step
dwoz Oct 31, 2024
fea61da
Fix decompress nox step on windows
dwoz Oct 31, 2024
70fc72c
fetch correct nox tarball
dwoz Oct 31, 2024
392ec0a
bump relenv version
dwoz Oct 31, 2024
3153f61
Download from alt location
dwoz Oct 31, 2024
97242fd
Update download location
dwoz Oct 31, 2024
348a4b1
Disable most of linux and all of mac
dwoz Nov 1, 2024
92e1e21
Disable more OSes for package tests
dwoz Nov 1, 2024
8969237
use newer container for nwo
dwoz Nov 1, 2024
48575c4
No longer use sudo
dwoz Nov 2, 2024
26c718d
Less macos
dwoz Nov 2, 2024
6c35cbb
Less macos
dwoz Nov 2, 2024
0e7f3af
Fix up windows package test action
dwoz Nov 2, 2024
da4fe44
Show sys info fix
dwoz Nov 2, 2024
c8892fc
Meh
dwoz Nov 2, 2024
c5a5616
meh
dwoz Nov 2, 2024
921bd89
Skip reqs
dwoz Nov 2, 2024
1b4f4f2
No sudo for linux pkg tests
dwoz Nov 2, 2024
db88755
Attempt systemctl mock
dwoz Nov 2, 2024
5f6b8d1
Revert xlarge removal
dwoz Nov 2, 2024
65650cc
Try macos-13-arm64 instead of xlarge
dwoz Nov 2, 2024
8e9b24b
Stop using xlarge runners
dwoz Nov 2, 2024
a49b488
Mac arm is always xlarge
dwoz Nov 2, 2024
291505b
Use macos-14 for arm
dwoz Nov 2, 2024
76ca0b2
Use 3 core mac-14 for arm64
dwoz Nov 2, 2024
fc49e71
Try renaming salt dir
dwoz Nov 2, 2024
b7b6489
Fix package testing on windows
dwoz Nov 3, 2024
8e8bb7e
Fix extract location
dwoz Nov 4, 2024
606cd71
Upload pkg log artifacts
dwoz Nov 5, 2024
244921b
Add rockylinux containers
dwoz Nov 5, 2024
5823b34
Use distro slug for windows packages
dwoz Nov 5, 2024
c63c78b
bump cache seed
dwoz Nov 6, 2024
04e1867
Use rocky linux 8 too
dwoz Nov 6, 2024
f99f009
More testing containers
dwoz Nov 6, 2024
22470f9
fix photon container name
dwoz Nov 6, 2024
934d27c
Enable more containers for pkg tests
dwoz Nov 6, 2024
1198db7
Test systemctl
dwoz Nov 6, 2024
2bb0730
Fix typo
dwoz Nov 6, 2024
128bdcc
Stop using deprecated save-always
dwoz Nov 6, 2024
b6a9a0d
Try systemd containers
dwoz Nov 8, 2024
57209bb
More package tests
dwoz Nov 8, 2024
25774d3
Skip downgrade tests on windows
dwoz Nov 8, 2024
30c2304
Do not mount volumes
dwoz Nov 8, 2024
742a9dd
debug pkg install
dwoz Nov 8, 2024
ee92a84
Systemd container rename
dwoz Nov 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ self-hosted-runner:
- repo-release
- medium
- large
- macos-13-arm64
- macos-13-xlarge
- linux-x86_64
- linux-arm64
7 changes: 0 additions & 7 deletions .github/actions/cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ inputs:
description: 'Check if a cache entry exists for the given input(s) (key, restore-keys) without downloading the cache'
default: 'false'
required: false
save-always:
description: 'Run the post step to save the cache even if another step before fails'
default: 'false'
required: false

outputs:
cache-hit:
Expand All @@ -49,7 +45,6 @@ runs:
echo "GHA_CACHE_ENABLE_CROSS_OS_ARCHIVE=${{ inputs.enableCrossOsArchive }}" | tee -a "${GITHUB_ENV}"
echo "GHA_CACHE_FAIL_ON_CACHE_MISS=${{ inputs.fail-on-cache-miss }}" | tee -a "${GITHUB_ENV}"
echo "GHA_CACHE_LOOKUP_ONLY=${{ inputs.lookup-only }}" | tee -a "${GITHUB_ENV}"
echo "GHA_CACHE_SAVE_ALWAYS=${{ inputs.save-always }}" | tee -a "${GITHUB_ENV}"
echo "GHA_CACHE_RESTORE_KEYS=${{ inputs.restore-keys }}" | tee -a "${GITHUB_ENV}"
echo "GHA_CACHE_UPLOAD_CHUNK_SIZE=${{ inputs.upload-chunk-size }}" | tee -a "${GITHUB_ENV}"

Expand All @@ -63,7 +58,6 @@ runs:
enableCrossOsArchive: ${{ env.GHA_CACHE_ENABLE_CROSS_OS_ARCHIVE }}
fail-on-cache-miss: ${{ env.GHA_CACHE_FAIL_ON_CACHE_MISS }}
lookup-only: ${{ env.GHA_CACHE_LOOKUP_ONLY }}
save-always: ${{ env.GHA_CACHE_SAVE_ALWAYS }}
restore-keys: ${{ env.GHA_CACHE_RESTORE_KEYS }}
upload-chunk-size: ${{ env.GHA_CACHE_UPLOAD_CHUNK_SIZE }}

Expand Down Expand Up @@ -97,7 +91,6 @@ runs:
enableCrossOsArchive: ${{ env.GHA_CACHE_ENABLE_CROSS_OS_ARCHIVE }}
fail-on-cache-miss: ${{ env.GHA_CACHE_FAIL_ON_CACHE_MISS }}
lookup-only: ${{ env.GHA_CACHE_LOOKUP_ONLY }}
save-always: ${{ env.GHA_CACHE_SAVE_ALWAYS }}
restore-keys: ${{ env.GHA_CACHE_RESTORE_KEYS }}
upload-chunk-size: ${{ env.GHA_CACHE_UPLOAD_CHUNK_SIZE }}

Expand Down
114 changes: 41 additions & 73 deletions .github/workflows/build-deps-ci-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ on:
required: true
type: string
description: Nox Tarball Cache Hash
kind:
required: true
type: string
description: Kind of dependencies to build; linux, macos, windows
python-version:
required: false
type: string
Expand Down Expand Up @@ -85,17 +89,19 @@ jobs:
needs:
- generate-matrix
runs-on:
- self-hosted
- linux
- bastion
- linux-${{ matrix.arch }}
if: ${{ inputs.kind == 'linux' }}
env:
USE_S3_CACHE: 'true'
USE_S3_CACHE: 'false'
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.generate-matrix.outputs.matrix-include)['linux'] }}
steps:
- uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: "Throttle Builds"
shell: bash
Expand Down Expand Up @@ -138,53 +144,33 @@ jobs:
with:
cache-prefix: ${{ inputs.cache-prefix }}-build-deps-ci

- name: Get Salt Project GitHub Actions Bot Environment
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
run: |
TOKEN=$(curl -sS -f -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 30")
SPB_ENVIRONMENT=$(curl -sS -f -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/tags/instance/spb:environment)
echo "SPB_ENVIRONMENT=$SPB_ENVIRONMENT" >> "$GITHUB_ENV"

- name: Start VM
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
id: spin-up-vm
run: |
tools --timestamps vm create --environment "${SPB_ENVIRONMENT}" --retries=2 ${{ matrix.distro-slug }}

- name: List Free Space
- name: Install System Dependencies
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
run: |
tools --timestamps vm ssh ${{ matrix.distro-slug }} -- df -h || true
echo true

- name: Upload Checkout To VM
- name: Install Nox
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
run: |
tools --timestamps vm rsync ${{ matrix.distro-slug }}
python3 -m pip install 'nox==${{ inputs.nox-version }}'

- name: Install Dependencies
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
env:
PRINT_TEST_SELECTION: "0"
PRINT_SYSTEM_INFO: "0"
run: |
tools --timestamps vm install-dependencies --nox-session=${{ inputs.nox-session }} ${{ matrix.distro-slug }}
nox --install-only -e ${{ inputs.nox-session }}

- name: Cleanup .nox Directory
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
run: |
tools --timestamps vm pre-archive-cleanup ${{ matrix.distro-slug }}
nox --force-color -e "pre-archive-cleanup(pkg=False)"

- name: Compress .nox Directory
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
run: |
tools --timestamps vm compress-dependencies ${{ matrix.distro-slug }}

- name: Download Compressed .nox Directory
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
run: |
tools --timestamps vm download-dependencies ${{ matrix.distro-slug }}

- name: Destroy VM
if: always() && steps.nox-dependencies-cache.outputs.cache-hit != 'true'
run: |
tools --timestamps vm destroy --no-wait ${{ matrix.distro-slug }}
nox --force-color -e compress-dependencies -- linux ${{ matrix.arch }}

- name: Upload Nox Requirements Tarball
uses: actions/upload-artifact@v4
Expand All @@ -196,7 +182,8 @@ jobs:
name: MacOS
needs:
- generate-matrix
runs-on: ${{ matrix.distro-slug == 'macos-13-arm64' && 'macos-13-xlarge' || matrix.distro-slug }}
runs-on: ${{ matrix.distro-slug == 'macos-13-arm64' && 'macos-14' || matrix.distro-slug }}
if: ${{ inputs.kind == 'macos' }}
timeout-minutes: 90
strategy:
fail-fast: false
Expand Down Expand Up @@ -280,16 +267,16 @@ jobs:
name: nox-macos-${{ matrix.arch }}-${{ inputs.nox-session }}
path: nox.macos.${{ matrix.arch }}.tar.*


windows-dependencies:
needs:
- generate-matrix
name: Windows
runs-on:
- self-hosted
- linux
- bastion
runs-on: windows-latest
if: ${{ inputs.kind == 'windows' }}
env:
USE_S3_CACHE: 'true'
USE_S3_CACHE: 'false'
GITHUB_WORKSPACE: 'C:\Windows\Temp\testing'
timeout-minutes: 90
strategy:
fail-fast: false
Expand Down Expand Up @@ -327,64 +314,45 @@ jobs:
cd artifacts
tar xvf ${{ inputs.package-name }}-${{ inputs.salt-version }}-onedir-windows-${{ matrix.arch }}.tar.xz

- name: PyPi Proxy
- name: Set up Python ${{ inputs.python-version }}
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
run: |
sed -i '7s;^;--index-url=${{ vars.PIP_INDEX_URL }} --trusted-host ${{ vars.PIP_TRUSTED_HOST }} --extra-index-url=${{ vars.PIP_EXTRA_INDEX_URL }}\n;' requirements/static/ci/*/*.txt
uses: actions/setup-python@v5
with:
python-version: "${{ inputs.python-version }}"

- name: Setup Python Tools Scripts
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
uses: ./.github/actions/setup-python-tools-scripts
with:
cache-prefix: ${{ inputs.cache-prefix }}-build-deps-ci

- name: Get Salt Project GitHub Actions Bot Environment
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
run: |
TOKEN=$(curl -sS -f -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 30")
SPB_ENVIRONMENT=$(curl -sS -f -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/tags/instance/spb:environment)
echo "SPB_ENVIRONMENT=$SPB_ENVIRONMENT" >> "$GITHUB_ENV"

- name: Start VM
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
id: spin-up-vm
run: |
tools --timestamps vm create --environment "${SPB_ENVIRONMENT}" --retries=2 ${{ matrix.distro-slug }}

- name: List Free Space
- name: Install System Dependencies
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
run: |
tools --timestamps vm ssh ${{ matrix.distro-slug }} -- df -h || true
echo true

- name: Upload Checkout To VM
- name: Install Nox
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
run: |
tools --timestamps vm rsync ${{ matrix.distro-slug }}
python3 -m pip install 'nox==${{ inputs.nox-version }}'

- name: Install Dependencies
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
env:
PRINT_TEST_SELECTION: "0"
PRINT_SYSTEM_INFO: "0"
run: |
tools --timestamps vm install-dependencies --nox-session=${{ inputs.nox-session }} ${{ matrix.distro-slug }}
nox --install-only -e ${{ inputs.nox-session }}

- name: Cleanup .nox Directory
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
run: |
tools --timestamps vm pre-archive-cleanup ${{ matrix.distro-slug }}
nox --force-color -e "pre-archive-cleanup(pkg=False)"

- name: Compress .nox Directory
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
run: |
tools --timestamps vm compress-dependencies ${{ matrix.distro-slug }}

- name: Download Compressed .nox Directory
if: steps.nox-dependencies-cache.outputs.cache-hit != 'true'
run: |
tools --timestamps vm download-dependencies ${{ matrix.distro-slug }}

- name: Destroy VM
if: always() && steps.nox-dependencies-cache.outputs.cache-hit != 'true'
run: |
tools --timestamps vm destroy --no-wait ${{ matrix.distro-slug }}
nox --force-color -e compress-dependencies -- windows ${{ matrix.arch }}

- name: Upload Nox Requirements Tarball
uses: actions/upload-artifact@v4
Expand Down
22 changes: 14 additions & 8 deletions .github/workflows/build-deps-onedir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ on:
required: true
type: string
description: The version of python to use with relenv
kind:
type: string
required: true
description: The kind of tests to run windows, macos, or linux

env:
RELENV_DATA: "${{ github.workspace }}/.relenv"
Expand All @@ -41,19 +45,17 @@ jobs:

build-deps-linux:
name: Linux
if: ${{ inputs.self-hosted-runners }}
if: ${{ inputs.self-hosted-runners && inputs.kind == 'linux' }}
strategy:
fail-fast: false
matrix:
arch:
- x86_64
- arm64
runs-on:
- self-hosted
- linux
- ${{ matrix.arch }}
- linux-${{ matrix.arch }}
env:
USE_S3_CACHE: 'true'
USE_S3_CACHE: 'false'
steps:

- name: "Throttle Builds"
Expand Down Expand Up @@ -88,19 +90,23 @@ jobs:

build-deps-macos:
name: macOS
if: ${{ inputs.github-hosted-runners }}
if: ${{ inputs.github-hosted-runners && inputs.kind == 'macOS' }}
strategy:
fail-fast: false
max-parallel: 2
matrix:
arch: ${{ github.event.repository.fork && fromJSON('["x86_64"]') || fromJSON('["x86_64", "arm64"]') }}
runs-on:
- ${{ matrix.arch == 'arm64' && 'macos-13-xlarge' || 'macos-12' }}
- ${{ matrix.arch == 'arm64' && 'macos-14' || 'macos-13' }}
env:
USE_S3_CACHE: 'false'
PIP_INDEX_URL: https://pypi.org/simple
steps:

- name: "Check cores"
shell: bash
run: sysctl -n hw.ncpu

- name: "Throttle Builds"
shell: bash
run: |
Expand Down Expand Up @@ -138,7 +144,7 @@ jobs:

build-deps-windows:
name: Windows
if: ${{ inputs.github-hosted-runners }}
if: ${{ inputs.github-hosted-runners && inputs.kind == 'windows' }}
strategy:
fail-fast: false
max-parallel: 2
Expand Down
Loading
Loading