Skip to content

2023.1: zed merge #1130

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 26 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a42b23c
docs: Add note about pyroute2 bug in Jammy upgrade
markgoddard Mar 21, 2024
bf4ad82
Add image to list on critical CVE detection
seunghun1ee May 21, 2024
c507c73
Add new step to fail job on critical CVE detection
seunghun1ee May 21, 2024
e7b97b2
Add condition to ensure swap is not zero
seunghun1ee Jun 6, 2024
5e821f3
Merge pull request #1094 from stackhpc/zed-yoga-merge
markgoddard Jun 10, 2024
9c4c16e
Fix image push condition
seunghun1ee Jun 11, 2024
c133035
Add instruction to update Octavia amphora image
priteau Jun 17, 2024
a7187f9
Remove CentOS AIO CI tests
Alex-Welsh Jun 17, 2024
14d7479
Merge pull request #1099 from stackhpc/fix-zero-denominator
markgoddard Jun 17, 2024
821fcd8
Merge pull request #1101 from stackhpc/remove-centos-aios
markgoddard Jun 17, 2024
ee06232
Merge pull request #1100 from stackhpc/upgrade-amphora-image
priteau Jun 20, 2024
5cabb61
Update ubuntu-jammy.rst
markgoddard Jun 25, 2024
56879bc
Merge pull request #1008 from stackhpc/jammy-issues
markgoddard Jun 25, 2024
ff5d320
Refer to internal docs for building amphora images
jovial Jun 26, 2024
344e7fb
Merge pull request #1116 from stackhpc/docs/amphora
markgoddard Jun 27, 2024
36596aa
docs: fix link
priteau Jul 1, 2024
3683d2e
Fix CentOS Stream 8 container image builds
markgoddard Jul 1, 2024
9be0f1e
Merge pull request #1125 from stackhpc/doc-link-fix
priteau Jul 2, 2024
f20d6c6
Merge pull request #1126 from stackhpc/yoga-fix-cs8-builds
markgoddard Jul 2, 2024
36abb41
Fix CVE-2024-32498
markgoddard Jul 1, 2024
b6394b0
Revert "Remove CentOS AIO CI tests"
markgoddard Jul 1, 2024
d840821
CI: Reorder growroot after minimal host configure on CentOS Stream 8
markgoddard Jul 1, 2024
928f96c
Merge pull request #1124 from stackhpc/yoga-bumps
markgoddard Jul 2, 2024
0c07da3
Merge pull request #1080 from stackhpc/fail-kolla-image-build-when-cr…
markgoddard Jul 3, 2024
f097e0c
Merge stackhpc/yoga into stackhpc/zed
markgoddard Jul 3, 2024
2b191ab
Merge stackhpc/zed into stackhpc/2023.1
markgoddard Jul 3, 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
27 changes: 20 additions & 7 deletions .github/workflows/stackhpc-container-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,10 @@ on:
required: false
default: true
push-dirty:
description: Push scanned images that have vulnerabilities?
description: Push scanned images that have critical vulnerabilities?
type: boolean
required: false
# NOTE(Alex-Welsh): This default should be flipped once we resolve existing failures
default: true
default: false

env:
ANSIBLE_FORCE_COLOR: True
Expand Down Expand Up @@ -180,7 +179,7 @@ jobs:
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}

- name: Create build logs output directory
run: mkdir image-build-logs
run: mkdir image-build-logs

- name: Build kolla overcloud images
id: build_overcloud_images
Expand Down Expand Up @@ -239,9 +238,16 @@ jobs:
run: cp image-build-logs/image-scan-output/clean-images.txt image-build-logs/push-attempt-images.txt
if: inputs.push

# NOTE(seunghun1ee): This always appends dirty images with CVEs severity lower than critical.
# This should be reverted when it's decided to filter high level CVEs as well.
- name: Append dirty images to push list
run: |
cat image-build-logs/image-scan-output/dirty-images.txt >> image-build-logs/push-attempt-images.txt
if: ${{ inputs.push }}

- name: Append images with critical vulnerabilities to push list
run: |
cat image-build-logs/image-scan-output/critical-images.txt >> image-build-logs/push-attempt-images.txt
if: ${{ inputs.push && inputs.push-dirty }}

- name: Push images
Expand All @@ -253,7 +259,7 @@ jobs:

while read -r image; do
# Retries!
for i in {1..5}; do
for i in {1..5}; do
if docker push $image; then
echo "Pushed $image"
break
Expand Down Expand Up @@ -287,8 +293,15 @@ jobs:
run: if [ $(wc -l < image-build-logs/push-failed-images.txt) -gt 0 ]; then cat image-build-logs/push-failed-images.txt && exit 1; fi
if: ${{ !cancelled() }}

- name: Fail when images failed scanning
run: if [ $(wc -l < image-build-logs/dirty-images.txt) -gt 0 ]; then cat image-build-logs/dirty-images.txt && exit 1; fi
# NOTE(seunghun1ee): Currently we want to mark the job fail only when critical CVEs are detected.
# This can be used again instead of "Fail when critical vulnerabilities are found" when it's
# decided to fail the job on detecting high CVEs as well.
# - name: Fail when images failed scanning
# run: if [ $(wc -l < image-build-logs/image-scan-output/dirty-images.txt) -gt 0 ]; then cat image-build-logs/image-scan-output/dirty-images.txt && exit 1; fi
# if: ${{ !inputs.push-dirty && !cancelled() }}

