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

eBPF turn-off without Power #1677

Merged
merged 3 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 0 additions & 9 deletions .github/workflows/collector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,6 @@ jobs:
driver_version: ${DRIVER_VERSION}
EOF

- name: Download drivers
if: matrix.arch == 'ppc64le'
run: |
mkdir -p "${CONTEXT_DRIVERS_DIR}"

GCP_BUCKET="gs://${{ inputs.arch-drivers-bucket }}/${{ matrix.arch }}"
gsutil -m rsync -r "${GCP_BUCKET}/${DRIVER_VERSION}/" \
"${CONTEXT_DRIVERS_DIR}"

- name: Build images
if: |
github.event_name == 'push' ||
Expand Down
31 changes: 0 additions & 31 deletions .github/workflows/cpaas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,37 +89,6 @@ jobs:
username: ${{ secrets.QUAY_STACKROX_IO_RW_USERNAME }}
password: ${{ secrets.QUAY_STACKROX_IO_RW_PASSWORD }}

- name: Login to quay.io/stackrox-io
if: matrix.arch == 'ppc64le'
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_STACKROX_IO_RW_USERNAME }}
password: ${{ secrets.QUAY_STACKROX_IO_RW_PASSWORD }}

- name: Create Power image
if: matrix.arch == 'ppc64le'
run: |
#
# This is a fairly rough-and-ready approach to full images
# because we only need drivers in the Power image. An alternative
# would be a separate Dockerfile for this, but considering this
# is a temporary edge case to our support matrix, and these upstream
# images are only used for testing, this has been deemed Good Enough (tm)
#

docker create --name drivers --platform linux/${{ matrix.arch }} "${DRIVERS_IMAGE}"
docker create --name power --platform linux/${{ matrix.arch }} "${DOWNSTREAM_COLLECTOR_IMAGE}"

# using - as the src or dest allows streaming between containers
docker cp "drivers:/kernel-modules/${DRIVER_VERSION}/" - | docker cp - power:/kernel-modules/

# make and push a new image that contains the drivers.
docker commit power ${{ needs.init.outputs.collector-image }}-cpaas-${{ matrix.arch }}
docker push ${{ needs.init.outputs.collector-image }}-cpaas-${{ matrix.arch }}

docker rm power drivers

multiarch-manifest:
runs-on: ubuntu-latest
env:
Expand Down
12 changes: 7 additions & 5 deletions ansible/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ runtime_socket: /var/run/docker.sock
redhat_username: "{{ lookup('env', 'REDHAT_USERNAME', default='') }}"
redhat_password: "{{ lookup('env', 'REDHAT_PASSWORD', default='') }}"

excluded_pairs:
# e.g. - ['ubuntu-1804-lts', 'core_bpf']
- ['rhel-8.8-05102023', 'ebpf']
- ['rhel-86-05162022', 'core_bpf']
excluded_vms:
# Specify, family, image, or platform
# e.g.
# - ubuntu-1804-lts
# - rhel-arm64
# - rhcos-413-86-202303151429-0-gcp-x86-64
-

virtual_machines:
rhel:
Expand Down Expand Up @@ -49,7 +52,6 @@ virtual_machines:
arch: ppc64le
ssh_key_file: "~/.ssh/acs-ppc64le-rsa.prv"
images:
- rhel-86-05162022
- rhel-8.8-05102023

rhel-sap:
Expand Down
17 changes: 4 additions & 13 deletions ansible/roles/create-vm/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
---

#
# Exclusion precedence:
# 1. ppc64le is the only platform allowed to run eBPF
# 2. specific exclusions defined group_vars/all.yml
#
# Consider each set_fact to be a rule, and subsequent rules are only
# processed if the previous rules do not exclude this combination of
# vm and collection method.
#
- name: Check eBPF excluded
- name: Check platform excluded
set_fact:
excluded: "{{ test_platform != 'rhel-ppc64le' and vm_collection_method == 'ebpf' }}"
excluded: "{{ test_platform in excluded_vms }}"

- name: Check family excluded
set_fact:
excluded: "{{ [vm_family, vm_collection_method] in excluded_pairs }}"
excluded: "{{ vm_family in excluded_vms }}"
when: vm_image is not defined and excluded == false

- name: Check image excluded
set_fact:
excluded: "{{ [vm_image, vm_collection_method] in excluded_pairs }}"
excluded: "{{ vm_image in excluded_vms }}"
when: vm_image is defined and excluded == false

- block:
Expand Down
3 changes: 1 addition & 2 deletions collector/lib/HostHeuristics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ class PowerHeuristic : public Heuristic {
}

if (k.kernel == 4 && k.major == 18 && k.build_id < 477) {
CLOG(INFO) << "RHEL 8.6 (kernel < 4.18.0-477) on ppc64le does not support CORE_BPF, switching to eBPF collection method.";
hconfig->SetCollectionMethod(CollectionMethod::EBPF);
CLOG(FATAL) << "RHEL 8.6 (kernel < 4.18.0-477) on ppc64le does not support CORE_BPF";
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion kernel-modules/build/prepare-src
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ cp -r "${DRIVER_DIR}/." "${DRIVER_SCRATCH}"
module_version="$(get_module_version .)"
echo "$module_version"

if (($(compare_version "$module_version" "2.10.0") >= 1)) && [[ "$(uname -m)" != "ppc64le" ]]; then
if (($(compare_version "$module_version" "2.10.0") >= 1)); then
# Dont build drivers for versions 2.10 or newer
echo "Not building drivers for module version $module_version on $(uname -m)"
exit 0
Expand Down
Loading