-
Notifications
You must be signed in to change notification settings - Fork 35
Nightly Slurm CI Rocky update workflow #440
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
Merged
Merged
Changes from 48 commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
03732bc
Update openstack.pkr.hcl
bertiethorpe 06ee0f2
new image build workflow
bertiethorpe d6d72ba
dynamically set packer vars from fatimage workflow
bertiethorpe ce2afdb
remove openstack. prefix from image name
bertiethorpe edbaeb7
echo image name
bertiethorpe 47391ad
make image_name var in packer config
bertiethorpe 92e6d1c
new changes
bertiethorpe e36dad7
Merge branch 'main' into ci/nightly-builds
bertiethorpe ac08548
fix merge changes
bertiethorpe 101f696
temp workflow changes
bertiethorpe cf8a685
test nightly build
bertiethorpe 26cd493
change back fatimage workflow
bertiethorpe cf37a32
rename images built
bertiethorpe c21d097
add update to builder group
bertiethorpe 64918cb
add update to fatimage build groups
bertiethorpe 8e71d6a
fatimage.yml fix
bertiethorpe 990ddc1
move output image_name declaration into build blocks
bertiethorpe aa0786f
delete outdated nightly image
bertiethorpe 6defc9d
test new fatimage build
bertiethorpe c29a9db
debug dnf remove cockpit
bertiethorpe 3b601f5
--amend
bertiethorpe f3d0b67
add cuda build back in
bertiethorpe 35048ac
cuda nightly build
bertiethorpe d16ef50
test cuda nightly builds
bertiethorpe b98d803
test new fatimage build on SMS
bertiethorpe 79f6893
test image upploads across clouds
bertiethorpe 7183fcc
test image uploads in separate workflow
bertiethorpe 02fa0b6
finish nightly build workflow
bertiethorpe 260146a
fix image delete logic
bertiethorpe fd44029
use azimuth-cloud trivy db mirror
bertiethorpe 716352b
use GITHUB_TOKEN env
bertiethorpe cfa40d3
test new fatimage build
bertiethorpe 5c13b41
Merge branch 'main' into ci/nightly-builds
bertiethorpe 6bffdf7
add final nightlybuilds workflow
bertiethorpe 348c150
move trivy scan to separate workflow
bertiethorpe 6c37ac8
bump image and test new trivy scan
bertiethorpe a256bce
fix artifact creation
bertiethorpe 3fbc9e9
bump image and test trivy scan
bertiethorpe a60dbf4
only run trivy scan on image bumps
bertiethorpe d883e55
bump image to test trivy scan run condition
bertiethorpe 00eaf4e
bump cuda image
bertiethorpe 8630ebb
bump image
bertiethorpe 46c1c15
extend timeout for trivy scanning cuda image
bertiethorpe 22dcfbb
Run workflow on PR to main
bertiethorpe b61ee98
Merge branch 'main' into ci/nightly-builds
bertiethorpe c9ebf42
address PR comments
bertiethorpe 527f7bc
fix source_image_name packer parse
bertiethorpe cf417e5
bump image
bertiethorpe 354b048
additional PR comments
bertiethorpe 169b42d
bump image
bertiethorpe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
|
||
name: Build fat image | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
ci_cloud: | ||
description: 'Select the CI_CLOUD' | ||
required: true | ||
type: choice | ||
options: | ||
- LEAFCLOUD | ||
- SMS | ||
- ARCUS | ||
inputs: | ||
ci_cloud: | ||
description: 'Select the CI_CLOUD' | ||
required: true | ||
type: choice | ||
options: | ||
- LEAFCLOUD | ||
- SMS | ||
- ARCUS | ||
|
||
jobs: | ||
openstack: | ||
name: openstack-imagebuild | ||
|
@@ -25,7 +25,7 @@ jobs: | |
- RL8 | ||
- RL9 | ||
build: | ||
- openstack.openhpc-ofed | ||
- openstack.openhpc | ||
- openstack.openhpc-cuda | ||
exclude: | ||
- os_version: RL8 | ||
|
@@ -34,6 +34,18 @@ jobs: | |
ANSIBLE_FORCE_COLOR: True | ||
OS_CLOUD: openstack | ||
CI_CLOUD: ${{ github.event.inputs.ci_cloud }} | ||
SOURCE_IMAGES_MAP: | | ||
{ | ||
"RL8": { | ||
"openstack.openhpc": "rocky-latest-RL8", | ||
"openstack.openhpc-cuda": "rocky-latest-cuda-RL8" | ||
}, | ||
"RL9": { | ||
"openstack.openhpc": "rocky-latest-RL9", | ||
"openstack.openhpc-cuda": "rocky-latest-cuda-RL9" | ||
} | ||
} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
|
@@ -52,10 +64,10 @@ jobs: | |
- name: Add bastion's ssh key to known_hosts | ||
run: cat environments/.stackhpc/bastion_fingerprints >> ~/.ssh/known_hosts | ||
shell: bash | ||
|
||
- name: Install ansible etc | ||
run: dev/setup-env.sh | ||
|
||
- name: Write clouds.yaml | ||
run: | | ||
mkdir -p ~/.config/openstack/ | ||
|
@@ -66,15 +78,24 @@ jobs: | |
run: | | ||
. venv/bin/activate | ||
. environments/.stackhpc/activate | ||
|
||
- name: Build fat image with packer | ||
id: packer_build | ||
run: | | ||
set -x | ||
. venv/bin/activate | ||
. environments/.stackhpc/activate | ||
cd packer/ | ||
packer init . | ||
PACKER_LOG=1 packer build -on-error=${{ vars.PACKER_ON_ERROR }} -only=${{ matrix.build }} -var-file=$PKR_VAR_environment_root/${{ env.CI_CLOUD }}.pkrvars.hcl openstack.pkr.hcl | ||
|
||
SOURCE_IMAGE=${{ fromJSON(env.SOURCE_IMAGES_MAP)[matrix.os_version][matrix.build] }} | ||
|
||
PACKER_LOG=1 packer build \ | ||
-on-error=${{ vars.PACKER_ON_ERROR }} \ | ||
-only=${{ matrix.build }} \ | ||
-var-file=$PKR_VAR_environment_root/${{ env.CI_CLOUD }}.pkrvars.hcl \ | ||
-var "source_image_name=${SOURCE_IMAGE}" \ | ||
openstack.pkr.hcl | ||
env: | ||
PKR_VAR_os_version: ${{ matrix.os_version }} | ||
|
||
|
@@ -87,53 +108,14 @@ jobs: | |
sleep 5 | ||
done | ||
IMAGE_NAME=$(openstack image show -f value -c name $IMAGE_ID) | ||
echo "image-name=${IMAGE_NAME}" >> "$GITHUB_OUTPUT" | ||
echo "image-id=$IMAGE_ID" >> "$GITHUB_OUTPUT" | ||
|
||
- name: Download image | ||
run: | | ||
. venv/bin/activate | ||
sudo mkdir /mnt/images | ||
sudo chmod 777 /mnt/images | ||
openstack image save --file /mnt/images/${{ steps.manifest.outputs.image-name }}.qcow2 ${{ steps.manifest.outputs.image-name }} | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: install libguestfs | ||
run: | | ||
sudo apt -y update | ||
sudo apt -y install libguestfs-tools | ||
|
||
- name: mkdir for mount | ||
run: sudo mkdir -p './${{ steps.manifest.outputs.image-name }}' | ||
|
||
- name: mount qcow2 file | ||
run: sudo guestmount -a /mnt/images/${{ steps.manifest.outputs.image-name }}.qcow2 -i --ro -o allow_other './${{ steps.manifest.outputs.image-name }}' | ||
|
||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/[email protected] | ||
with: | ||
scan-type: fs | ||
scan-ref: "${{ steps.manifest.outputs.image-name }}" | ||
scanners: "vuln" | ||
format: sarif | ||
output: "${{ steps.manifest.outputs.image-name }}.sarif" | ||
# turn off secret scanning to speed things up | ||
|
||
- name: Upload Trivy scan results to GitHub Security tab | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: "${{ steps.manifest.outputs.image-name }}.sarif" | ||
category: "${{ matrix.os_version }}-${{ matrix.build }}" | ||
echo $IMAGE_ID > image-id.txt | ||
echo $IMAGE_NAME > image-name.txt | ||
|
||
- name: Fail if scan has CRITICAL vulnerabilities | ||
uses: aquasecurity/[email protected] | ||
- name: Upload manifest artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
scan-type: fs | ||
scan-ref: "${{ steps.manifest.outputs.image-name }}" | ||
scanners: "vuln" | ||
format: table | ||
exit-code: '1' | ||
severity: 'CRITICAL' | ||
ignore-unfixed: true | ||
name: image-details-${{ matrix.build }}-${{ matrix.os_version }} | ||
path: | | ||
./image-id.txt | ||
./image-name.txt | ||
overwrite: true |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.