- name: Fail when critical vulnerabilities are found
run: if [ $(wc -l < image-build-logs/image-scan-output/critical-images.txt) -gt 0 ]; then cat image-build-logs/image-scan-output/critical-images.txt && exit 1; fi
if: ${{ !inputs.push-dirty && !cancelled() }}

# NOTE(mgoddard): Trigger another CI workflow in the
Expand Down
2 changes: 2 additions & 0 deletions doc/source/operations/octavia.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Octavia
=======

.. _Amphora image:

Building and rotating amphora images
====================================

Expand Down
10 changes: 8 additions & 2 deletions doc/source/operations/upgrading.rst
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,8 @@ To upgrade the Ansible control host:
Syncing Release Train artifacts
-------------------------------

New `StackHPC Release Train <../configuration/release-train>` content should be
synced to the local Pulp server. This includes host packages (Deb/RPM) and
New `StackHPC Release Train <../configuration/release-train>`_ content should
be synced to the local Pulp server. This includes host packages (Deb/RPM) and
container images.

.. _sync-rt-package-repos:
Expand Down Expand Up @@ -1067,6 +1067,12 @@ scope of the upgrade:

kayobe overcloud service upgrade --tags config --kolla-tags keystone

Updating the Octavia Amphora Image
----------------------------------

If using Octavia with the Amphora driver, you should :ref:`build a new amphora
image <Amphora image>`.

Testing
-------

Expand Down
4 changes: 2 additions & 2 deletions etc/kayobe/kolla/config/prometheus/system.rules
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ groups:
description: "Available memory is {{ $value }} GiB."

- alert: LowSwapSpace
expr: (node_memory_SwapFree_bytes / node_memory_SwapTotal_bytes) < {% endraw %}{{ alertmanager_node_free_swap_warning_threshold_ratio }}{% raw %}
expr: node_memory_SwapTotal_bytes > 0 and (node_memory_SwapFree_bytes / node_memory_SwapTotal_bytes) < {% endraw %}{{ alertmanager_node_free_swap_warning_threshold_ratio }}{% raw %}
for: 1m
labels:
severity: warning
Expand All @@ -34,7 +34,7 @@ groups:
description: "Available swap space is {{ $value | humanizePercentage }}. Running out of swap space causes OOM Kills."

- alert: LowSwapSpace
expr: (node_memory_SwapFree_bytes / node_memory_SwapTotal_bytes) < {% endraw %}{{ alertmanager_node_free_swap_critical_threshold_ratio }}{% raw %}
expr: node_memory_SwapTotal_bytes > 0 and (node_memory_SwapFree_bytes / node_memory_SwapTotal_bytes) < {% endraw %}{{ alertmanager_node_free_swap_critical_threshold_ratio }}{% raw %}
for: 1m
labels:
severity: critical
Expand Down
24 changes: 16 additions & 8 deletions tools/scan-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ docker image ls --filter "reference=ark.stackhpc.com/stackhpc-dev/*:$2" > $1-sca
images=$(grep --invert-match --no-filename ^REPOSITORY $1-scanned-container-images.txt | sed 's/ \+/:/g' | cut -f 1,2 -d:)

# Ensure output files exist
touch image-scan-output/clean-images.txt image-scan-output/dirty-images.txt
touch image-scan-output/clean-images.txt image-scan-output/dirty-images.txt image-scan-output/critical-images.txt

# If Trivy detects no vulnerabilities, add the image name to clean-images.txt.
# If there are vulnerabilities detected, add it to dirty-images.txt and
# generate a csv summary
# If the image contains at least one critical vulnerabilities, add it to
# critical-images.txt
for image in $images; do
filename=$(basename $image | sed 's/:/\./g')
imagename=$(echo $filename | cut -d "." -f 1 | sed 's/-/_/g')
Expand Down Expand Up @@ -59,15 +61,13 @@ for image in $images; do
# Add the image to the clean list
echo "${image}" >> image-scan-output/clean-images.txt
else
# Add the image to the dirty list
echo "${image}" >> image-scan-output/dirty-images.txt


# Write a header for the summary CSV
echo '"PkgName","PkgPath","PkgID","VulnerabilityID","FixedVersion","PrimaryURL","Severity"' > image-scan-output/${filename}.summary.csv

# Write the summary CSV data
jq -r '.Results[]
| select(.Vulnerabilities)
jq -r '.Results[]
| select(.Vulnerabilities)
| .Vulnerabilities
# Ignore packages with "kernel" in the PkgName
| map(select(.PkgName | test("kernel") | not ))
Expand All @@ -82,9 +82,17 @@ for image in $images; do
.[0].PrimaryURL,
.[0].Severity
]
)
| .[]
)
| .[]
| @csv' image-scan-output/${filename}.json >> image-scan-output/${filename}.summary.csv

if [ $(grep "CRITICAL" image-scan-output/${filename}.summary.csv -c) -gt 0 ]; then
# If the image contains critical vulnerabilities, add the image to critical list
echo "${image}" >> image-scan-output/critical-images.txt
else
# Otherwise, add the image to the dirty list
echo "${image}" >> image-scan-output/dirty-images.txt
fi
fi
rm .trivyignore
done
Loading