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

ROX-20235: build collector-full on Konflux #1441

Merged
merged 124 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
7ff08c8
add custom Dockerfile for rhtap
tommartensen Oct 16, 2023
1c6a49d
Red Hat Trusted App Pipeline update collector (#1367)
red-hat-konflux[bot] Oct 16, 2023
69200d7
RHTAP: fix workspace size for checkouts (#1368)
tommartensen Oct 16, 2023
7410e30
broken dnf installs
tommartensen Oct 17, 2023
4399cad
Update RHTAP references (#1375)
red-hat-konflux[bot] Oct 19, 2023
37b0c74
Update RHTAP references (#1378)
red-hat-konflux[bot] Oct 23, 2023
80d6c38
use centos instead of ubi images
tommartensen Oct 25, 2023
8cc0a9a
Merge branch 'tm/rhtap-onboarding' of github.com:stackrox/collector i…
tommartensen Oct 25, 2023
8b4d052
Update RHTAP references (#1387)
red-hat-konflux[bot] Nov 6, 2023
3a55302
Merge branch 'master' into tm/rhtap-onboarding
tommartensen Nov 6, 2023
6945989
update pipelines
tommartensen Nov 6, 2023
a1811d5
increase storage for shared volume in pipeline
tommartensen Nov 6, 2023
157b8d0
falco submodule
tommartensen Nov 6, 2023
b26118c
update TODOs and LABELs
tommartensen Nov 6, 2023
807015c
restore falco
tommartensen Nov 6, 2023
6ade98a
clean up
tommartensen Nov 9, 2023
0d4cef0
Red Hat Trusted App Pipeline update collector-slim (#1414)
red-hat-konflux[bot] Nov 9, 2023
1ea2eb2
rename collector -> collector-slim
tommartensen Nov 9, 2023
3db110e
finish up
tommartensen Nov 13, 2023
56abbd3
Merge branch 'master' into tm/rhtap-onboarding
tommartensen Nov 13, 2023
346e7a4
fix build after rebase
tommartensen Nov 13, 2023
49f6bcd
Update RHTAP references (#1415)
red-hat-konflux[bot] Nov 13, 2023
f4d9d03
more oomph
tommartensen Nov 13, 2023
4f2e97e
Merge branch 'tm/rhtap-onboarding' of github.com:stackrox/collector i…
tommartensen Nov 13, 2023
a225b95
Update RHTAP references (#1420)
red-hat-konflux[bot] Nov 14, 2023
a8c55ee
attempt with default buildah size
tommartensen Nov 14, 2023
4f41bb5
fix task ref
tommartensen Nov 14, 2023
7ec670a
Update RHTAP references (#1421)
red-hat-konflux[bot] Nov 14, 2023
3957e05
Update RHTAP references (#1422)
red-hat-konflux[bot] Nov 15, 2023
a7bff4d
RHTAP Onboarding: 2nd attempt (#1425)
tommartensen Nov 17, 2023
e2bf0b3
move dockerfile
tommartensen Nov 20, 2023
b1eea97
emptyg
tommartensen Nov 20, 2023
780e997
disable prefetch-input
tommartensen Nov 20, 2023
bb8cfa8
remove guard on prefetch-dependencies task
tommartensen Nov 20, 2023
f4512eb
clean up Dockerfile
tommartensen Nov 20, 2023
119ff0a
add CODEOWNERS
tommartensen Nov 20, 2023
4c57a27
Merge branch 'master' into tm/rhtap-onboarding
tommartensen Nov 21, 2023
156c0e1
rename Dockerfile for slim
tommartensen Nov 21, 2023
136c719
add Dockerfile
tommartensen Nov 21, 2023
19f4097
Red Hat Trusted App Pipeline update collector (#1440)
red-hat-konflux[bot] Nov 21, 2023
a927ae5
update pipelines with ACS settings
tommartensen Nov 21, 2023
9481e8d
download support packages
tommartensen Nov 21, 2023
095206f
add pipeline timeout override
tommartensen Nov 21, 2023
67d1366
.
tommartensen Nov 21, 2023
81e42c1
.
tommartensen Nov 21, 2023
765da8a
.
tommartensen Nov 22, 2023
124b2b0
Update RHTAP references (#1445)
red-hat-konflux[bot] Nov 27, 2023
6b393ab
Update RHTAP references (#1444)
red-hat-konflux[bot] Nov 27, 2023
3f5a901
Update .tekton/collector-slim-pull-request.yaml
tommartensen Nov 27, 2023
b867082
some recommendations from PR
tommartensen Nov 27, 2023
e3ea3cc
restrict pipeline for *rhtap* branches
tommartensen Nov 28, 2023
f62607e
cleanup
tommartensen Dec 4, 2023
ce0f293
Update RHTAP references (#1452)
red-hat-konflux[bot] Dec 4, 2023
fc214da
empty
tommartensen Dec 4, 2023
5adbce7
empty to check new pod limits
tommartensen Dec 4, 2023
9e2bcb1
Update RHTAP references (#1455)
red-hat-konflux[bot] Dec 5, 2023
ac2e9d8
empty commit
tommartensen Dec 5, 2023
8d41a38
test with CPU limits
tommartensen Dec 5, 2023
0710d12
Update RHTAP references (#1463)
red-hat-konflux[bot] Dec 6, 2023
b3d9d58
Update RHTAP references (#1451)
red-hat-konflux[bot] Dec 11, 2023
cc2fd34
Update RHTAP references (#1464)
red-hat-konflux[bot] Dec 11, 2023
7a5b8a1
Update RHTAP references (#1467)
red-hat-konflux[bot] Dec 12, 2023
05a86d4
update Dockerfile with midstream changes
tommartensen Dec 12, 2023
bc4405f
Merge branch 'tm/rhtap-onboarding' of github.com:stackrox/collector i…
tommartensen Dec 12, 2023
bda0de0
Apply suggestions from code review
tommartensen Dec 12, 2023
bc5cf90
Merge branch 'master' into tm/rhtap-onboarding
tommartensen Dec 12, 2023
d44cd27
Merge branch 'tm/rhtap-onboarding' of github.com:stackrox/collector i…
tommartensen Dec 12, 2023
fb4ded4
fix comment
tommartensen Dec 12, 2023
1541146
Update RHTAP references (#1471)
red-hat-konflux[bot] Dec 13, 2023
0fbf75f
setup Snyk for collector
tommartensen Dec 13, 2023
be05ea1
bump to get green RHTAP CI
tommartensen Dec 13, 2023
4801067
empty commit for retrigger
tommartensen Dec 14, 2023
27a21a1
update dockerfile
tommartensen Dec 14, 2023
cd82b6f
Merge branch 'tm/rhtap-onboarding' into tm/rhtap-full-collector
tommartensen Dec 14, 2023
0740eab
Merge branch 'master' into tm/rhtap-full-collector
tommartensen Jan 22, 2024
10ce270
update full collector image
tommartensen Jan 22, 2024
d105655
Update RHTAP references (tm/rhtap-full-collector) (#1468)
red-hat-konflux[bot] Jan 22, 2024
82f4b72
Merge branch 'master' into tm/rhtap-full-collector
tommartensen Jan 26, 2024
298ccf6
apply [d6d831d](https://github.com/stackrox/collector/commit/d6d831de…
tommartensen Jan 26, 2024
e790746
use drivers-build image as base for kernel-modules for all archs
tommartensen Jan 26, 2024
93d9e9e
fix?
tommartensen Jan 26, 2024
a11a6da
use RHTAP build image in integration tests
tommartensen Jan 26, 2024
44677f1
update image labels
tommartensen Jan 30, 2024
9eb749e
Update RHTAP references (#1527)
red-hat-konflux[bot] Feb 5, 2024
001d6ac
Update RHTAP references (#1530)
red-hat-konflux[bot] Feb 6, 2024
f668daa
use support packages again for x86 :/
tommartensen Feb 6, 2024
80df925
Merge branch 'tm/rhtap-full-collector' of github.com:stackrox/collect…
tommartensen Feb 6, 2024
bd0fe5c
Update RHTAP references (#1533)
red-hat-konflux[bot] Feb 7, 2024
a275600
clean up pre-review
tommartensen Feb 9, 2024
b9c172f
Merge branch 'tm/rhtap-full-collector' of github.com:stackrox/collect…
tommartensen Feb 9, 2024
65b2ca1
Merge branch 'master' into tm/rhtap-full-collector
tommartensen Feb 9, 2024
ff72a74
make shfmt happy
tommartensen Feb 9, 2024
915152f
also run for this branch
tommartensen Feb 9, 2024
ad0cd11
Update RHTAP references (#1534)
red-hat-konflux[bot] Feb 12, 2024
d689323
Merge branch 'master' into tm/rhtap-full-collector
tommartensen Feb 12, 2024
e162041
remove libinsp wrapper cleanup
tommartensen Feb 12, 2024
8930a66
bump support package version
tommartensen Feb 12, 2024
fc2d30d
update comment
tommartensen Feb 12, 2024
80a4142
Update collector/container/scripts/download-support-package.sh
tommartensen Feb 14, 2024
5c60d2a
Update collector/container/konflux.Dockerfile
tommartensen Feb 14, 2024
eea368d
Update collector/container/konflux.Dockerfile
tommartensen Feb 14, 2024
b1da270
remove timeout increase
tommartensen Feb 14, 2024
0c42fb3
fix comment: central-db -> collector
tommartensen Feb 14, 2024
4f11f1b
update tekton PipelineRun apiVersion to v1
tommartensen Feb 14, 2024
50e7f77
Update collector/container/konflux.Dockerfile
tommartensen Feb 14, 2024
6b32837
Update collector/container/konflux.Dockerfile
tommartensen Feb 14, 2024
eb379f8
Update collector/container/konflux.Dockerfile
tommartensen Feb 14, 2024
c7c67bb
Revert "remove timeout increase"
tommartensen Feb 14, 2024
109e35b
revert: add timeout 1h30m to pipelines
tommartensen Feb 14, 2024
90535d5
simplify conditional for checking if modules are extracted
tommartensen Feb 14, 2024
b688cac
move support package download to pipeline step
tommartensen Feb 14, 2024
0cde4ec
debug
tommartensen Feb 14, 2024
a9e8c02
chore(deps): update rhtap references (#1555)
red-hat-konflux[bot] Feb 15, 2024
7196c68
Update collector/container/scripts/download-support-package.sh
tommartensen Feb 15, 2024
e90c536
update JIRA link
tommartensen Feb 15, 2024
e1db3ed
clean up
tommartensen Feb 15, 2024
1abb618
add parameter for exposing clone-submodules
tommartensen Feb 15, 2024
2105aea
remove comment according to https://gitlab.cee.redhat.com/stackrox/rh…
tommartensen Feb 15, 2024
6f31794
update push pipeline
tommartensen Feb 15, 2024
53e797a
move cd to script
tommartensen Feb 15, 2024
8e4c170
do dir manipulation in script
tommartensen Feb 16, 2024
5be8033
fix path to the download script
tommartensen Feb 16, 2024
40e8fde
move module_version to parameter
tommartensen Feb 16, 2024
e334c3f
cosmetics
tommartensen Feb 16, 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
24 changes: 22 additions & 2 deletions .tekton/collector-pull-request.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: tekton.dev/v1beta1
apiVersion: tekton.dev/v1
kind: PipelineRun

msugakov marked this conversation as resolved.
Show resolved Hide resolved
metadata:
Expand Down Expand Up @@ -38,7 +38,7 @@ spec:
# TODO(ROX-20234): Enable hermetic builds
# - name: hermetic
# value: "true"
# No language dependencies are required for central-db image.
# No language dependencies are required for collector image.
- name: prefetch-input
value: ''

Expand All @@ -58,6 +58,7 @@ spec:
secret:
secretName: '{{ git_auth_secret }}'

# The pipeline regularly takes >1h to finish.
timeouts:
pipeline: 1h30m0s

Expand Down Expand Up @@ -179,6 +180,7 @@ spec:
- name: kind
value: task
resolver: bundles

- name: clone-repository
params:
- name: url
Expand All @@ -205,6 +207,7 @@ spec:
workspace: workspace
- name: basic-auth
workspace: git-auth

- name: prefetch-dependencies
params:
- name: input
Expand All @@ -224,6 +227,22 @@ spec:
- name: source
workspace: workspace

- name: fetch-support-package
runAfter:
msugakov marked this conversation as resolved.
Show resolved Hide resolved
- init
- clone-repository
taskSpec:
steps:
- name: fetch-support-package
image: registry.access.redhat.com/ubi8-minimal:latest
script: |
#!/usr/bin/env bash
"$(workspaces.source.path)/source/collector/container/scripts/download-support-package.sh" \
"$(workspaces.source.path)/source/staging"
workspaces:
- name: source
workspace: workspace

- name: build-container
params:
- name: IMAGE
Expand All @@ -242,6 +261,7 @@ spec:
value: $(tasks.clone-repository.results.commit)
runAfter:
- prefetch-dependencies
- fetch-support-package
taskRef:
params:
- name: name
Expand Down
8 changes: 6 additions & 2 deletions .tekton/collector-push.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: tekton.dev/v1beta1
apiVersion: tekton.dev/v1
kind: PipelineRun

metadata:
Expand Down Expand Up @@ -38,7 +38,7 @@ spec:
# TODO(ROX-20234): Enable hermetic builds
# - name: hermetic
# value: "true"
# No language dependencies are required for central-db image.
# No language dependencies are required for collector image.
- name: prefetch-input
value: ''

Expand All @@ -58,6 +58,10 @@ spec:
secret:
secretName: '{{ git_auth_secret }}'

# The pipeline regularly takes >1h to finish.
timeouts:
pipeline: 1h30m0s

pipelineSpec:

finally:
Expand Down
25 changes: 7 additions & 18 deletions collector/container/konflux.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -96,34 +96,24 @@ RUN ./builder/install/install-dependencies.sh && \
ctest -V --test-dir ${CMAKE_BUILD_DIR} && \
strip -v --strip-unneeded "${CMAKE_BUILD_DIR}/collector/collector"
msugakov marked this conversation as resolved.
Show resolved Hide resolved

FROM registry.access.redhat.com/ubi8/ubi-minimal:latest AS support-packages-downloader

WORKDIR /staging

COPY kernel-modules/MODULE_VERSION kernel-modules/MODULE_VERSION
COPY collector/container/scripts/download-support-package.sh download-support-package.sh

RUN ./download-support-package.sh

# Do NOT use follow_tag here, as we do not need or want collector to be rebuilt
# with each drivers build (which may become very frequent)
# 0.1.0 is a floating tag and it's used intentionally to pick up the most recent downstream drivers build without
# having to routinely and frequently bump tags here.
FROM brew.registry.redhat.io/rh-osbs/rhacs-drivers-build-rhel8:0.1.0 AS drivers-build
# FROM registry-proxy.engineering.redhat.com/rh-osbs/rhacs-drivers-build-rhel8:0.1.0 AS drivers-build

# TODO(ROX-20312): we can't pin image tag or digest because currently there's no mechanism to auto-update that.
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest AS unpacker

RUN microdnf install -y unzip findutils
WORKDIR /staging

COPY --from=support-packages-downloader /staging/support-pkg.zip /staging/
COPY staging/support-pkg.zip /staging/
msugakov marked this conversation as resolved.
Show resolved Hide resolved
COPY kernel-modules/MODULE_VERSION MODULE_VERSION.txt
# Creating this directory ensures the scratch build with dummy support-pkg.zip will not fail.
RUN mkdir -p "/staging/kernel-modules/$(cat MODULE_VERSION.txt)"

# First, unpack upstream support package, only on x86_64
RUN if [[ "$(uname -m)" == x86_64 ]]; then unzip support-pkg.zip ; fi
# Fail non-scratch build if there were no drivers matching the module version.
RUN if [[ "$(uname -m)" == x86_64 && "$(ls -A /staging/kernel-modules/$(cat MODULE_VERSION.txt))" == "" && "$(unzip -Z1 support-pkg.zip)" != "dummy-support-pkg" ]] ; then \
# Fail build if there were no drivers in the support package matching the module version.
RUN if [[ "$(uname -m)" == x86_64 && "$(ls -A /staging/kernel-modules/$(cat MODULE_VERSION.txt))" == "" ]] ; then \
>&2 echo "Did not find any kernel drivers for the module version $(cat MODULE_VERSION.txt) in the support package"; \
exit 1; \
fi
Expand All @@ -140,8 +130,7 @@ RUN mkdir /kernel-modules
# Move files for the current version to /kernel-modules
RUN find "/staging/kernel-modules/$(cat MODULE_VERSION.txt)/" -type f -exec mv -t /kernel-modules {} +
# Fail the build if at the end there were no drivers matching the module version.
RUN if [[ "$(ls -A /kernel-modules)" == "" && \
!("$(uname -m)" == x86_64 && "$(unzip -Z1 support-pkg.zip)" == "dummy-support-pkg") ]]; then \
RUN if [[ "$(ls -A /kernel-modules)" == "" ]]; then \
>&2 echo "Did not find any kernel drivers for the module version $(cat MODULE_VERSION.txt)."; \
exit 1; \
fi
Expand Down
13 changes: 8 additions & 5 deletions collector/container/scripts/download-support-package.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env bash

## Adapted from https://gitlab.cee.redhat.com/stackrox/rhacs-midstream/-/blob/rhacs-1.0-rhel-8/distgit/containers/rhacs-collector/pre-build-script.
## Adapted from https://gitlab.cee.redhat.com/stackrox/rhacs-midstream/-/blob/rhacs-1.0-rhel-8/distgit/containers/rhacs-collector/pre-build-script

set -euxo pipefail
set -euo pipefail

verify_downloaded_file() {
file=$1
Expand All @@ -14,6 +14,8 @@ verify_downloaded_file() {
}

main() {
TARGET_DIR="$1"

# TODO(ROX-22429): Set up process for Fast Stream Releases to update the support package version.
# Make sure to update this URL when releasing the new version of ACS.
# Get the most current link at https://cdn.stackrox.io/collector/support-packages/index.html
Expand All @@ -37,13 +39,14 @@ main() {
curl --fail --location --max-redirs 0 --output "${zip_file}" "${support_pkg}"
curl --fail --location --max-redirs 0 --output "${zip_file}.sha256" "${support_pkg}.sha256"

verify_downloaded_file "$zip_file"
verify_downloaded_file "${zip_file}"
verify_downloaded_file "${zip_file}.sha256"

sha256sum -c "${zip_file}.sha256"

# Rename the support package so the docker build can find it in the same place every build.
mv "$zip_file" "support-pkg.zip"
mkdir -p "${TARGET_DIR}"
mv "${zip_file}" "${TARGET_DIR}/support-pkg.zip"
tommartensen marked this conversation as resolved.
Show resolved Hide resolved
}

main
main "$@"
Loading