From bf8580a62edc0a1b724d720eb2a5267f17c3a025 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Wed, 12 Feb 2025 15:51:05 -0800 Subject: [PATCH 01/82] YAML --- .../yaml/windows/install-ebpf-xdp-hpc.yaml | 101 ++++++++++++++++++ test/e2e/yaml/windows/test-signing.yaml | 29 +++++ 2 files changed, 130 insertions(+) create mode 100644 test/e2e/yaml/windows/install-ebpf-xdp-hpc.yaml create mode 100644 test/e2e/yaml/windows/test-signing.yaml diff --git a/test/e2e/yaml/windows/install-ebpf-xdp-hpc.yaml b/test/e2e/yaml/windows/install-ebpf-xdp-hpc.yaml new file mode 100644 index 0000000000..bd3b9123c6 --- /dev/null +++ b/test/e2e/yaml/windows/install-ebpf-xdp-hpc.yaml @@ -0,0 +1,101 @@ +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: ebpf-xdp-deploy + namespace: ebpf-xdp-install + labels: + app: ebpf-xdp-deploy +spec: + selector: + matchLabels: + app: ebpf-xdp-deploy + template: + metadata: + labels: + app: ebpf-xdp-deploy + name: ebpf-xdp-deploy + spec: + nodeSelector: + kubernetes.azure.com/os-sku: Windows2022 + securityContext: + windowsOptions: + hostProcess: true + runAsUserName: "NT AUTHORITY\\SYSTEM" + hostNetwork: true + containers: + - name: ebpf-xdp-deploy + image: mcr.microsoft.com/windows/servercore:ltsc2022 + command: + - powershell.exe + - -command + - | + if (!(Test-Path -Path $(tempDir))) { + New-Item -ItemType Directory -Path $(tempDir) + } + + $ProgressPreference = 'SilentlyContinue' + # Download eBPF-for-Windows. + $packageEbpfUrl = "https://github.com/microsoft/ebpf-for-windows/releases/download/Release-v0.20.0/Build-x64-native-only-NativeOnlyRelease.zip" + Invoke-WebRequest -Uri $packageEbpfUrl -OutFile "$(tempDir)\Build-x64-native-only-NativeOnlyRelease.zip" + Expand-Archive -Path "$(tempDir)\Build-x64-native-only-NativeOnlyRelease.zip" -DestinationPath "$(tempDir)\Build-x64-native-only-NativeOnlyRelease\msi" + copy "$(tempDir)\Build-x64-native-only-NativeOnlyRelease\msi\Build-x64-native-only NativeOnlyRelease\*.msi" $(tempDir) + + # Download XDP-for-Windows. + $packageXdpUrl = "https://github.com/microsoft/xdp-for-windows/releases/download/v1.1.0%2Bbed474a/bin_Release_x64.zip" + Invoke-WebRequest -Uri $packageXdpUrl -OutFile "$(tempDir)\bin_Release_x64.zip" + Expand-Archive -Path "$(tempDir)\bin_Release_x64.zip" -DestinationPath "$(tempDir)\bin_Release_x64" + copy $(tempDir)\bin_Release_x64\amd64fre\xdp.cer $(tempDir) + + Invoke-WebRequest -Uri "https://github.com/microsoft/xdp-for-windows/releases/download/v1.1.0%2Bbed474a/xdp-for-windows.1.1.0.msi" -OutFile "$(tempDir)\xdp-for-windows.1.1.0.msi" + + tree /f $(tempDir) + + $installPath = ($pwd).Drive.Name + ":\ebpf-for-windows" + Write-Output "Installing eBPF for Windows" + Start-Process msiexec.exe -Wait -ArgumentList "/i eBPF-for-Windows.msi INSTALLFOLDER=$installPath ADDLOCAL=eBPF_Runtime_Components /qn" + Write-Output "eBPF for Windows installed" + sc.exe query ebpfcore + sc.exe query netebpfext + copy $installPath\ebpfapi.dll $(tempDir) + dir $(tempDir) + + $installPath = ($pwd).Drive.Name + ":\xdp-for-windows" + Write-Output "Installing XDP for Windows" + CertUtil.exe -addstore Root xdp.cer + CertUtil.exe -addstore TrustedPublisher xdp.cer + Start-Process msiexec.exe -Wait -ArgumentList "/i xdp-for-windows.1.1.0.msi INSTALLFOLDER=$installPath /qn" + sc.exe query xdp + reg.exe add HKLM\SYSTEM\CurrentControlSet\Services\xdp\Parameters /v XdpEbpfEnabled /d 1 /t REG_DWORD /f + net.exe stop xdp + net.exe start xdp + Write-Output "XDP for Windows installed" + dir $installPath + + imagePullPolicy: IfNotPresent + securityContext: + privileged: true + readinessProbe: + exec: + command: + - powershell.exe + - -command + - | + Test-Path "C:\wcn\scripts\ready_deploy" # Change the command to check readiness + initialDelaySeconds: 5 + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 60 + successThreshold: 1 + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.azure.com/mode + operator: In + values: + - user + - key: kubernetes.io/os + operator: In + values: + - windows diff --git a/test/e2e/yaml/windows/test-signing.yaml b/test/e2e/yaml/windows/test-signing.yaml new file mode 100644 index 0000000000..e51f8918ec --- /dev/null +++ b/test/e2e/yaml/windows/test-signing.yaml @@ -0,0 +1,29 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: enable-test-signing + namespace: default +spec: + template: + spec: + containers: + - name: enable-test-signing-container + image: mcr.microsoft.com/windows/servercore:ltsc2022 # Add a base image + command: + - powershell.exe + - -command + - | + # Enable Test Signing mode on the node + bcdedit /set testsigning on + bcdedit /set nointegritychecks off + Write-Host "Test-Signing enabled. System will restart now." + + # Request system reboot + Restart-Computer -Force + restartPolicy: Never + nodeSelector: + kubernetes.io/os: windows + securityContext: + windowsOptions: + runAsUserName: "NT AUTHORITY\\SYSTEM" + backoffLimit: 0 From de6cc80a10f9ed74db660ae56e1f60331a4b127f Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Wed, 12 Feb 2025 16:36:47 -0800 Subject: [PATCH 02/82] YAML#1 --- .../yaml/windows/install-ebpf-xdp-hpc.yaml | 62 ++++--------------- 1 file changed, 11 insertions(+), 51 deletions(-) diff --git a/test/e2e/yaml/windows/install-ebpf-xdp-hpc.yaml b/test/e2e/yaml/windows/install-ebpf-xdp-hpc.yaml index bd3b9123c6..14d6fb84f4 100644 --- a/test/e2e/yaml/windows/install-ebpf-xdp-hpc.yaml +++ b/test/e2e/yaml/windows/install-ebpf-xdp-hpc.yaml @@ -29,63 +29,23 @@ spec: - powershell.exe - -command - | - if (!(Test-Path -Path $(tempDir))) { - New-Item -ItemType Directory -Path $(tempDir) - } + $binaryDir = "C:\binaries" + if (!(Test-Path -Path $binaryDir)) { + New-Item -ItemType Directory -Path $binaryDir + } - $ProgressPreference = 'SilentlyContinue' - # Download eBPF-for-Windows. - $packageEbpfUrl = "https://github.com/microsoft/ebpf-for-windows/releases/download/Release-v0.20.0/Build-x64-native-only-NativeOnlyRelease.zip" - Invoke-WebRequest -Uri $packageEbpfUrl -OutFile "$(tempDir)\Build-x64-native-only-NativeOnlyRelease.zip" - Expand-Archive -Path "$(tempDir)\Build-x64-native-only-NativeOnlyRelease.zip" -DestinationPath "$(tempDir)\Build-x64-native-only-NativeOnlyRelease\msi" - copy "$(tempDir)\Build-x64-native-only-NativeOnlyRelease\msi\Build-x64-native-only NativeOnlyRelease\*.msi" $(tempDir) + $ProgressPreference = 'SilentlyContinue' + # Download eBPF-for-Windows. + $packageEbpfUrl = "https://github.com/microsoft/ebpf-for-windows/releases/download/Release-v0.20.0/Build-x64-native-only-NativeOnlyRelease.zip" + Invoke-WebRequest -Uri $packageEbpfUrl -OutFile "$(binaryDir)\Build-x64-native-only-NativeOnlyRelease.zip" + Expand-Archive -Path "$(binaryDir)\Build-x64-native-only-NativeOnlyRelease.zip" -DestinationPath "$(binaryDir)\Build-x64-native-only-NativeOnlyRelease\msi" + copy "$(binaryDir)\Build-x64-native-only-NativeOnlyRelease\msi\Build-x64-native-only NativeOnlyRelease\*.msi" $(binaryDir) - # Download XDP-for-Windows. - $packageXdpUrl = "https://github.com/microsoft/xdp-for-windows/releases/download/v1.1.0%2Bbed474a/bin_Release_x64.zip" - Invoke-WebRequest -Uri $packageXdpUrl -OutFile "$(tempDir)\bin_Release_x64.zip" - Expand-Archive -Path "$(tempDir)\bin_Release_x64.zip" -DestinationPath "$(tempDir)\bin_Release_x64" - copy $(tempDir)\bin_Release_x64\amd64fre\xdp.cer $(tempDir) - - Invoke-WebRequest -Uri "https://github.com/microsoft/xdp-for-windows/releases/download/v1.1.0%2Bbed474a/xdp-for-windows.1.1.0.msi" -OutFile "$(tempDir)\xdp-for-windows.1.1.0.msi" - - tree /f $(tempDir) - - $installPath = ($pwd).Drive.Name + ":\ebpf-for-windows" - Write-Output "Installing eBPF for Windows" - Start-Process msiexec.exe -Wait -ArgumentList "/i eBPF-for-Windows.msi INSTALLFOLDER=$installPath ADDLOCAL=eBPF_Runtime_Components /qn" - Write-Output "eBPF for Windows installed" - sc.exe query ebpfcore - sc.exe query netebpfext - copy $installPath\ebpfapi.dll $(tempDir) - dir $(tempDir) - - $installPath = ($pwd).Drive.Name + ":\xdp-for-windows" - Write-Output "Installing XDP for Windows" - CertUtil.exe -addstore Root xdp.cer - CertUtil.exe -addstore TrustedPublisher xdp.cer - Start-Process msiexec.exe -Wait -ArgumentList "/i xdp-for-windows.1.1.0.msi INSTALLFOLDER=$installPath /qn" - sc.exe query xdp - reg.exe add HKLM\SYSTEM\CurrentControlSet\Services\xdp\Parameters /v XdpEbpfEnabled /d 1 /t REG_DWORD /f - net.exe stop xdp - net.exe start xdp - Write-Output "XDP for Windows installed" - dir $installPath + Write-Host "EBPF Downloaded" imagePullPolicy: IfNotPresent securityContext: privileged: true - readinessProbe: - exec: - command: - - powershell.exe - - -command - - | - Test-Path "C:\wcn\scripts\ready_deploy" # Change the command to check readiness - initialDelaySeconds: 5 - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 60 - successThreshold: 1 affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: From 1359975ccb73cc404a9b6d6f64077b46f64515a7 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Thu, 13 Feb 2025 08:36:28 -0800 Subject: [PATCH 03/82] E2E Comp tests - Node not restarting --- .../yaml/windows/install-ebpf-xdp-hpc.yaml | 91 ++++++++++--------- test/e2e/yaml/windows/test-signing.yaml | 25 +++-- 2 files changed, 59 insertions(+), 57 deletions(-) diff --git a/test/e2e/yaml/windows/install-ebpf-xdp-hpc.yaml b/test/e2e/yaml/windows/install-ebpf-xdp-hpc.yaml index 14d6fb84f4..27267f8168 100644 --- a/test/e2e/yaml/windows/install-ebpf-xdp-hpc.yaml +++ b/test/e2e/yaml/windows/install-ebpf-xdp-hpc.yaml @@ -1,61 +1,66 @@ -apiVersion: apps/v1 -kind: DaemonSet +apiVersion: batch/v1 +kind: Job metadata: - name: ebpf-xdp-deploy + name: ebpf-xdp-install namespace: ebpf-xdp-install - labels: - app: ebpf-xdp-deploy spec: - selector: - matchLabels: - app: ebpf-xdp-deploy template: - metadata: - labels: - app: ebpf-xdp-deploy - name: ebpf-xdp-deploy spec: - nodeSelector: - kubernetes.azure.com/os-sku: Windows2022 - securityContext: - windowsOptions: - hostProcess: true - runAsUserName: "NT AUTHORITY\\SYSTEM" - hostNetwork: true containers: - - name: ebpf-xdp-deploy + - name: ebpf-xdp-install-container image: mcr.microsoft.com/windows/servercore:ltsc2022 command: - powershell.exe - -command - | - $binaryDir = "C:\binaries" + # Enable Test Signing mode on the node + $binaryDir = "C:\\binaries" if (!(Test-Path -Path $binaryDir)) { - New-Item -ItemType Directory -Path $binaryDir + New-Item -ItemType Directory -Path $binaryDir } $ProgressPreference = 'SilentlyContinue' # Download eBPF-for-Windows. - $packageEbpfUrl = "https://github.com/microsoft/ebpf-for-windows/releases/download/Release-v0.20.0/Build-x64-native-only-NativeOnlyRelease.zip" - Invoke-WebRequest -Uri $packageEbpfUrl -OutFile "$(binaryDir)\Build-x64-native-only-NativeOnlyRelease.zip" - Expand-Archive -Path "$(binaryDir)\Build-x64-native-only-NativeOnlyRelease.zip" -DestinationPath "$(binaryDir)\Build-x64-native-only-NativeOnlyRelease\msi" - copy "$(binaryDir)\Build-x64-native-only-NativeOnlyRelease\msi\Build-x64-native-only NativeOnlyRelease\*.msi" $(binaryDir) + $packageEbpfUrl = "https://github.com/microsoft/ebpf-for-windows/releases/download/Release-v0.18.0/Build-x64-native-only-NativeOnlyRelease.zip" + Invoke-WebRequest -Uri $packageEbpfUrl -OutFile "$binaryDir\\Build-x64-native-only-NativeOnlyRelease.zip" + Expand-Archive -Path "$binaryDir\\Build-x64-native-only-NativeOnlyRelease.zip" -DestinationPath "$binaryDir\\Build-x64-native-only-NativeOnlyRelease\\msi" + copy "$binaryDir\\Build-x64-native-only-NativeOnlyRelease\\msi\\Build-x64-native-only NativeOnlyRelease\\*.msi" $binaryDir + + # Download XDP-for-Windows. + $packageXdpUrl = "https://github.com/microsoft/xdp-for-windows/releases/download/v1.1.0%2Bbed474a/bin_Release_x64.zip" + Invoke-WebRequest -Uri $packageXdpUrl -OutFile "$binaryDir\\bin_Release_x64.zip" + Expand-Archive -Path "$binaryDir\\bin_Release_x64.zip" -DestinationPath "$binaryDir\\bin_Release_x64" + copy "$binaryDir\\bin_Release_x64\\amd64fre\\xdp.cer" $binaryDir + + Invoke-WebRequest -Uri "https://github.com/microsoft/xdp-for-windows/releases/download/v1.1.0%2Bbed474a/xdp-for-windows.1.1.0.msi" -OutFile "$binaryDir\\xdp-for-windows.1.1.0.msi" - Write-Host "EBPF Downloaded" + tree /f $binaryDir - imagePullPolicy: IfNotPresent - securityContext: - privileged: true - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: kubernetes.azure.com/mode - operator: In - values: - - user - - key: kubernetes.io/os - operator: In - values: - - windows + $installPath = ($pwd).Drive.Name + ":\ebpf-for-windows" + Write-Output "Installing eBPF for Windows" + Start-Process msiexec.exe -Wait -ArgumentList "/i eBPF-for-Windows.msi INSTALLFOLDER=$installPath ADDLOCAL=eBPF_Runtime_Components /qn" + Write-Output "eBPF for Windows installed" + sc.exe query ebpfcore + sc.exe query netebpfext + copy "$installPath\\ebpfapi.dll" $binaryDir + dir $binaryDir + + $installPath = ($pwd).Drive.Name + ":\xdp-for-windows" + Write-Output "Installing XDP for Windows" + CertUtil.exe -addstore Root xdp.cer + CertUtil.exe -addstore TrustedPublisher xdp.cer + Start-Process msiexec.exe -Wait -ArgumentList "/i xdp-for-windows.1.1.0.msi INSTALLFOLDER=$installPath /qn" + sc.exe query xdp + reg.exe add HKLM\\SYSTEM\\CurrentControlSet\\Services\\xdp\\Parameters /v XdpEbpfEnabled /d 1 /t REG_DWORD /f + net.exe stop xdp + net.exe start xdp + Write-Output "XDP for Windows installed" + dir $installPath + + restartPolicy: Never + nodeSelector: + kubernetes.io/os: windows + securityContext: + windowsOptions: + runAsUserName: "NT AUTHORITY\\SYSTEM" + backoffLimit: 0 \ No newline at end of file diff --git a/test/e2e/yaml/windows/test-signing.yaml b/test/e2e/yaml/windows/test-signing.yaml index e51f8918ec..f3186b6e08 100644 --- a/test/e2e/yaml/windows/test-signing.yaml +++ b/test/e2e/yaml/windows/test-signing.yaml @@ -6,24 +6,21 @@ metadata: spec: template: spec: + hostNetwork: true # Required for HostProcess + nodeSelector: + kubernetes.io/os: windows + securityContext: + windowsOptions: + hostProcess: true + runAsUserName: "NT AUTHORITY\\SYSTEM" containers: - name: enable-test-signing-container - image: mcr.microsoft.com/windows/servercore:ltsc2022 # Add a base image + image: mcr.microsoft.com/windows/servercore:ltsc2022 command: - powershell.exe - -command - | - # Enable Test Signing mode on the node + Write-Host "Test-Signing enabled." bcdedit /set testsigning on - bcdedit /set nointegritychecks off - Write-Host "Test-Signing enabled. System will restart now." - - # Request system reboot - Restart-Computer -Force - restartPolicy: Never - nodeSelector: - kubernetes.io/os: windows - securityContext: - windowsOptions: - runAsUserName: "NT AUTHORITY\\SYSTEM" - backoffLimit: 0 + Start-Sleep -Seconds 5 + shutdown.exe /r /t 5 /f \ No newline at end of file From 1dff2d0df5a8a71de0426a1c6ec849a00b73ec6a Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Thu, 13 Feb 2025 21:22:29 -0800 Subject: [PATCH 04/82] E2E Comp tests - Node not restarting#4 --- .github/workflows/e2e.yaml | 3 +-- controller/Dockerfile | 12 ++++++++---- test/e2e/yaml/windows/test-signing.yaml | 9 +++------ .../plugin/eventwriter}/bpf_event_writer.c | 0 .../plugin/eventwriter}/event_writer.h | 0 .../plugin/eventwriter}/event_writer.sln | 0 .../plugin/eventwriter}/event_writer.vcxproj | 0 .../plugin/eventwriter}/event_writer.vcxproj.filters | 0 .../plugin/eventwriter}/event_writer.vcxproj.user | 0 .../plugin/eventwriter}/event_writer_api.cpp | 0 .../plugin/eventwriter}/event_writer_util.cpp | 0 .../plugin/eventwriter}/event_writer_util.h | 0 test/plugin/eventwriter/placeholder.go | 3 +++ 13 files changed, 15 insertions(+), 12 deletions(-) rename {pkg/plugin/ebpfwindows/event_writer => test/plugin/eventwriter}/bpf_event_writer.c (100%) rename {pkg/plugin/ebpfwindows/event_writer => test/plugin/eventwriter}/event_writer.h (100%) rename {pkg/plugin/ebpfwindows/event_writer => test/plugin/eventwriter}/event_writer.sln (100%) rename {pkg/plugin/ebpfwindows/event_writer => test/plugin/eventwriter}/event_writer.vcxproj (100%) rename {pkg/plugin/ebpfwindows/event_writer => test/plugin/eventwriter}/event_writer.vcxproj.filters (100%) rename {pkg/plugin/ebpfwindows/event_writer => test/plugin/eventwriter}/event_writer.vcxproj.user (100%) rename {pkg/plugin/ebpfwindows/event_writer => test/plugin/eventwriter}/event_writer_api.cpp (100%) rename {pkg/plugin/ebpfwindows/event_writer => test/plugin/eventwriter}/event_writer_util.cpp (100%) rename {pkg/plugin/ebpfwindows/event_writer => test/plugin/eventwriter}/event_writer_util.h (100%) create mode 100644 test/plugin/eventwriter/placeholder.go diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 157f09597b..796dbafe31 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -13,7 +13,6 @@ permissions: jobs: e2e: - if: ${{ github.event_name == 'merge_group' }} name: E2E runs-on: ubuntu-latest @@ -42,4 +41,4 @@ jobs: shell: bash run: | set -euo pipefail - go test -v ./test/e2e/. -timeout 60m -tags=e2e -count=1 -args -image-tag=$(make version) -image-registry=${{vars.ACR_NAME}} -image-namespace=${{github.repository}} + go test -v ./test/e2e/. -timeout 60m -tags=e2e -count=1 -args -image-tag=$(make version) -image-registry=${{vars.ACR_NAME}} -image-namespace=${{github.repository}} \ No newline at end of file diff --git a/controller/Dockerfile b/controller/Dockerfile index a8ae7f8e6e..a78cd203e1 100644 --- a/controller/Dockerfile +++ b/controller/Dockerfile @@ -11,7 +11,7 @@ FROM --platform=$TARGETPLATFORM mcr.microsoft.com/cbl-mariner/base/core@sha256:7 # mcr.microsoft.com/cbl-mariner/distroless/minimal:2.0 FROM --platform=$TARGETPLATFORM mcr.microsoft.com/cbl-mariner/distroless/minimal@sha256:db87903c5d4d9d6760e86a274914efd6a3bb5914c0b5a6c6b35350ec297fea4f AS mariner-distroless -# mcr.microsoft.com/windows/servercore:ltsc2019 +# mcr.microsoft.com/windows/servercore:ltsc2019 FROM --platform=$TARGETPLATFORM mcr.microsoft.com/windows/servercore@sha256:6fdf140282a2f809dae9b13fe441635867f0a27c33a438771673b8da8f3348a4 AS ltsc2019 # mcr.microsoft.com/windows/servercore:ltsc2022 @@ -21,7 +21,7 @@ FROM --platform=$TARGETPLATFORM mcr.microsoft.com/windows/servercore@sha256:4595 # build stages # intermediate go generate stage -FROM golang AS intermediate +FROM golang AS intermediate ARG APP_INSIGHTS_ID # set to enable AI telemetry ARG GOARCH=amd64 # default to amd64 ARG GOOS=linux # default to linux @@ -64,7 +64,7 @@ ARG GOOS=linux # default to linux ARG VERSION ENV GOARCH=${GOARCH} ENV GOOS=${GOOS} -RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -o /go/bin/retina/controller -ldflags "-X github.com/microsoft/retina/internal/buildinfo.Version="$VERSION" -X github.com/microsoft/retina/internal/buildinfo.ApplicationInsightsID="$APP_INSIGHTS_ID"" controller/main.go +RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -o /go/bin/retina/controller -ldflags "-X github.com/microsoft/retina/internal/buildinfo.Version="$VERSION" -X github.com/microsoft/retina/internal/buildinfo.ApplicationInsightsID="$APP_INSIGHTS_ID"" controller/main.go # init binary @@ -115,6 +115,10 @@ COPY --from=tools /lib/ /lib COPY --from=tools /usr/lib/ /usr/lib ENTRYPOINT ["./retina/initretina"] +# Build Event Writer +RUN if [ $PLATFORM = "windows/amd64" ] ; then \ + msbuild MySolution.sln /p:Configuration=Release \ + fi # agent final image # mcr.microsoft.com/cbl-mariner/distroless/minimal:2.0 @@ -133,7 +137,7 @@ ENV HUBBLE_SERVER=unix:///var/run/cilium/hubble.sock ENTRYPOINT ["./retina/controller"] -# agent final image for windows +# agent final image for windows FROM ${OS_VERSION} AS agent-win COPY --from=controller-bin /go/src/github.com/microsoft/retina/windows/kubeconfigtemplate.yaml kubeconfigtemplate.yaml COPY --from=controller-bin /go/src/github.com/microsoft/retina/windows/setkubeconfigpath.ps1 setkubeconfigpath.ps1 diff --git a/test/e2e/yaml/windows/test-signing.yaml b/test/e2e/yaml/windows/test-signing.yaml index f3186b6e08..f9a394ced4 100644 --- a/test/e2e/yaml/windows/test-signing.yaml +++ b/test/e2e/yaml/windows/test-signing.yaml @@ -13,14 +13,11 @@ spec: windowsOptions: hostProcess: true runAsUserName: "NT AUTHORITY\\SYSTEM" + restartPolicy: Never containers: - - name: enable-test-signing-container + - name: enable-test-signing image: mcr.microsoft.com/windows/servercore:ltsc2022 command: - powershell.exe - -command - - | - Write-Host "Test-Signing enabled." - bcdedit /set testsigning on - Start-Sleep -Seconds 5 - shutdown.exe /r /t 5 /f \ No newline at end of file + - "Write-Host 'Enable test signing'; bcdedit /set testsigning on; Start-Sleep -Seconds 5" \ No newline at end of file diff --git a/pkg/plugin/ebpfwindows/event_writer/bpf_event_writer.c b/test/plugin/eventwriter/bpf_event_writer.c similarity index 100% rename from pkg/plugin/ebpfwindows/event_writer/bpf_event_writer.c rename to test/plugin/eventwriter/bpf_event_writer.c diff --git a/pkg/plugin/ebpfwindows/event_writer/event_writer.h b/test/plugin/eventwriter/event_writer.h similarity index 100% rename from pkg/plugin/ebpfwindows/event_writer/event_writer.h rename to test/plugin/eventwriter/event_writer.h diff --git a/pkg/plugin/ebpfwindows/event_writer/event_writer.sln b/test/plugin/eventwriter/event_writer.sln similarity index 100% rename from pkg/plugin/ebpfwindows/event_writer/event_writer.sln rename to test/plugin/eventwriter/event_writer.sln diff --git a/pkg/plugin/ebpfwindows/event_writer/event_writer.vcxproj b/test/plugin/eventwriter/event_writer.vcxproj similarity index 100% rename from pkg/plugin/ebpfwindows/event_writer/event_writer.vcxproj rename to test/plugin/eventwriter/event_writer.vcxproj diff --git a/pkg/plugin/ebpfwindows/event_writer/event_writer.vcxproj.filters b/test/plugin/eventwriter/event_writer.vcxproj.filters similarity index 100% rename from pkg/plugin/ebpfwindows/event_writer/event_writer.vcxproj.filters rename to test/plugin/eventwriter/event_writer.vcxproj.filters diff --git a/pkg/plugin/ebpfwindows/event_writer/event_writer.vcxproj.user b/test/plugin/eventwriter/event_writer.vcxproj.user similarity index 100% rename from pkg/plugin/ebpfwindows/event_writer/event_writer.vcxproj.user rename to test/plugin/eventwriter/event_writer.vcxproj.user diff --git a/pkg/plugin/ebpfwindows/event_writer/event_writer_api.cpp b/test/plugin/eventwriter/event_writer_api.cpp similarity index 100% rename from pkg/plugin/ebpfwindows/event_writer/event_writer_api.cpp rename to test/plugin/eventwriter/event_writer_api.cpp diff --git a/pkg/plugin/ebpfwindows/event_writer/event_writer_util.cpp b/test/plugin/eventwriter/event_writer_util.cpp similarity index 100% rename from pkg/plugin/ebpfwindows/event_writer/event_writer_util.cpp rename to test/plugin/eventwriter/event_writer_util.cpp diff --git a/pkg/plugin/ebpfwindows/event_writer/event_writer_util.h b/test/plugin/eventwriter/event_writer_util.h similarity index 100% rename from pkg/plugin/ebpfwindows/event_writer/event_writer_util.h rename to test/plugin/eventwriter/event_writer_util.h diff --git a/test/plugin/eventwriter/placeholder.go b/test/plugin/eventwriter/placeholder.go new file mode 100644 index 0000000000..fd0225add9 --- /dev/null +++ b/test/plugin/eventwriter/placeholder.go @@ -0,0 +1,3 @@ +package cprog //nolint:all + +// This file is a placeholder to make Go include this directory when vendoring. From d8546ca01cccb2b1ae5d8f838fbd8d33b6cd81f4 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Thu, 13 Feb 2025 21:36:03 -0800 Subject: [PATCH 05/82] apply YAML config --- .github/workflows/e2e.yaml | 1 - .../framework/kubernetes/apply-yaml-config.go | 94 +++++++++++++++++++ test/e2e/yaml/windows/test-signing.yaml | 6 +- 3 files changed, 99 insertions(+), 2 deletions(-) create mode 100644 test/e2e/framework/kubernetes/apply-yaml-config.go diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 796dbafe31..7b350d71e8 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -28,7 +28,6 @@ jobs: - name: Az CLI login uses: azure/login@v2 - if: ${{ github.event_name == 'merge_group' }} with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} diff --git a/test/e2e/framework/kubernetes/apply-yaml-config.go b/test/e2e/framework/kubernetes/apply-yaml-config.go new file mode 100644 index 0000000000..4061e72881 --- /dev/null +++ b/test/e2e/framework/kubernetes/apply-yaml-config.go @@ -0,0 +1,94 @@ +package kubernetes + +import ( + "context" + "fmt" + "io/ioutil" + "log" + "os" + "path/filepath" + "time" + + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/tools/clientcmd" + "k8s.io/client-go/util/retry" + "k8s.io/client-go/util/yaml" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/util/wait" + "k8s.io/client-go/dynamic" +) + +const ( + applyTimeout = 10 * time.Minute +) + +type ApplyYamlConfig struct { + KubeConfigFilePath string + YamlFilePath string +} + +func (a *ApplyYamlConfig) Run() error { + ctx, cancel := context.WithTimeout(context.Background(), applyTimeout) + defer cancel() + + config, err := clientcmd.BuildConfigFromFlags("", a.KubeConfigFilePath) + if err != nil { + return fmt.Errorf("error building kubeconfig: %w", err) + } + + clientset, err := kubernetes.NewForConfig(config) + if err != nil { + return fmt.Errorf("error creating Kubernetes client: %w", err) + } + + dynamicClient, err := dynamic.NewForConfig(config) + if err != nil { + return fmt.Errorf("error creating dynamic client: %w", err) + } + + yamlFile, err := ioutil.ReadFile(a.YamlFilePath) + if err != nil { + return fmt.Errorf("error reading YAML file: %w", err) + } + + decoder := yaml.NewYAMLOrJSONDecoder(yamlFile, 100) + var rawObj unstructured.Unstructured + if err := decoder.Decode(&rawObj); err != nil { + return fmt.Errorf("error decoding YAML file: %w", err) + } + + gvk := rawObj.GroupVersionKind() + mapping, err := clientset.RESTMapper().RESTMapping(gvk.GroupKind(), gvk.Version) + if err != nil { + return fmt.Errorf("error getting REST mapping: %w", err) + } + + resourceInterface := dynamicClient.Resource(mapping.Resource).Namespace(rawObj.GetNamespace()) + _, err = resourceInterface.Create(ctx, &rawObj, metav1.CreateOptions{}) + if err != nil { + return fmt.Errorf("error applying YAML file: %w", err) + } + + log.Printf("applied YAML file: %s\n", a.YamlFilePath) + + return nil +} + +func (a *ApplyYamlConfig) Prevalidate() error { + _, err := os.Stat(a.YamlFilePath) + if os.IsNotExist(err) { + cwd, err := os.Getwd() + if err != nil { + return fmt.Errorf("failed to get current working directory %s: %w", cwd, err) + } + log.Printf("the current working directory %s", cwd) + return fmt.Errorf("YAML file not found at %s: working directory: %s: %w", a.YamlFilePath, cwd, err) + } + log.Printf("found YAML file at %s", a.YamlFilePath) + + return nil +} + +func (a *ApplyYamlConfig) Stop() error { + return nil +} \ No newline at end of file diff --git a/test/e2e/yaml/windows/test-signing.yaml b/test/e2e/yaml/windows/test-signing.yaml index f9a394ced4..7b3b4f0763 100644 --- a/test/e2e/yaml/windows/test-signing.yaml +++ b/test/e2e/yaml/windows/test-signing.yaml @@ -20,4 +20,8 @@ spec: command: - powershell.exe - -command - - "Write-Host 'Enable test signing'; bcdedit /set testsigning on; Start-Sleep -Seconds 5" \ No newline at end of file + - | + Write-Host 'Enable test signing' + bcdedit /set testsigning on + Start-Sleep -Seconds 5 + Restart-Computer localhost \ No newline at end of file From d4528ee4e95f66ab8377e314399b400ec95d2ae7 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Thu, 13 Feb 2025 22:19:13 -0800 Subject: [PATCH 06/82] Validate Cilium Metrics --- .../framework/kubernetes/apply-yaml-config.go | 150 +++++++++--------- test/e2e/scenarios/windows/cilium-metrics.go | 87 ++++++++++ .../e2e/yaml/windows/enable-test-signing.yaml | 27 ++++ test/e2e/yaml/windows/install-ebpf-xdp.yaml | 66 ++++++++ 4 files changed, 254 insertions(+), 76 deletions(-) create mode 100644 test/e2e/scenarios/windows/cilium-metrics.go create mode 100644 test/e2e/yaml/windows/enable-test-signing.yaml create mode 100644 test/e2e/yaml/windows/install-ebpf-xdp.yaml diff --git a/test/e2e/framework/kubernetes/apply-yaml-config.go b/test/e2e/framework/kubernetes/apply-yaml-config.go index 4061e72881..959002c2dc 100644 --- a/test/e2e/framework/kubernetes/apply-yaml-config.go +++ b/test/e2e/framework/kubernetes/apply-yaml-config.go @@ -1,94 +1,92 @@ package kubernetes import ( - "context" - "fmt" - "io/ioutil" - "log" - "os" - "path/filepath" - "time" - - "k8s.io/client-go/kubernetes" - "k8s.io/client-go/tools/clientcmd" - "k8s.io/client-go/util/retry" - "k8s.io/client-go/util/yaml" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/client-go/dynamic" + "context" + "fmt" + "io/ioutil" + "log" + "os" + "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/util/yaml" + "k8s.io/client-go/dynamic" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/tools/clientcmd" ) const ( - applyTimeout = 10 * time.Minute + applyTimeout = 10 * time.Minute ) type ApplyYamlConfig struct { - KubeConfigFilePath string - YamlFilePath string + KubeConfigFilePath string + YamlFilePath string } func (a *ApplyYamlConfig) Run() error { - ctx, cancel := context.WithTimeout(context.Background(), applyTimeout) - defer cancel() - - config, err := clientcmd.BuildConfigFromFlags("", a.KubeConfigFilePath) - if err != nil { - return fmt.Errorf("error building kubeconfig: %w", err) - } - - clientset, err := kubernetes.NewForConfig(config) - if err != nil { - return fmt.Errorf("error creating Kubernetes client: %w", err) - } - - dynamicClient, err := dynamic.NewForConfig(config) - if err != nil { - return fmt.Errorf("error creating dynamic client: %w", err) - } - - yamlFile, err := ioutil.ReadFile(a.YamlFilePath) - if err != nil { - return fmt.Errorf("error reading YAML file: %w", err) - } - - decoder := yaml.NewYAMLOrJSONDecoder(yamlFile, 100) - var rawObj unstructured.Unstructured - if err := decoder.Decode(&rawObj); err != nil { - return fmt.Errorf("error decoding YAML file: %w", err) - } - - gvk := rawObj.GroupVersionKind() - mapping, err := clientset.RESTMapper().RESTMapping(gvk.GroupKind(), gvk.Version) - if err != nil { - return fmt.Errorf("error getting REST mapping: %w", err) - } - - resourceInterface := dynamicClient.Resource(mapping.Resource).Namespace(rawObj.GetNamespace()) - _, err = resourceInterface.Create(ctx, &rawObj, metav1.CreateOptions{}) - if err != nil { - return fmt.Errorf("error applying YAML file: %w", err) - } - - log.Printf("applied YAML file: %s\n", a.YamlFilePath) - - return nil + ctx, cancel := context.WithTimeout(context.Background(), applyTimeout) + defer cancel() + + config, err := clientcmd.BuildConfigFromFlags("", a.KubeConfigFilePath) + if err != nil { + return fmt.Errorf("error building kubeconfig: %w", err) + } + + clientset, err := kubernetes.NewForConfig(config) + if err != nil { + return fmt.Errorf("error creating Kubernetes client: %w", err) + } + + dynamicClient, err := dynamic.NewForConfig(config) + if err != nil { + return fmt.Errorf("error creating dynamic client: %w", err) + } + + yamlFile, err := ioutil.ReadFile(a.YamlFilePath) + if err != nil { + return fmt.Errorf("error reading YAML file: %w", err) + } + + decoder := yaml.NewYAMLOrJSONDecoder(yamlFile, 100) + var rawObj unstructured.Unstructured + if err := decoder.Decode(&rawObj); err != nil { + return fmt.Errorf("error decoding YAML file: %w", err) + } + + gvk := rawObj.GroupVersionKind() + mapping, err := clientset.RESTMapper().RESTMapping(gvk.GroupKind(), gvk.Version) + if err != nil { + return fmt.Errorf("error getting REST mapping: %w", err) + } + + resourceInterface := dynamicClient.Resource(mapping.Resource).Namespace(rawObj.GetNamespace()) + _, err = resourceInterface.Create(ctx, &rawObj, metav1.CreateOptions{}) + if err != nil { + return fmt.Errorf("error applying YAML file: %w", err) + } + + log.Printf("applied YAML file: %s\n", a.YamlFilePath) + + return nil } func (a *ApplyYamlConfig) Prevalidate() error { - _, err := os.Stat(a.YamlFilePath) - if os.IsNotExist(err) { - cwd, err := os.Getwd() - if err != nil { - return fmt.Errorf("failed to get current working directory %s: %w", cwd, err) - } - log.Printf("the current working directory %s", cwd) - return fmt.Errorf("YAML file not found at %s: working directory: %s: %w", a.YamlFilePath, cwd, err) - } - log.Printf("found YAML file at %s", a.YamlFilePath) - - return nil + _, err := os.Stat(a.YamlFilePath) + if os.IsNotExist(err) { + cwd, err := os.Getwd() + if err != nil { + return fmt.Errorf("failed to get current working directory %s: %w", cwd, err) + } + log.Printf("the current working directory %s", cwd) + return fmt.Errorf("YAML file not found at %s: working directory: %s: %w", a.YamlFilePath, cwd, err) + } + log.Printf("found YAML file at %s", a.YamlFilePath) + + return nil } func (a *ApplyYamlConfig) Stop() error { - return nil -} \ No newline at end of file + return nil +} diff --git a/test/e2e/scenarios/windows/cilium-metrics.go b/test/e2e/scenarios/windows/cilium-metrics.go new file mode 100644 index 0000000000..845a9defcc --- /dev/null +++ b/test/e2e/scenarios/windows/cilium-metrics.go @@ -0,0 +1,87 @@ +package windows + +import ( + "context" + "fmt" + + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + kubernetes "k8s.io/client-go/kubernetes" + "k8s.io/client-go/tools/clientcmd" +) + +type ValidateCiliumMetric struct { + KubeConfigFilePath string + RetinaDaemonSetNamespace string + RetinaDaemonSetName string +} + +func (v *ValidateCiliumMetric) Run() error { + config, err := clientcmd.BuildConfigFromFlags("", v.KubeConfigFilePath) + if err != nil { + return fmt.Errorf("error building kubeconfig: %w", err) + } + + clientset, err := kubernetes.NewForConfig(config) + if err != nil { + return fmt.Errorf("error creating Kubernetes client: %w", err) + } + + pods, err := clientset.CoreV1().Pods(v.RetinaDaemonSetNamespace).List(context.TODO(), metav1.ListOptions{ + LabelSelector: "k8s-app=retina", + }) + if err != nil { + panic(err.Error()) + } + + var windowsRetinaPod *v1.Pod + for pod := range pods.Items { + if pods.Items[pod].Spec.NodeSelector["kubernetes.io/os"] == "windows" { + windowsRetinaPod = &pods.Items[pod] + } + } + if windowsRetinaPod == nil { + return ErrorNoWindowsPod + } + /* + labels := map[string]string{ + "direction": "win_packets_sent_count", + } + + log.Printf("checking for metric %s with labels %+v\n", hnsMetricName, labels) + + // wrap this in a retrier because windows is slow + var output []byte + err = defaultRetrier.Do(context.TODO(), func() error { + output, err = k8s.ExecPod(context.TODO(), clientset, config, windowsRetinaPod.Namespace, windowsRetinaPod.Name, fmt.Sprintf("curl -s http://localhost:%d/metrics", common.RetinaPort)) + if err != nil { + return fmt.Errorf("error executing command in windows retina pod: %w", err) + } + if len(output) == 0 { + return ErrNoMetricFound + } + + if err != nil { + return fmt.Errorf("failed to get metrics from windows retina pod: %w", err) + } + + err = prom.CheckMetricFromBuffer(output, hnsMetricName, labels) + if err != nil { + return fmt.Errorf("failed to verify prometheus metrics: %w", err) + } + + return nil + }) + + log.Printf("found metric matching %+v: with labels %+v\n", hnsMetricName, labels) + */ + return nil +} + +func (v *ValidateCiliumMetric) Prevalidate() error { + return nil +} + +func (v *ValidateCiliumMetric) Stop() error { + return nil +} diff --git a/test/e2e/yaml/windows/enable-test-signing.yaml b/test/e2e/yaml/windows/enable-test-signing.yaml new file mode 100644 index 0000000000..7b3b4f0763 --- /dev/null +++ b/test/e2e/yaml/windows/enable-test-signing.yaml @@ -0,0 +1,27 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: enable-test-signing + namespace: default +spec: + template: + spec: + hostNetwork: true # Required for HostProcess + nodeSelector: + kubernetes.io/os: windows + securityContext: + windowsOptions: + hostProcess: true + runAsUserName: "NT AUTHORITY\\SYSTEM" + restartPolicy: Never + containers: + - name: enable-test-signing + image: mcr.microsoft.com/windows/servercore:ltsc2022 + command: + - powershell.exe + - -command + - | + Write-Host 'Enable test signing' + bcdedit /set testsigning on + Start-Sleep -Seconds 5 + Restart-Computer localhost \ No newline at end of file diff --git a/test/e2e/yaml/windows/install-ebpf-xdp.yaml b/test/e2e/yaml/windows/install-ebpf-xdp.yaml new file mode 100644 index 0000000000..27267f8168 --- /dev/null +++ b/test/e2e/yaml/windows/install-ebpf-xdp.yaml @@ -0,0 +1,66 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: ebpf-xdp-install + namespace: ebpf-xdp-install +spec: + template: + spec: + containers: + - name: ebpf-xdp-install-container + image: mcr.microsoft.com/windows/servercore:ltsc2022 + command: + - powershell.exe + - -command + - | + # Enable Test Signing mode on the node + $binaryDir = "C:\\binaries" + if (!(Test-Path -Path $binaryDir)) { + New-Item -ItemType Directory -Path $binaryDir + } + + $ProgressPreference = 'SilentlyContinue' + # Download eBPF-for-Windows. + $packageEbpfUrl = "https://github.com/microsoft/ebpf-for-windows/releases/download/Release-v0.18.0/Build-x64-native-only-NativeOnlyRelease.zip" + Invoke-WebRequest -Uri $packageEbpfUrl -OutFile "$binaryDir\\Build-x64-native-only-NativeOnlyRelease.zip" + Expand-Archive -Path "$binaryDir\\Build-x64-native-only-NativeOnlyRelease.zip" -DestinationPath "$binaryDir\\Build-x64-native-only-NativeOnlyRelease\\msi" + copy "$binaryDir\\Build-x64-native-only-NativeOnlyRelease\\msi\\Build-x64-native-only NativeOnlyRelease\\*.msi" $binaryDir + + # Download XDP-for-Windows. + $packageXdpUrl = "https://github.com/microsoft/xdp-for-windows/releases/download/v1.1.0%2Bbed474a/bin_Release_x64.zip" + Invoke-WebRequest -Uri $packageXdpUrl -OutFile "$binaryDir\\bin_Release_x64.zip" + Expand-Archive -Path "$binaryDir\\bin_Release_x64.zip" -DestinationPath "$binaryDir\\bin_Release_x64" + copy "$binaryDir\\bin_Release_x64\\amd64fre\\xdp.cer" $binaryDir + + Invoke-WebRequest -Uri "https://github.com/microsoft/xdp-for-windows/releases/download/v1.1.0%2Bbed474a/xdp-for-windows.1.1.0.msi" -OutFile "$binaryDir\\xdp-for-windows.1.1.0.msi" + + tree /f $binaryDir + + $installPath = ($pwd).Drive.Name + ":\ebpf-for-windows" + Write-Output "Installing eBPF for Windows" + Start-Process msiexec.exe -Wait -ArgumentList "/i eBPF-for-Windows.msi INSTALLFOLDER=$installPath ADDLOCAL=eBPF_Runtime_Components /qn" + Write-Output "eBPF for Windows installed" + sc.exe query ebpfcore + sc.exe query netebpfext + copy "$installPath\\ebpfapi.dll" $binaryDir + dir $binaryDir + + $installPath = ($pwd).Drive.Name + ":\xdp-for-windows" + Write-Output "Installing XDP for Windows" + CertUtil.exe -addstore Root xdp.cer + CertUtil.exe -addstore TrustedPublisher xdp.cer + Start-Process msiexec.exe -Wait -ArgumentList "/i xdp-for-windows.1.1.0.msi INSTALLFOLDER=$installPath /qn" + sc.exe query xdp + reg.exe add HKLM\\SYSTEM\\CurrentControlSet\\Services\\xdp\\Parameters /v XdpEbpfEnabled /d 1 /t REG_DWORD /f + net.exe stop xdp + net.exe start xdp + Write-Output "XDP for Windows installed" + dir $installPath + + restartPolicy: Never + nodeSelector: + kubernetes.io/os: windows + securityContext: + windowsOptions: + runAsUserName: "NT AUTHORITY\\SYSTEM" + backoffLimit: 0 \ No newline at end of file From 8d9ac4eeed571e1de845c58012de5b3697b0e571 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Thu, 13 Feb 2025 22:20:04 -0800 Subject: [PATCH 07/82] Validate Cilium Metrics --- test/e2e/jobs/jobs.go | 23 +++++++ test/e2e/retina_e2e_test.go | 7 ++ test/e2e/scenarios/windows/scenario.go | 14 ++++ .../yaml/windows/install-ebpf-xdp-hpc.yaml | 66 ------------------- test/e2e/yaml/windows/test-signing.yaml | 27 -------- 5 files changed, 44 insertions(+), 93 deletions(-) delete mode 100644 test/e2e/yaml/windows/install-ebpf-xdp-hpc.yaml delete mode 100644 test/e2e/yaml/windows/test-signing.yaml diff --git a/test/e2e/jobs/jobs.go b/test/e2e/jobs/jobs.go index 375f69aa4e..dcbf534bae 100644 --- a/test/e2e/jobs/jobs.go +++ b/test/e2e/jobs/jobs.go @@ -106,6 +106,28 @@ func UninstallRetina(kubeConfigFilePath, chartPath string) *types.Job { return job } +func EnableTestSigningOn(kubeConfigFilePath string) *types.Job { + job := types.NewJob("Enable test signing on") + + job.AddStep(&kubernetes.ApplyYamlConfig{ + KubeConfigFilePath: kubeConfigFilePath, + YamlFilePath: "test/e2e/yaml/windows/enable-test-signing.yaml", + }, nil) + + return job +} + +func InstallEbpfXdp(kubeConfigFilePath string) *types.Job { + job := types.NewJob("Install ebpf and xdp") + + job.AddStep(&kubernetes.ApplyYamlConfig{ + KubeConfigFilePath: kubeConfigFilePath, + YamlFilePath: "test/e2e/yaml/windows/install-ebpf-xdp.yaml", + }, nil) + + return job +} + func InstallAndTestRetinaBasicMetrics(kubeConfigFilePath, chartPath string, testPodNamespace string) *types.Job { job := types.NewJob("Install and test Retina with basic metrics") @@ -170,6 +192,7 @@ func InstallAndTestRetinaBasicMetrics(kubeConfigFilePath, chartPath string, test job.AddScenario(windows.ValidateWindowsBasicMetric()) } + job.AddStep(&kubernetes.EnsureStableComponent{ PodNamespace: common.KubeSystemNamespace, LabelSelector: "k8s-app=retina", diff --git a/test/e2e/retina_e2e_test.go b/test/e2e/retina_e2e_test.go index 546f596bb5..84c6854aee 100644 --- a/test/e2e/retina_e2e_test.go +++ b/test/e2e/retina_e2e_test.go @@ -57,6 +57,13 @@ func TestE2ERetina(t *testing.T) { createTestInfra := types.NewRunner(t, jobs.CreateTestInfra(subID, rg, clusterName, location, kubeConfigFilePath, *common.CreateInfra)) createTestInfra.Run(ctx) + // Enable Test-Signing On + enableTestSigning := types.NewRunner(t, jobs.EnableTestSigningOn(kubeConfigFilePath)) + enableTestSigning.Run(ctx) + // Install Ebpf and XDP + installEbpfAndXDP := types.NewRunner(t, jobs.InstallEbpfAndXDP(kubeConfigFilePath)) + installEbpfAndXDP.Run(ctx) + t.Cleanup(func() { if *common.DeleteInfra { _ = jobs.DeleteTestInfra(subID, rg, clusterName, location).Run() diff --git a/test/e2e/scenarios/windows/scenario.go b/test/e2e/scenarios/windows/scenario.go index a452a04010..b1443c6679 100644 --- a/test/e2e/scenarios/windows/scenario.go +++ b/test/e2e/scenarios/windows/scenario.go @@ -18,3 +18,17 @@ func ValidateWindowsBasicMetric() *types.Scenario { } return types.NewScenario(name, steps...) } + +func ValidateCiliumBasicMetric() *types.Scenario { + name := "Cilium Windows Metrics" + steps := []*types.StepWrapper{ + { + Step: &ValidateCiliumMetric{ + KubeConfigFilePath: "./test.pem", + RetinaDaemonSetNamespace: common.KubeSystemNamespace, + RetinaDaemonSetName: "retina-agent-win", + }, + }, + } + return types.NewScenario(name, steps...) +} diff --git a/test/e2e/yaml/windows/install-ebpf-xdp-hpc.yaml b/test/e2e/yaml/windows/install-ebpf-xdp-hpc.yaml deleted file mode 100644 index 27267f8168..0000000000 --- a/test/e2e/yaml/windows/install-ebpf-xdp-hpc.yaml +++ /dev/null @@ -1,66 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: ebpf-xdp-install - namespace: ebpf-xdp-install -spec: - template: - spec: - containers: - - name: ebpf-xdp-install-container - image: mcr.microsoft.com/windows/servercore:ltsc2022 - command: - - powershell.exe - - -command - - | - # Enable Test Signing mode on the node - $binaryDir = "C:\\binaries" - if (!(Test-Path -Path $binaryDir)) { - New-Item -ItemType Directory -Path $binaryDir - } - - $ProgressPreference = 'SilentlyContinue' - # Download eBPF-for-Windows. - $packageEbpfUrl = "https://github.com/microsoft/ebpf-for-windows/releases/download/Release-v0.18.0/Build-x64-native-only-NativeOnlyRelease.zip" - Invoke-WebRequest -Uri $packageEbpfUrl -OutFile "$binaryDir\\Build-x64-native-only-NativeOnlyRelease.zip" - Expand-Archive -Path "$binaryDir\\Build-x64-native-only-NativeOnlyRelease.zip" -DestinationPath "$binaryDir\\Build-x64-native-only-NativeOnlyRelease\\msi" - copy "$binaryDir\\Build-x64-native-only-NativeOnlyRelease\\msi\\Build-x64-native-only NativeOnlyRelease\\*.msi" $binaryDir - - # Download XDP-for-Windows. - $packageXdpUrl = "https://github.com/microsoft/xdp-for-windows/releases/download/v1.1.0%2Bbed474a/bin_Release_x64.zip" - Invoke-WebRequest -Uri $packageXdpUrl -OutFile "$binaryDir\\bin_Release_x64.zip" - Expand-Archive -Path "$binaryDir\\bin_Release_x64.zip" -DestinationPath "$binaryDir\\bin_Release_x64" - copy "$binaryDir\\bin_Release_x64\\amd64fre\\xdp.cer" $binaryDir - - Invoke-WebRequest -Uri "https://github.com/microsoft/xdp-for-windows/releases/download/v1.1.0%2Bbed474a/xdp-for-windows.1.1.0.msi" -OutFile "$binaryDir\\xdp-for-windows.1.1.0.msi" - - tree /f $binaryDir - - $installPath = ($pwd).Drive.Name + ":\ebpf-for-windows" - Write-Output "Installing eBPF for Windows" - Start-Process msiexec.exe -Wait -ArgumentList "/i eBPF-for-Windows.msi INSTALLFOLDER=$installPath ADDLOCAL=eBPF_Runtime_Components /qn" - Write-Output "eBPF for Windows installed" - sc.exe query ebpfcore - sc.exe query netebpfext - copy "$installPath\\ebpfapi.dll" $binaryDir - dir $binaryDir - - $installPath = ($pwd).Drive.Name + ":\xdp-for-windows" - Write-Output "Installing XDP for Windows" - CertUtil.exe -addstore Root xdp.cer - CertUtil.exe -addstore TrustedPublisher xdp.cer - Start-Process msiexec.exe -Wait -ArgumentList "/i xdp-for-windows.1.1.0.msi INSTALLFOLDER=$installPath /qn" - sc.exe query xdp - reg.exe add HKLM\\SYSTEM\\CurrentControlSet\\Services\\xdp\\Parameters /v XdpEbpfEnabled /d 1 /t REG_DWORD /f - net.exe stop xdp - net.exe start xdp - Write-Output "XDP for Windows installed" - dir $installPath - - restartPolicy: Never - nodeSelector: - kubernetes.io/os: windows - securityContext: - windowsOptions: - runAsUserName: "NT AUTHORITY\\SYSTEM" - backoffLimit: 0 \ No newline at end of file diff --git a/test/e2e/yaml/windows/test-signing.yaml b/test/e2e/yaml/windows/test-signing.yaml deleted file mode 100644 index 7b3b4f0763..0000000000 --- a/test/e2e/yaml/windows/test-signing.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: enable-test-signing - namespace: default -spec: - template: - spec: - hostNetwork: true # Required for HostProcess - nodeSelector: - kubernetes.io/os: windows - securityContext: - windowsOptions: - hostProcess: true - runAsUserName: "NT AUTHORITY\\SYSTEM" - restartPolicy: Never - containers: - - name: enable-test-signing - image: mcr.microsoft.com/windows/servercore:ltsc2022 - command: - - powershell.exe - - -command - - | - Write-Host 'Enable test signing' - bcdedit /set testsigning on - Start-Sleep -Seconds 5 - Restart-Computer localhost \ No newline at end of file From e2849ef7171d0084e6e62fd2babda618bd8755b5 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Thu, 13 Feb 2025 22:24:38 -0800 Subject: [PATCH 08/82] Validate Cilium Metrics#1 --- test/e2e/jobs/jobs.go | 1 + 1 file changed, 1 insertion(+) diff --git a/test/e2e/jobs/jobs.go b/test/e2e/jobs/jobs.go index dcbf534bae..ce9c482c5e 100644 --- a/test/e2e/jobs/jobs.go +++ b/test/e2e/jobs/jobs.go @@ -190,6 +190,7 @@ func InstallAndTestRetinaBasicMetrics(kubeConfigFilePath, chartPath string, test } job.AddScenario(windows.ValidateWindowsBasicMetric()) + job.AddScenario(windows.ValidateCiliumBasicMetric()) } From 19f43c7174954e81adca605c319529304accdf9e Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Fri, 14 Feb 2025 00:01:57 -0800 Subject: [PATCH 09/82] DockerFile --- .../manifests/controller/helm/retina/values.yaml | 2 +- pkg/plugin/ebpfwindows/retinaebpfapi.lib | Bin 0 -> 2560 bytes test/e2e/jobs/jobs.go | 1 - test/image/Dockerfile | 3 ++- 4 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 pkg/plugin/ebpfwindows/retinaebpfapi.lib diff --git a/deploy/legacy/manifests/controller/helm/retina/values.yaml b/deploy/legacy/manifests/controller/helm/retina/values.yaml index fca1c1822d..ffd2162dfe 100644 --- a/deploy/legacy/manifests/controller/helm/retina/values.yaml +++ b/deploy/legacy/manifests/controller/helm/retina/values.yaml @@ -64,7 +64,7 @@ apiServer: logLevel: debug enabledPlugin_linux: '["dropreason","packetforward","linuxutil","dns"]' -enabledPlugin_win: '["hnsstats", "enabledPlugin_win"]' +enabledPlugin_win: '["hnsstats", "ebpfwindows", "enabledPlugin_win"]' enableTelemetry: false diff --git a/pkg/plugin/ebpfwindows/retinaebpfapi.lib b/pkg/plugin/ebpfwindows/retinaebpfapi.lib new file mode 100644 index 0000000000000000000000000000000000000000..4f94b942183d65f5fc628752d9e27ffe9dcdba78 GIT binary patch literal 2560 zcmcImOKTHR6#kMleFQ173Kl^~Y06`aM6Oq<( zE7mGYX;KX0iQ8h74FMPc0y{u(ALttd`fX8I+`yOFd+#h*wyW8$yn-yhxzRQKK!g6T=5a>D8F2yc_UZb7+ZBD;0X=h zNI~=p!VjZnUbD5aDLHkS1_xAs2nE3i3MTi2-Lz0+hz3F0Puj6wL1fQQ{cr z-oT|W0TQ3toXQ}^F}yXjXzEtET3)v!Cc!qe2q!klQw{5{b0Z3W9e5xl z?)-R8?LQE$3mijU5j2&YZbFbBpYDba-Zva&ch5#p-kCaSn-CP2N=DGG6hzMmI!9!< z$@DdH<&V#d=h)qmWX^_|eQ&P@KYphToV1@EyAJG2%5X7znSISgfg;(Lkb1WJA_dX2 z-8seBO?*emjV=)N8s%vTP`WVzrf`0{KKk`A+Bk7f$G5%xI`F!CDlX{Jw0ri|yF*Tv ikFFmV&rG`$o>`howtKPrY~)*tyx>>d)t`wo{P+d73`VQ~ literal 0 HcmV?d00001 diff --git a/test/e2e/jobs/jobs.go b/test/e2e/jobs/jobs.go index ce9c482c5e..c2731f576a 100644 --- a/test/e2e/jobs/jobs.go +++ b/test/e2e/jobs/jobs.go @@ -193,7 +193,6 @@ func InstallAndTestRetinaBasicMetrics(kubeConfigFilePath, chartPath string, test job.AddScenario(windows.ValidateCiliumBasicMetric()) } - job.AddStep(&kubernetes.EnsureStableComponent{ PodNamespace: common.KubeSystemNamespace, LabelSelector: "k8s-app=retina", diff --git a/test/image/Dockerfile b/test/image/Dockerfile index 8c681a3fee..1cd3ad2f63 100644 --- a/test/image/Dockerfile +++ b/test/image/Dockerfile @@ -2,7 +2,8 @@ # mcr.microsoft.com/oss/go/microsoft/golang:1.23.4-cbl-mariner2.0 FROM mcr.microsoft.com/oss/go/microsoft/golang@sha256:88225e171f29fe5f1f6ffca8eb659535b19b253354e43e1f4fc8a9bc67615ca1 AS builder ENV CGO_ENABLED=0 -COPY . /go/src/github.com/microsoft/retina +COPY . /go/src/github.com/microsoft/retina +RUN dir /go/src/github.com/microsoft/retina/pkg/plugin/ebpfwindows WORKDIR /go/src/github.com/microsoft/retina RUN tdnf install -y clang16 lld16 bpftool libbpf-devel make git RUN go generate /go/src/github.com/microsoft/retina/pkg/plugin/... From 606fe792254c90c4440c56f2d12cd8ecf9592fda Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Fri, 14 Feb 2025 00:09:34 -0800 Subject: [PATCH 10/82] DockerFile --- controller/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/controller/Dockerfile b/controller/Dockerfile index a78cd203e1..ddb899d54e 100644 --- a/controller/Dockerfile +++ b/controller/Dockerfile @@ -32,6 +32,7 @@ RUN if [ "$GOOS" = "linux" ] ; then \ fi COPY ./pkg/plugin /go/src/github.com/microsoft/retina/pkg/plugin WORKDIR /go/src/github.com/microsoft/retina +RUN dir /go/src/github.com/microsoft/retina/pkg/plugin/ebpfwindows RUN if [ "$GOOS" = "linux" ] ; then \ go mod init github.com/microsoft/retina; \ go generate -skip "mockgen" -x /go/src/github.com/microsoft/retina/pkg/plugin/...; \ From 0e307953297908fee0eb12abe74379c25b6215eb Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Fri, 14 Feb 2025 10:39:29 -0800 Subject: [PATCH 11/82] DockerFile - Images --- .github/workflows/images.yaml | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/.github/workflows/images.yaml b/.github/workflows/images.yaml index 4089df0fef..1d7ea98437 100644 --- a/.github/workflows/images.yaml +++ b/.github/workflows/images.yaml @@ -35,7 +35,6 @@ jobs: - name: Az CLI login uses: azure/login@v2 - if: ${{ github.event_name == 'merge_group' }} with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} @@ -46,18 +45,12 @@ jobs: run: | set -euo pipefail echo "TAG=$(make version)" >> $GITHUB_ENV - if [ "$IS_MERGE_GROUP" == "true" ]; then - az acr login -n ${{ vars.ACR_NAME }} - make retina-image \ - IMAGE_NAMESPACE=${{ github.repository }} \ - PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \ - IMAGE_REGISTRY=${{ vars.ACR_NAME }} \ - BUILDX_ACTION=--push - else - make retina-image \ - IMAGE_NAMESPACE=${{ github.repository }} \ - PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} - fi + az acr login -n ${{ vars.ACR_NAME }} + make retina-image \ + IMAGE_NAMESPACE=${{ github.repository }} \ + PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \ + IMAGE_REGISTRY=${{ vars.ACR_NAME }} \ + BUILDX_ACTION=--push env: IS_MERGE_GROUP: ${{ github.event_name == 'merge_group' }} @@ -85,7 +78,6 @@ jobs: - name: Az CLI login uses: azure/login@v2 - if: ${{ github.event_name == 'merge_group' }} with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} @@ -136,7 +128,6 @@ jobs: - name: Az CLI login uses: azure/login@v2 - if: ${{ github.event_name == 'merge_group' }} with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} @@ -185,7 +176,6 @@ jobs: - name: Az CLI login uses: azure/login@v2 - if: ${{ github.event_name == 'merge_group' }} with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} @@ -234,7 +224,6 @@ jobs: - name: Az CLI login uses: azure/login@v2 - if: ${{ github.event_name == 'merge_group' }} with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} @@ -261,7 +250,7 @@ jobs: IS_MERGE_GROUP: ${{ github.event_name == 'merge_group' }} manifests: - if: ${{ github.event_name == 'merge_group' && success('retina-images') && success('retina-win-images') && success('operator-images') && success('retina-shell-images')}} + if: ${{ success('retina-images') && success('retina-win-images') && success('operator-images') && success('retina-shell-images')}} name: Generate Manifests runs-on: ubuntu-latest needs: @@ -316,7 +305,6 @@ jobs: - name: Az CLI login uses: azure/login@v2 - if: ${{ github.event_name == 'merge_group' }} with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} From 82df833b947a9cb2000cb79f1a87cf62b6ed3eb0 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Fri, 14 Feb 2025 11:37:07 -0800 Subject: [PATCH 12/82] Push Images --- .github/workflows/images.yaml | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/.github/workflows/images.yaml b/.github/workflows/images.yaml index 1d7ea98437..0ff29c939d 100644 --- a/.github/workflows/images.yaml +++ b/.github/workflows/images.yaml @@ -35,6 +35,7 @@ jobs: - name: Az CLI login uses: azure/login@v2 + if: ${{ github.event_name == 'merge_group' }} with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} @@ -45,12 +46,18 @@ jobs: run: | set -euo pipefail echo "TAG=$(make version)" >> $GITHUB_ENV - az acr login -n ${{ vars.ACR_NAME }} - make retina-image \ - IMAGE_NAMESPACE=${{ github.repository }} \ - PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \ - IMAGE_REGISTRY=${{ vars.ACR_NAME }} \ - BUILDX_ACTION=--push + if [ "$IS_MERGE_GROUP" == "true" ]; then + az acr login -n ${{ vars.ACR_NAME }} + make retina-image \ + IMAGE_NAMESPACE=${{ github.repository }} \ + PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \ + IMAGE_REGISTRY=${{ vars.ACR_NAME }} \ + BUILDX_ACTION=--push + else + make retina-image \ + IMAGE_NAMESPACE=${{ github.repository }} \ + PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} + fi env: IS_MERGE_GROUP: ${{ github.event_name == 'merge_group' }} @@ -78,6 +85,7 @@ jobs: - name: Az CLI login uses: azure/login@v2 + if: ${{ github.event_name == 'merge_group' }} with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} @@ -101,6 +109,7 @@ jobs: IMAGE_NAMESPACE=${{ github.repository }} \ PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \ WINDOWS_YEARS=${{ matrix.year }} + BUILDX_ACTION=--push fi env: IS_MERGE_GROUP: ${{ github.event_name == 'merge_group' }} @@ -128,6 +137,7 @@ jobs: - name: Az CLI login uses: azure/login@v2 + if: ${{ github.event_name == 'merge_group' }} with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} @@ -176,6 +186,7 @@ jobs: - name: Az CLI login uses: azure/login@v2 + if: ${{ github.event_name == 'merge_group' }} with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} @@ -224,6 +235,7 @@ jobs: - name: Az CLI login uses: azure/login@v2 + if: ${{ github.event_name == 'merge_group' }} with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} @@ -250,7 +262,7 @@ jobs: IS_MERGE_GROUP: ${{ github.event_name == 'merge_group' }} manifests: - if: ${{ success('retina-images') && success('retina-win-images') && success('operator-images') && success('retina-shell-images')}} + if: ${{ github.event_name == 'merge_group' && success('retina-images') && success('retina-win-images') && success('operator-images') && success('retina-shell-images')}} name: Generate Manifests runs-on: ubuntu-latest needs: @@ -289,6 +301,7 @@ jobs: IMAGE_REGISTRY=${{ vars.ACR_NAME }} \ e2e: + if: ${{ github.event_name == 'merge_group' && success('manifests')}} name: Run E2E Tests runs-on: ubuntu-latest needs: [manifests] @@ -305,6 +318,7 @@ jobs: - name: Az CLI login uses: azure/login@v2 + if: ${{ github.event_name == 'merge_group' }} with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} From d4362facb9d1b4b88baca419bc014cb2e9844e8b Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Fri, 14 Feb 2025 15:17:11 -0800 Subject: [PATCH 13/82] Allow pipeline runs --- .github/workflows/images.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/images.yaml b/.github/workflows/images.yaml index 0ff29c939d..f90ef64ba4 100644 --- a/.github/workflows/images.yaml +++ b/.github/workflows/images.yaml @@ -112,7 +112,7 @@ jobs: BUILDX_ACTION=--push fi env: - IS_MERGE_GROUP: ${{ github.event_name == 'merge_group' }} + IS_MERGE_GROUP: ${{ github.event_name != 'merge_group' }} operator-images: name: Build Operator Images From bfb9b79be4ef11e7b72ef6e974dde36e5ce902a3 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Fri, 14 Feb 2025 15:19:57 -0800 Subject: [PATCH 14/82] Allow pipeline runs#1 --- .github/workflows/images.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/images.yaml b/.github/workflows/images.yaml index f90ef64ba4..b93a4637f3 100644 --- a/.github/workflows/images.yaml +++ b/.github/workflows/images.yaml @@ -85,7 +85,7 @@ jobs: - name: Az CLI login uses: azure/login@v2 - if: ${{ github.event_name == 'merge_group' }} + if: ${{ github.event_name != 'merge_group' }} with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} From b2000b62358036475a68f8cef629e41d1141092e Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Fri, 14 Feb 2025 16:57:08 -0800 Subject: [PATCH 15/82] Testing ACR Login --- .github/workflows/images.yaml | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/.github/workflows/images.yaml b/.github/workflows/images.yaml index b93a4637f3..f0aacc909b 100644 --- a/.github/workflows/images.yaml +++ b/.github/workflows/images.yaml @@ -96,21 +96,7 @@ jobs: run: | set -euo pipefail echo "TAG=$(make version)" >> $GITHUB_ENV - if [ "$IS_MERGE_GROUP" == "true" ]; then - az acr login -n ${{ vars.ACR_NAME }} - make retina-image-win \ - IMAGE_NAMESPACE=${{ github.repository }} \ - PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \ - IMAGE_REGISTRY=${{ vars.ACR_NAME }} \ - WINDOWS_YEARS=${{ matrix.year }} \ - BUILDX_ACTION=--push - else - make retina-image-win \ - IMAGE_NAMESPACE=${{ github.repository }} \ - PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \ - WINDOWS_YEARS=${{ matrix.year }} - BUILDX_ACTION=--push - fi + az acr login -n ${{ vars.ACR_NAME }} env: IS_MERGE_GROUP: ${{ github.event_name != 'merge_group' }} From b065fbaae01f0995b28521cd0a6a0a0d6f15c7b1 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Fri, 14 Feb 2025 17:01:24 -0800 Subject: [PATCH 16/82] Testing Docker push --- .github/workflows/images.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/images.yaml b/.github/workflows/images.yaml index f0aacc909b..c2fc29e87b 100644 --- a/.github/workflows/images.yaml +++ b/.github/workflows/images.yaml @@ -97,6 +97,20 @@ jobs: set -euo pipefail echo "TAG=$(make version)" >> $GITHUB_ENV az acr login -n ${{ vars.ACR_NAME }} + if [ "$IS_MERGE_GROUP" == "true" ]; then + make retina-image-win \ + IMAGE_NAMESPACE=${{ github.repository }} \ + PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \ + IMAGE_REGISTRY=${{ vars.ACR_NAME }} \ + WINDOWS_YEARS=${{ matrix.year }} \ + BUILDX_ACTION=--push + else + make retina-image-win \ + IMAGE_NAMESPACE=${{ github.repository }} \ + PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \ + WINDOWS_YEARS=${{ matrix.year }} + BUILDX_ACTION=--push + fi env: IS_MERGE_GROUP: ${{ github.event_name != 'merge_group' }} From 1b0c7530cf491bae50d65db8704ff36c79d031fe Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Sat, 15 Feb 2025 13:07:55 -0800 Subject: [PATCH 17/82] Testing ACR login --- .github/workflows/images.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/images.yaml b/.github/workflows/images.yaml index c2fc29e87b..296c2b2a2a 100644 --- a/.github/workflows/images.yaml +++ b/.github/workflows/images.yaml @@ -150,11 +150,6 @@ jobs: echo "TAG=$(make version)" >> $GITHUB_ENV if [ "$IS_MERGE_GROUP" == "true" ]; then az acr login -n ${{ vars.ACR_NAME }} - make retina-operator-image \ - IMAGE_NAMESPACE=${{ github.repository }} \ - PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \ - IMAGE_REGISTRY=${{ vars.ACR_NAME }} \ - BUILDX_ACTION=--push else make retina-operator-image \ IMAGE_NAMESPACE=${{ github.repository }} \ From e2f50afcf6dc57591d6df907549a18e73f75d92c Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Sat, 15 Feb 2025 13:24:29 -0800 Subject: [PATCH 18/82] Testing ACR login#2 --- .github/workflows/images.yaml | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/.github/workflows/images.yaml b/.github/workflows/images.yaml index 296c2b2a2a..f0aacc909b 100644 --- a/.github/workflows/images.yaml +++ b/.github/workflows/images.yaml @@ -97,20 +97,6 @@ jobs: set -euo pipefail echo "TAG=$(make version)" >> $GITHUB_ENV az acr login -n ${{ vars.ACR_NAME }} - if [ "$IS_MERGE_GROUP" == "true" ]; then - make retina-image-win \ - IMAGE_NAMESPACE=${{ github.repository }} \ - PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \ - IMAGE_REGISTRY=${{ vars.ACR_NAME }} \ - WINDOWS_YEARS=${{ matrix.year }} \ - BUILDX_ACTION=--push - else - make retina-image-win \ - IMAGE_NAMESPACE=${{ github.repository }} \ - PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \ - WINDOWS_YEARS=${{ matrix.year }} - BUILDX_ACTION=--push - fi env: IS_MERGE_GROUP: ${{ github.event_name != 'merge_group' }} @@ -150,6 +136,11 @@ jobs: echo "TAG=$(make version)" >> $GITHUB_ENV if [ "$IS_MERGE_GROUP" == "true" ]; then az acr login -n ${{ vars.ACR_NAME }} + make retina-operator-image \ + IMAGE_NAMESPACE=${{ github.repository }} \ + PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \ + IMAGE_REGISTRY=${{ vars.ACR_NAME }} \ + BUILDX_ACTION=--push else make retina-operator-image \ IMAGE_NAMESPACE=${{ github.repository }} \ From 1bdbbae6c0099c615c53280e8ac8552530ec0bef Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Sat, 15 Feb 2025 14:37:09 -0800 Subject: [PATCH 19/82] Testing ACR login#3 --- .github/workflows/images.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/images.yaml b/.github/workflows/images.yaml index f0aacc909b..c2fc29e87b 100644 --- a/.github/workflows/images.yaml +++ b/.github/workflows/images.yaml @@ -97,6 +97,20 @@ jobs: set -euo pipefail echo "TAG=$(make version)" >> $GITHUB_ENV az acr login -n ${{ vars.ACR_NAME }} + if [ "$IS_MERGE_GROUP" == "true" ]; then + make retina-image-win \ + IMAGE_NAMESPACE=${{ github.repository }} \ + PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \ + IMAGE_REGISTRY=${{ vars.ACR_NAME }} \ + WINDOWS_YEARS=${{ matrix.year }} \ + BUILDX_ACTION=--push + else + make retina-image-win \ + IMAGE_NAMESPACE=${{ github.repository }} \ + PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \ + WINDOWS_YEARS=${{ matrix.year }} + BUILDX_ACTION=--push + fi env: IS_MERGE_GROUP: ${{ github.event_name != 'merge_group' }} From dab25a05624db80335afad15d0f78c2458b5a925 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Sat, 15 Feb 2025 22:30:11 -0800 Subject: [PATCH 20/82] Testing ACR login#4 --- .github/workflows/images.yaml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/images.yaml b/.github/workflows/images.yaml index c2fc29e87b..2dd690c833 100644 --- a/.github/workflows/images.yaml +++ b/.github/workflows/images.yaml @@ -35,7 +35,6 @@ jobs: - name: Az CLI login uses: azure/login@v2 - if: ${{ github.event_name == 'merge_group' }} with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} @@ -59,7 +58,7 @@ jobs: PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} fi env: - IS_MERGE_GROUP: ${{ github.event_name == 'merge_group' }} + IS_MERGE_GROUP: ${{ github.event_name != 'merge_group' }} retina-win-images: name: Build Agent Windows Images @@ -85,7 +84,6 @@ jobs: - name: Az CLI login uses: azure/login@v2 - if: ${{ github.event_name != 'merge_group' }} with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} @@ -137,7 +135,6 @@ jobs: - name: Az CLI login uses: azure/login@v2 - if: ${{ github.event_name == 'merge_group' }} with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} @@ -161,7 +158,7 @@ jobs: PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} fi env: - IS_MERGE_GROUP: ${{ github.event_name == 'merge_group' }} + IS_MERGE_GROUP: ${{ github.event_name != 'merge_group' }} retina-shell-images: name: Build Retina Shell Images @@ -186,7 +183,6 @@ jobs: - name: Az CLI login uses: azure/login@v2 - if: ${{ github.event_name == 'merge_group' }} with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} @@ -210,7 +206,7 @@ jobs: PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} fi env: - IS_MERGE_GROUP: ${{ github.event_name == 'merge_group' }} + IS_MERGE_GROUP: ${{ github.event_name != 'merge_group' }} kubectl-retina-images: name: Build Kubectl Retina Images @@ -259,7 +255,7 @@ jobs: PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} fi env: - IS_MERGE_GROUP: ${{ github.event_name == 'merge_group' }} + IS_MERGE_GROUP: ${{ github.event_name != 'merge_group' }} manifests: if: ${{ github.event_name == 'merge_group' && success('retina-images') && success('retina-win-images') && success('operator-images') && success('retina-shell-images')}} @@ -301,7 +297,6 @@ jobs: IMAGE_REGISTRY=${{ vars.ACR_NAME }} \ e2e: - if: ${{ github.event_name == 'merge_group' && success('manifests')}} name: Run E2E Tests runs-on: ubuntu-latest needs: [manifests] From 0ce29fbc8be7d0ed47a5f778b1a3f2a15d3ae259 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Sat, 15 Feb 2025 22:35:38 -0800 Subject: [PATCH 21/82] Testing ACR login#5 --- .github/workflows/images.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/images.yaml b/.github/workflows/images.yaml index 2dd690c833..9e0ae26523 100644 --- a/.github/workflows/images.yaml +++ b/.github/workflows/images.yaml @@ -231,7 +231,7 @@ jobs: - name: Az CLI login uses: azure/login@v2 - if: ${{ github.event_name == 'merge_group' }} + if: ${{ github.event_name != 'merge_group' }} with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} From f5fa3bf9cd3d49dd5b5674bf0c5312f0499bbe81 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Sat, 15 Feb 2025 22:42:12 -0800 Subject: [PATCH 22/82] Testing ACR login#6 --- .github/workflows/images.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/images.yaml b/.github/workflows/images.yaml index 9e0ae26523..22f4cd2583 100644 --- a/.github/workflows/images.yaml +++ b/.github/workflows/images.yaml @@ -258,7 +258,7 @@ jobs: IS_MERGE_GROUP: ${{ github.event_name != 'merge_group' }} manifests: - if: ${{ github.event_name == 'merge_group' && success('retina-images') && success('retina-win-images') && success('operator-images') && success('retina-shell-images')}} + if: ${{ success('retina-images') && success('retina-win-images') && success('operator-images') && success('retina-shell-images')}} name: Generate Manifests runs-on: ubuntu-latest needs: From e8f56c2ab5b6b5c9ec5dc371d2a53ec4b7449128 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Sat, 15 Feb 2025 23:38:43 -0800 Subject: [PATCH 23/82] Testing ACR login#6 --- .github/workflows/images.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/images.yaml b/.github/workflows/images.yaml index 22f4cd2583..2c283e8e0d 100644 --- a/.github/workflows/images.yaml +++ b/.github/workflows/images.yaml @@ -313,7 +313,7 @@ jobs: - name: Az CLI login uses: azure/login@v2 - if: ${{ github.event_name == 'merge_group' }} + if: ${{ github.event_name != 'merge_group' }} with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} From 5bc712f8c149aeb32fa49898ca6a5288430ec1ac Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Sun, 16 Feb 2025 12:27:41 -0800 Subject: [PATCH 24/82] Testing ACR login#7 --- .github/workflows/images.yaml | 105 ++++++++++------------------------ 1 file changed, 31 insertions(+), 74 deletions(-) diff --git a/.github/workflows/images.yaml b/.github/workflows/images.yaml index 2c283e8e0d..aec71fe973 100644 --- a/.github/workflows/images.yaml +++ b/.github/workflows/images.yaml @@ -45,20 +45,12 @@ jobs: run: | set -euo pipefail echo "TAG=$(make version)" >> $GITHUB_ENV - if [ "$IS_MERGE_GROUP" == "true" ]; then - az acr login -n ${{ vars.ACR_NAME }} - make retina-image \ - IMAGE_NAMESPACE=${{ github.repository }} \ - PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \ - IMAGE_REGISTRY=${{ vars.ACR_NAME }} \ - BUILDX_ACTION=--push - else - make retina-image \ - IMAGE_NAMESPACE=${{ github.repository }} \ - PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} - fi - env: - IS_MERGE_GROUP: ${{ github.event_name != 'merge_group' }} + az acr login -n ${{ vars.ACR_NAME }} + make retina-image \ + IMAGE_NAMESPACE=${{ github.repository }} \ + PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \ + IMAGE_REGISTRY=${{ vars.ACR_NAME }} \ + BUILDX_ACTION=--push retina-win-images: name: Build Agent Windows Images @@ -95,22 +87,12 @@ jobs: set -euo pipefail echo "TAG=$(make version)" >> $GITHUB_ENV az acr login -n ${{ vars.ACR_NAME }} - if [ "$IS_MERGE_GROUP" == "true" ]; then - make retina-image-win \ - IMAGE_NAMESPACE=${{ github.repository }} \ - PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \ - IMAGE_REGISTRY=${{ vars.ACR_NAME }} \ - WINDOWS_YEARS=${{ matrix.year }} \ - BUILDX_ACTION=--push - else - make retina-image-win \ - IMAGE_NAMESPACE=${{ github.repository }} \ - PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \ - WINDOWS_YEARS=${{ matrix.year }} - BUILDX_ACTION=--push - fi - env: - IS_MERGE_GROUP: ${{ github.event_name != 'merge_group' }} + make retina-image-win \ + IMAGE_NAMESPACE=${{ github.repository }} \ + PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \ + IMAGE_REGISTRY=${{ vars.ACR_NAME }} \ + WINDOWS_YEARS=${{ matrix.year }} \ + BUILDX_ACTION=--push operator-images: name: Build Operator Images @@ -145,20 +127,12 @@ jobs: run: | set -euo pipefail echo "TAG=$(make version)" >> $GITHUB_ENV - if [ "$IS_MERGE_GROUP" == "true" ]; then - az acr login -n ${{ vars.ACR_NAME }} - make retina-operator-image \ - IMAGE_NAMESPACE=${{ github.repository }} \ - PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \ - IMAGE_REGISTRY=${{ vars.ACR_NAME }} \ - BUILDX_ACTION=--push - else - make retina-operator-image \ - IMAGE_NAMESPACE=${{ github.repository }} \ - PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} - fi - env: - IS_MERGE_GROUP: ${{ github.event_name != 'merge_group' }} + az acr login -n ${{ vars.ACR_NAME }} + make retina-operator-image \ + IMAGE_NAMESPACE=${{ github.repository }} \ + PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \ + IMAGE_REGISTRY=${{ vars.ACR_NAME }} \ + BUILDX_ACTION=--push retina-shell-images: name: Build Retina Shell Images @@ -193,20 +167,12 @@ jobs: run: | set -euo pipefail echo "TAG=$(make version)" >> $GITHUB_ENV - if [ "$IS_MERGE_GROUP" == "true" ]; then - az acr login -n ${{ vars.ACR_NAME }} - make retina-shell-image \ - IMAGE_NAMESPACE=${{ github.repository }} \ - PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \ - IMAGE_REGISTRY=${{ vars.ACR_NAME }} \ - BUILDX_ACTION=--push - else - make retina-shell-image \ - IMAGE_NAMESPACE=${{ github.repository }} \ - PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} - fi - env: - IS_MERGE_GROUP: ${{ github.event_name != 'merge_group' }} + az acr login -n ${{ vars.ACR_NAME }} + make retina-shell-image \ + IMAGE_NAMESPACE=${{ github.repository }} \ + PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \ + IMAGE_REGISTRY=${{ vars.ACR_NAME }} \ + BUILDX_ACTION=--push kubectl-retina-images: name: Build Kubectl Retina Images @@ -231,7 +197,6 @@ jobs: - name: Az CLI login uses: azure/login@v2 - if: ${{ github.event_name != 'merge_group' }} with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} @@ -242,20 +207,12 @@ jobs: run: | set -euo pipefail echo "TAG=$(make version)" >> $GITHUB_ENV - if [ "$IS_MERGE_GROUP" == "true" ]; then - az acr login -n ${{ vars.ACR_NAME }} - make kubectl-retina-image \ - IMAGE_NAMESPACE=${{ github.repository }} \ - PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \ - IMAGE_REGISTRY=${{ vars.ACR_NAME }} \ - BUILDX_ACTION=--push - else - make kubectl-retina-image \ - IMAGE_NAMESPACE=${{ github.repository }} \ - PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} - fi - env: - IS_MERGE_GROUP: ${{ github.event_name != 'merge_group' }} + az acr login -n ${{ vars.ACR_NAME }} + make kubectl-retina-image \ + IMAGE_NAMESPACE=${{ github.repository }} \ + PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \ + IMAGE_REGISTRY=${{ vars.ACR_NAME }} \ + BUILDX_ACTION=--push manifests: if: ${{ success('retina-images') && success('retina-win-images') && success('operator-images') && success('retina-shell-images')}} @@ -297,6 +254,7 @@ jobs: IMAGE_REGISTRY=${{ vars.ACR_NAME }} \ e2e: + if: ${{ success('manifests')}} name: Run E2E Tests runs-on: ubuntu-latest needs: [manifests] @@ -313,7 +271,6 @@ jobs: - name: Az CLI login uses: azure/login@v2 - if: ${{ github.event_name != 'merge_group' }} with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} From e3ceaddec0a5d17b38a0c47dea011298a09a49dc Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Sun, 16 Feb 2025 14:23:48 -0800 Subject: [PATCH 25/82] Testing ACR#8 --- .github/workflows/images.yaml | 81 +++++++++++++---------------------- 1 file changed, 30 insertions(+), 51 deletions(-) diff --git a/.github/workflows/images.yaml b/.github/workflows/images.yaml index aec71fe973..187a48d658 100644 --- a/.github/workflows/images.yaml +++ b/.github/workflows/images.yaml @@ -23,9 +23,9 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v4.2.2 - - uses: actions/setup-go@v5 + - uses: actions/setup-go@v5.3.0 with: go-version-file: go.mod - run: go version @@ -50,7 +50,10 @@ jobs: IMAGE_NAMESPACE=${{ github.repository }} \ PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \ IMAGE_REGISTRY=${{ vars.ACR_NAME }} \ + APP_INSIGHTS_ID=${{ secrets.AZURE_APP_INSIGHTS_KEY }} \ BUILDX_ACTION=--push + env: + IS_MERGE_GROUP: ${{ github.event_name == 'merge_group' }} retina-win-images: name: Build Agent Windows Images @@ -64,9 +67,9 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v4.2.2 - - uses: actions/setup-go@v5 + - uses: actions/setup-go@v5.3.0 with: go-version-file: go.mod - run: go version @@ -91,8 +94,11 @@ jobs: IMAGE_NAMESPACE=${{ github.repository }} \ PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \ IMAGE_REGISTRY=${{ vars.ACR_NAME }} \ + APP_INSIGHTS_ID=${{ secrets.AZURE_APP_INSIGHTS_KEY }} \ WINDOWS_YEARS=${{ matrix.year }} \ BUILDX_ACTION=--push + env: + IS_MERGE_GROUP: ${{ github.event_name == 'merge_group' }} operator-images: name: Build Operator Images @@ -105,9 +111,9 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v4.2.2 - - uses: actions/setup-go@v5 + - uses: actions/setup-go@v5.3.0 with: go-version-file: go.mod - run: go version @@ -132,7 +138,10 @@ jobs: IMAGE_NAMESPACE=${{ github.repository }} \ PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \ IMAGE_REGISTRY=${{ vars.ACR_NAME }} \ + APP_INSIGHTS_ID=${{ secrets.AZURE_APP_INSIGHTS_KEY }} \ BUILDX_ACTION=--push + env: + IS_MERGE_GROUP: ${{ github.event_name == 'merge_group' }} retina-shell-images: name: Build Retina Shell Images @@ -145,9 +154,9 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v4.2.2 - - uses: actions/setup-go@v5 + - uses: actions/setup-go@v5.3.0 with: go-version-file: go.mod - run: go version @@ -173,6 +182,8 @@ jobs: PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \ IMAGE_REGISTRY=${{ vars.ACR_NAME }} \ BUILDX_ACTION=--push + env: + IS_MERGE_GROUP: ${{ github.event_name == 'merge_group' }} kubectl-retina-images: name: Build Kubectl Retina Images @@ -185,9 +196,9 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v4.2.2 - - uses: actions/setup-go@v5 + - uses: actions/setup-go@v5.3.0 with: go-version-file: go.mod - run: go version @@ -213,9 +224,11 @@ jobs: PLATFORM=${{ matrix.platform }}/${{ matrix.arch }} \ IMAGE_REGISTRY=${{ vars.ACR_NAME }} \ BUILDX_ACTION=--push + env: + IS_MERGE_GROUP: ${{ github.event_name == 'merge_group' }} manifests: - if: ${{ success('retina-images') && success('retina-win-images') && success('operator-images') && success('retina-shell-images')}} + if: ${{ success('retina-images') && success('retina-win-images') && success('operator-images') && success('retina-shell-images') && success('kubectl-retina-images') }} name: Generate Manifests runs-on: ubuntu-latest needs: @@ -233,7 +246,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v4.2.2 - name: Setup QEMU uses: docker/setup-qemu-action@v3 @@ -251,20 +264,20 @@ jobs: set -euo pipefail az acr login -n ${{ vars.ACR_NAME }} make manifest COMPONENT=${{ matrix.components }} \ - IMAGE_REGISTRY=${{ vars.ACR_NAME }} \ + IMAGE_REGISTRY=${{ vars.ACR_NAME }} e2e: - if: ${{ success('manifests')}} + if: ${{ success('manifests') }} name: Run E2E Tests runs-on: ubuntu-latest needs: [manifests] steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v4.2.2 - name: Setup go - uses: actions/setup-go@v5 + uses: actions/setup-go@v5.3.0 with: go-version-file: go.mod - run: go version @@ -283,38 +296,4 @@ jobs: shell: bash run: | set -euo pipefail - go test -v ./test/e2e/. -timeout 60m -tags=e2e -count=1 -args -image-tag=$(make version) -image-registry=${{ vars.ACR_NAME }} -image-namespace=${{ github.repository}} - - perf: - if: ${{ github.event_name == 'merge_group' && success('manifests')}} - name: Retina Performance Test - runs-on: ubuntu-latest - needs: [manifests] - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup go - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - - run: go version - - - name: Az CLI login - uses: azure/login@v2 - if: ${{ github.event_name == 'merge_group' }} - with: - client-id: ${{ secrets.AZURE_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION }} - - - name: Run Perf Tests - env: - AZURE_APP_INSIGHTS_KEY: ${{ secrets.AZURE_APP_INSIGHTS_KEY }} - AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION }} - AZURE_LOCATION: ${{ vars.AZURE_LOCATION }} - shell: bash - run: | - set -euo pipefail - go test -v ./test/e2e/. -timeout 2h -tags=perf -count=1 -args -image-tag=$(make version) -image-registry=${{ vars.ACR_NAME }} -image-namespace=${{ github.repository }} + go test -v ./test/e2e/. -timeout 60m -tags=e2e -count=1 -args -image-tag=$(make version) -image-registry=${{ vars.ACR_NAME }} -image-namespace=${{ github.repository}} \ No newline at end of file From 0ed8c5129d05a5ff73464a792d4e0a442f3531ab Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Sun, 16 Feb 2025 20:42:49 -0800 Subject: [PATCH 26/82] Testing ACR#9 --- controller/Dockerfile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/controller/Dockerfile b/controller/Dockerfile index ddb899d54e..f7b46b42cc 100644 --- a/controller/Dockerfile +++ b/controller/Dockerfile @@ -116,11 +116,6 @@ COPY --from=tools /lib/ /lib COPY --from=tools /usr/lib/ /usr/lib ENTRYPOINT ["./retina/initretina"] -# Build Event Writer -RUN if [ $PLATFORM = "windows/amd64" ] ; then \ - msbuild MySolution.sln /p:Configuration=Release \ - fi - # agent final image # mcr.microsoft.com/cbl-mariner/distroless/minimal:2.0 # mcr.microsoft.com/cbl-mariner/distroless/minimal@sha256:63a0a70ceaa1320bc6eb98b81106667d43e46b674731ea8d28e4de1b87e0747f From 87f9143e58f964ae9a500f3d0da55f166f240199 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Mon, 17 Feb 2025 14:41:39 -0800 Subject: [PATCH 27/82] Testing INSTALL-EBPF-XDP#10 --- scripts/install-ebpf-xdp.ps1 | 870 ++++++++++++++++++ .../framework/kubernetes/apply-yaml-config.go | 7 +- test/e2e/yaml/windows/install-ebpf-xdp.yaml | 57 +- 3 files changed, 885 insertions(+), 49 deletions(-) create mode 100644 scripts/install-ebpf-xdp.ps1 diff --git a/scripts/install-ebpf-xdp.ps1 b/scripts/install-ebpf-xdp.ps1 new file mode 100644 index 0000000000..393b4e3beb --- /dev/null +++ b/scripts/install-ebpf-xdp.ps1 @@ -0,0 +1,870 @@ +#Requires -RunAsAdministrator + +Function Assert-SoftwareInstalled +{ + [cmdletbinding(DefaultParameterSetName='Software')] + + Param + ( + [Parameter(ParameterSetName='Service',Mandatory=$true)] + [ValidateScript({-Not [String]::IsNullOrWhiteSpace($_)})] + [String] $ServiceName, + + [Parameter(ParameterSetName='Service',Mandatory=$false)] + [ValidateSet($null,'Running','Stopped')] + [String] $ServiceState, + + [Parameter(ParameterSetName='Software',Mandatory=$true)] + [ValidateScript({-Not [String]::IsNullOrWhiteSpace($_)})] + [String] $SoftwareName, + + [Parameter(ParameterSetName='Software',Mandatory=$false)] + [String] $SoftwareVersion, + + [Parameter(ParameterSetName='Service',Mandatory=$false)] + [Parameter(ParameterSetName='Software',Mandatory=$false)] + [Switch] $Silent + ) + + [String] $name = If($ServiceName) {"$($ServiceName)"}Else{"$($SoftwareName)"} + + If(-Not $Silent.IsPresent) + { + Write-Host -Object:"Checking if $($name) is installed ..." + } + + [Boolean] $isInstalled = $false + + Try + { + If($SoftwareName) + { + $software = Get-WmiObject -Class:'Win32_Product' | Where-Object -Property:'Name' -like "*$($SoftwareName)*" + + If($software -And + (-Not [String]::IsNullOrWhiteSpace($Version))) + { + $software = $software | Where-Object -Property:'Version' -like "*$($SoftwareVersion)*" + } + + If($software) + { + $isInstalled = $true + } + } + ElseIF($ServiceName) + { + [Object] $state = Get-Service -Name:"$($ServiceName)" -ErrorAction:'SilentlyContinue' + If($state) + { + $isInstalled = $true + + If($ServiceState -And + -Not ($state.Staus -INE $ServiceState)) + { + Write-Warning -Message:"`t$ServiceName is $$(state.Status)" + } + } + } + } + Catch + { + + } + + If(-Not $Silent.IsPresent) + { + If($isInstalled) + { + Write-Host -Object:"`t$($name) is installed" + } + Else + { + Write-Host -Object:"`t$($name) is not installed" + } + } + + Return $isInstalled +} + +<# + .Name + Assert-TestSigningIsEnabled + + .Synopsis + Internal cmdlet to check if testsigning is enabled in the boot loader. + + .Description + Returns TRUE if test signing is enabled, otherwise FALSE. + + .Parameter Silent + Optional switch used to suppress output messages + + .Example + # Check if test signing is enabled + Assert-TestSigningIsEnabled +#> +Function Assert-TestSigningIsEnabled +{ + Param + ( + [Parameter(ParameterSetName='Default',Mandatory=$false)] + [Switch] $Silent + ) + + [Boolean] $isEnabled = $false + [String] $state = 'Disabled' + + Try + { + [Boolean] $current = $false + + If(-Not ($Silent.IsPresent)) + { + Write-Host -Object:"`tAssert Test Signing is Enabled" + } + + [Object[]] $entries = BCDEdit.exe /enum + If($entries.Count -ILT 3) + { + Write-Error -Message:"$entries" + + Throw + } + + ForEach($entry in $entries) + { + If($entry.StartsWith('identifier')) + { + If($entry -ILike '*{current}*') + { + $current = $true + } + Else + { + $current = $false + } + } + Else + { + If($current) + { + If($entry -ILike '*testsigning*Yes*') + { + $state = 'Enabled' + + $isEnabled = $true + + Break + } + } + } + } + } + Catch + { + $isEnabled = $false + + $state = 'Unknown' + } + + If(-Not ($Silent.IsPresent)) + { + Write-Host -Object:"`t`t$($state)" + } + + Return $isEnabled +} + +<# + .Name + Disable-TestSigning + + .Synopsis + Internal cmdlet to turn off Test Signing in the Windows Boot Loader. + + .Description + Returns TRUE if test signing is disabled, otherwise FALSE. + If set, the setting does not take effect until a reboot + + .Parameter Reboot + Optional parameter which will trigger a reboot if needed + + .Example + # Disable test signing + Disable-TestSigning +#> +Function Disable-TestSigning +{ + Param + ( + [Parameter(ParameterSetName='Default',Mandatory=$false)] + [Switch] $Reboot + ) + + [Boolean] $isSuccess = $true + + Try + { + [Boolean] $current = $false + [Boolean] $found = $false + + Write-Host -Object:"`tDisabling Test Signing" + + If(Assert-TestSigningIsEnabled -Silent) + { + Start-Process -FilePath:"$($env:WinDir)\System32\BCDEdit.exe" -ArgumentList @('/Set TestSigning Off') -PassThru | Wait-Process + + If(Assert-TestSigningIsEnabled -Silent) + { + Write-Error -Message:"`t`tFailed" + + Throw + } + + $script:RequiresReboot = $true + } + + Write-Host -Object:"`t`tDisabled" + } + Catch + { + $isSuccess = $false + } + + If($Reboot.IsPresent -and + $script:RequiresReboot) + { + Write-Host -Object:'Restarting' + + Start-Sleep -Seconds:5 + + Restart-Computer + } + + Return $isSuccess +} + +<# + .Name + Enable-TestSigning + + .Synopsis + Internal cmdlet to turn on Test Signing in the Windows Boot Loader. + + .Description + Returns TRUE if test signing is enabled, otherwise FALSE. + + .Parameter Reboot + Optional parameter which will trigger a reboot if needed + + .Example + # Enable test signing + Enable-TestSigning +#> +Function Enable-TestSigning +{ + Param + ( + [Parameter(ParameterSetName='Default',Mandatory=$false)] + [Switch] $Reboot + ) + + [Boolean] $isSuccess = $true + + Try + { + [Boolean] $current = $false + [Boolean] $found = $false + + Write-Host -Object:"`tEnabling Test Signing" + + If(-Not (Assert-TestSigningIsEnabled -Silent)) + { + Start-Process -FilePath:"$($env:WinDir)\System32\BCDEdit.exe" -ArgumentList @('/Set TestSigning On') -PassThru | Wait-Process + + If(-Not (Assert-TestSigningIsEnabled -Silent)) + { + Write-Error -Message:"`t`tFailed" + + Throw + } + + $script:RequiresReboot = $true + } + + Write-Host -Object:"`t`tEnabled" + + } + Catch + { + $isSuccess = $false + } + + If($Reboot.IsPresent -and + $script:RequiresReboot) + { + Write-Host -Object:'Restarting' + + Start-Sleep -Seconds:5 + + Restart-Computer + } + + Return $isSuccess +} + +#endregion PrivateFns + +#region Public + +<# + .Name + Assert-WindowsCiliumIsReady + + .Synopsis + Check if Cilium for Windows is ready + + .Description + Returns TRUE if Cilium for Windows is ready, otherwise FALSE. + + .Example + # Check if Cilium for Windows is ready + Assert-WindowsCiliumFunctions +#> +Function Assert-WindowsCiliumIsReady +{ + Write-Host -Object:'Validating Cilium for Windows is ready' + + [Boolean] $isReady = $true + [String[]] $services = @( + 'eBPFCore', + 'NetEbpfExt', + 'XDP' + ) + ForEach($service in $services) + { + If(-Not (Assert-SoftwareInstalled -ServiceName:"$($service)" -ServiceState:'Running')) + { + $isReady = $false + + Write-Warning -Message:"`t$($service) is not ready" + } + } + + Return $isReady +} + +<# + .Name + Install-eBPF + + .Synopsis + Installs extended Berkley Packet Filter for Windows. + + .Description + Returns TRUE if extended Berkley Packet Filter for Windows is installed successfully, otherwise FALSE. + Function requires that Test Signing is enabled. + + .Parameter LocalPath + Local directory to the eBPF for Windows binaries. + Default location is $env:LocalAppData\Temp + + .Example + # Install eBPF for Windows + Install-eBPF -LocalPath:"$($env:LocalAppData)\Temp" +#> +Function Install-eBPF +{ + [cmdletbinding(DefaultParameterSetName='Default')] + + Param + ( + [Parameter(ParameterSetName='Default',Mandatory=$false)] + [ValidateScript({Test-Path $_ -PathType:'Container'})] + [String] $LocalPath = "$($env:LocalAppData)\Temp" + ) + + [Boolean] $isSuccess = $true + + Try + { + If(-Not (Assert-TestSigningIsEnabled -Silent)) + { + If(-Not (Enable-TestSigning -Reboot)) { Throw } + } + + If(Assert-SoftwareInstalled -SoftwareName:'eBPF for Windows') + { + Write-Host 'extended Berkley Packet Filter for Windows is already installed' + return $isSuccess + } + + Write-Host 'Installing extended Berkley Packet Filter for Windows' + $ProgressPreference = 'SilentlyContinue' + # Download eBPF-for-Windows. + $packageEbpfUrl = "https://github.com/microsoft/ebpf-for-windows/releases/download/Release-v0.20.0/Build-x64-native-only-NativeOnlyRelease.zip" + Invoke-WebRequest -Uri $packageEbpfUrl -OutFile "$LocalPath\\Build-x64-native-only-NativeOnlyRelease.zip" + Expand-Archive -Path "$LocalPath\\Build-x64-native-only-NativeOnlyRelease.zip" -DestinationPath "$LocalPath\\Build-x64-native-only-NativeOnlyRelease\\msi" + Start-Process -FilePath:"$($env:WinDir)\System32\MSIExec.exe" -ArgumentList @("/i $($LocalPath)\ebpf-for-windows.msi", '/qn', "INSTALLFOLDER=`"$($env:ProgramFiles)\ebpf-for-windows`"", 'ADDLOCAL=eBPF_Runtime_Components') -PassThru | Wait-Process + + If(-Not (Assert-SoftwareInstalled -ServiceName:'eBPFCore' -Silent) -Or + -Not (Assert-SoftwareInstalled -ServiceName:'NetEbpfExt' -Silent)) + { + Write-Error -Message:"`teBPF service failed to install" + + Throw + } + + $isSuccess = Assert-SoftwareInstalled -SoftwareName:'eBPF for Windows' + } + Catch + { + $isSuccess = $false + + Uninstall-eBPF -LocalPath:"$($LocalPath)" + } + + Return $isSuccess +} + +<# + .Name + Install-XDP + + .Synopsis + Installs the eXpress Data Path for Windows service. + + .Description + Returns TRUE if the eXpress Data Path for Windows service is installed successfully, otherwise FALSE. + + .Parameter LocalPath + Local directory to the eXpress Data Path for Windows service binaries. + Default location is $env:LocalAppData\Temp + + .Example + # Install the eXpress Data Path service + Install-XDP -LocalPath:"$($env:LocalAppData)\Temp" +#> +Function Install-XDP +{ + [cmdletbinding(DefaultParameterSetName='Default')] + + Param + ( + [Parameter(ParameterSetName='Default',Mandatory=$false)] + [ValidateScript({Test-Path $_ -PathType:'Container'})] + [String] $LocalPath = "$($env:LocalAppData)\Temp" + ) + + [Boolean] $isSuccess = $true + + Try + { + If(Assert-SoftwareInstalled -SoftwareName:'XDP for Windows' -Silent) + { + Write-Host 'XDP for Windows is already installed' + return $isSuccess + } + + # Download XDP-for-Windows. + Write-Host 'Installing eXpress Data Path for Windows' + $packageXdpUrl = "https://github.com/microsoft/xdp-for-windows/releases/download/v1.1.0%2Bbed474a/bin_Release_x64.zip" + Invoke-WebRequest -Uri $packageXdpUrl -OutFile "$LocalPath\\bin_Release_x64.zip" + Expand-Archive -Path "$LocalPath\\bin_Release_x64.zip" -DestinationPath "$LocalPath\\bin_Release_x64" + copy "$LocalPath\\bin_Release_x64\\amd64fre\\xdp.cer" $LocalPath + CertUtil.exe -addstore Root $LocalPath\xdp.cer + CertUtil.exe -addstore TrustedPublisher $LocalPath\xdp.cer + Start-Process -FilePath:"$($env:WinDir)\System32\MSIExec.exe" -ArgumentList @("/i $($LocalPath)\xdp-for-windows.1.1.0.msi", '/qn') -PassThru | Wait-Process + sc.exe query xdp + reg.exe add HKLM\\SYSTEM\\CurrentControlSet\\Services\\xdp\\Parameters /v XdpEbpfEnabled /d 1 /t REG_DWORD /f + net.exe stop xdp + net.exe start xdp + Write-Output "XDP for Windows installed" + + $regValue = New-ItemProperty -Path:'HKLM:\SYSTEM\CurrentControlSet\Services\xdp\Parameters' -Name:'xdpEbpfEnabled' -PropertyType:'DWORD' -Value:1 -Force + If($regValue.xdpEbpfEnabled -IEQ 1) + { + [Object] $state = Get-Service -Name:'XDP' + + For([Byte]$i = 0; + $i -ILE 5; + $i++) + { + If($state.Status -IEQ 'Stopped') + { + Break + } + Else + { + If($state.Status -IEQ 'Running') + { + Stop-Service -Name:'XDP' -Force + } + ElseIf($state.Status -IEQ 'StopPending') + { + Start-Sleep -Seconds:5 + } + Else + { + Write-Error -Message:"XDP service is $($state.status)" + + Throw + } + } + + $state = Get-Service -Name:'XDP' + } + + For([Byte]$i = 0; + $i -ILE 5; + $i++) + { + If($state.Status -IEQ 'Running') + { + Break + } + Else + { + If($state.Status -IEQ 'Stopped') + { + Start-Service -Name:'XDP' + } + ElseIf($state.Status -IEQ 'StartPending') + { + Start-Sleep -Seconds:5 + } + Else + { + Write-Error -Message:"XDP service is $($state.Status)" + + Throw + } + } + + $state = Get-Service -Name:'XDP' + } + + If(-Not (Assert-SoftwareInstalled -ServiceName:'XDP' -Silent)) + { + Write-Error -Message:"`tXDP service failed to install" + + Throw + } + + $isSuccess = Assert-SoftwareInstalled -SoftwareName:'XDP for Windows' + } + Else + { + Write-Error -Message:"`tFailed to set regKey" + } + + Write-Host "Setting SDDL for XDP service" + xdpcfg.exe SetDeviceSddl "D:P(A;;GA;;;SY)(A;;GA;;;BA)" + } + Catch + { + $isSuccess = $false + + Uninstall-XDP -LocalPath:"$($LocalPath)" + } + + Return $isSuccess +} + +<# + .Name + Install-WindowsCilium + + .Description + Returns TRUE if the Cilium for Windows installation is successfully, otherwise FALSE. + Requires test signing to be enabled. This is asserted up front and may trigger a restart. + A restart will occur if the NoRestart switch is not specified. Any caller needs to account for this. +#> +Function Install-WindowsCilium +{ + [cmdletbinding(DefaultParameterSetName='Default')] + + [Boolean] $isSuccess = $true + + Try + { + If(Assert-WindowsCiliumIsReady) { + Write-Host 'Windows Cilium Installed already' + return + } + + Write-Host 'Installing Windows Cilium' + + If(-Not (Assert-TestSigningIsEnabled -Silent)) + { + If(-Not (Enable-TestSigning -Reboot)) { Throw } + } + + If(-Not (Install-eBPF -LocalPath:"$($LocalPath)")) {Throw} + + If(-Not (Install-XDP -LocalPath:"$($LocalPath)")) {Throw} + + Write-Host -Object:'Restarting' + + Start-Sleep -Seconds:5 + + Restart-Computer + + } + Catch + { + $isSuccess = $false + } + + Return $isSuccess +} + +<# + .Name + Uninstall-eBPF + + .Synopsis + Uninstalls the extended Berkley Packet Filter for Windows. + + .Description + Returns TRUE if the extended Berkley Packet Filter for Windows is uninstalled successfully, otherwise FALSE. + + .Parameter LocalPath + Local directory to the extended Berkley Packet Filter for Windows binaries. + Default location is $env:LocalAppData\Temp + + .Example + # Uninstall the extended Berkley Packet Filter for Windows + Uninstall-eBPF -LocalPath:"$(env:LocalAppData)\Temp" +#> +Function Uninstall-eBPF +{ + [cmdletbinding(DefaultParameterSetName='Default')] + + Param + ( + [Parameter(ParameterSetName='Default',Mandatory=$false)] + [ValidateScript({Test-Path $_ -PathType:'Container'})] + [String] $LocalPath = "$($env:LocalAppData)\Temp" + ) + + Write-Host 'Uninstalling the extended Berkley Packet Filter for Windows' + + [Boolean] $isSuccess = $true + + Try + { + [String[]] $services = @('eBPFCore', + 'NetEbpfExt' + ) + + ForEach($service in $services) + { + [Object] $state = Get-Service -Name:$($service) -ErrorAction:'SilentlyContinue' + If($state) + { + For([Byte]$i = 0; + $i -ILE 5; + $i++) + { + If($state.Status -IEQ 'Stopped') + { + Break + } + Else + { + If($state.Status -IEQ 'Running') + { + Stop-Service -Name:"$($service)" -Force + } + ElseIf($state.Status -IEQ 'StopPending') + { + Start-Sleep -Seconds:5 + } + Else + { + Write-Error -Message:"$($service) service is $($state.status)" + + Throw + } + } + + $state = Get-Service -Name:"$($service)" + } + } + + Start-Process -FilePath:"$($env:WinDir)\System32\MSIExec.exe" -ArgumentList @("/x $($LocalPath)\ebpf-for-windows.msi", '/qn') -PassThru | Wait-Process + } + + If((Assert-SoftwareInstalled -ServiceName:'eBPFCore' -Silent) -or + (Assert-SoftwareInstalled -ServiceName:'NetEbpfExt' -Silent) -or + (Assert-SoftwareInstalled -SoftwareName:'eBPF for Windows' -Silent)) + { + Write-Error -Message:"eBPF for Windows is still installed" + + Throw + } + } + Catch + { + $isSuccess = $false + } + + Return $isSuccess +} + +<# + .Name + Uninstall-XDP + + .Synopsis + Uninstalls the express Data Path for Windows service + + .Description + Returns TRUE if the eXpress Data Path for Windows service is uninstalled successfully, otherwise FALSE. + + .Parameter LocalPath + Local directory to the eXpress Data Path for Windows service binaries. + Default location is $env:LocalAppData\Temp + + .Example + # Uninstall the eXpress Data Path for Windows service + Uninstall-XDP -LocalPath:"$($env:LocalAppData)\Temp" +#> +Function Uninstall-XDP +{ + [cmdletbinding(DefaultParameterSetName='Default')] + + Param + ( + [Parameter(ParameterSetName='Default',Mandatory=$false)] + [ValidateScript({Test-Path $_ -PathType:'Container'})] + [String] $LocalPath = "$($env:LocalAppData)\Temp" + ) + + Write-Host 'Uninstalling eXpress Data Path for Windows' + + [Boolean] $isSuccess = $true + + Try + { + [Object] $state = Get-Service -Name:'XDP' -ErrorAction:'SilentlyContinue' + If($state) + { + For([Byte]$i = 0; + $i -ILE 5; + $i++) + { + If($state.Status -IEQ 'Stopped') + { + Break + } + Else + { + If($state.Status -IEQ 'Running') + { + Stop-Service -Name:'XDP' -Force + } + ElseIf($state.Status -IEQ 'StopPending') + { + Start-Sleep -Seconds:5 + } + Else + { + Write-Error -Message:"XDP service is $($state.status)" + + Throw + } + } + + $state = Get-Service -Name:'XDP' + } + + $regValue = New-ItemProperty -Path:'HKLM:\SYSTEM\CurrentControlSet\Services\xdp\Parameters' -Name:'xdpEbpfEnabled' -PropertyType:'DWORD' -Value:0 -Force + If($regValue.xdpEbpfEnabled -IEQ 0) + { + Start-Process -FilePath:"$($env:WinDir)\System32\MSIExec.exe" -ArgumentList @("/x $($LocalPath)\xdp-for-windows.1.1.0.msi", '/qn') -PassThru | Wait-Process + } + } + + If((Assert-SoftwareInstalled -ServiceName:'XDP' -Silent) -or + (Assert-SoftwareInstalled -SoftwareName:'XDP for Windows' -Silent)) + { + Write-Error -Message:"XDP for Windows is still installed" + + Throw + } + } + Catch + { + $isSuccess = $false + } + + Return $isSuccess +} + +<# + .Name + Uninstall-WindowsCilium + + .Synopsis + Uninstalls Cilium for Windows + + .Parameter LocalPath + Local directory to the Cilium for Windows binaries. + Default location is $env:LocalAppData\Temp + + .Parameter DisableTestSigning + Optional switch used to disable test signing on the current Windows boot loader + + .Description + Returns TRUE if Cilium for Windows is uninstalled successfully, otherwise FALSE. + + .Example + # Uninstall Cilium for Windows + Uninstall-WindowsCilium +#> +Function Uninstall-WindowsCilium +{ + [cmdletbinding(DefaultParameterSetName='Default')] + + Param + ( + [Parameter(ParameterSetName='Default',Mandatory=$false)] + [ValidateScript({Test-Path $_ -PathType:'Container'})] + [String] $LocalPath = "$($env:LocalAppData)\Temp", + + [Parameter(ParameterSetName='Default',Mandatory=$false)] + [Switch] $DisableTestSigning, + + [Parameter(ParameterSetName='Default',Mandatory=$false)] + [Switch] $NoReboot + ) + + Write-Host 'Uninstalling Cilium for Windows' + + [Boolean] $isSuccess = $true + + Try + { + Uninstall-XDP -LocalPath:"$($LocalPath)" + + Uninstall-eBPF -LocalPath:"$($LocalPath)" + + If($DisableTestSigning.IsPresent) + { + Disable-TestSigning -Reboot:$(-Not ($NoReboot.IsPresent)) + } + } + Catch + { + $isSuccess = $false + } + + Return $isSuccess +} + + +#Script Start +Install-WindowsCilium \ No newline at end of file diff --git a/test/e2e/framework/kubernetes/apply-yaml-config.go b/test/e2e/framework/kubernetes/apply-yaml-config.go index 959002c2dc..d63c5ac86f 100644 --- a/test/e2e/framework/kubernetes/apply-yaml-config.go +++ b/test/e2e/framework/kubernetes/apply-yaml-config.go @@ -1,9 +1,9 @@ package kubernetes import ( + "bytes" "context" "fmt" - "io/ioutil" "log" "os" "time" @@ -44,12 +44,13 @@ func (a *ApplyYamlConfig) Run() error { return fmt.Errorf("error creating dynamic client: %w", err) } - yamlFile, err := ioutil.ReadFile(a.YamlFilePath) + yamlFile, err := os.ReadFile(a.YamlFilePath) if err != nil { return fmt.Errorf("error reading YAML file: %w", err) } - decoder := yaml.NewYAMLOrJSONDecoder(yamlFile, 100) + reader := bytes.NewReader(yamlFile) + decoder := yaml.NewYAMLOrJSONDecoder(reader, 100) var rawObj unstructured.Unstructured if err := decoder.Decode(&rawObj); err != nil { return fmt.Errorf("error decoding YAML file: %w", err) diff --git a/test/e2e/yaml/windows/install-ebpf-xdp.yaml b/test/e2e/yaml/windows/install-ebpf-xdp.yaml index 27267f8168..69ad6b29f5 100644 --- a/test/e2e/yaml/windows/install-ebpf-xdp.yaml +++ b/test/e2e/yaml/windows/install-ebpf-xdp.yaml @@ -1,10 +1,16 @@ apiVersion: batch/v1 -kind: Job +kind: DaemonSet metadata: name: ebpf-xdp-install namespace: ebpf-xdp-install spec: + selector: + matchLabels: + name: ebpf-xdp-install template: + metadata: + labels: + name: ebpf-xdp-install spec: containers: - name: ebpf-xdp-install-container @@ -13,54 +19,13 @@ spec: - powershell.exe - -command - | - # Enable Test Signing mode on the node - $binaryDir = "C:\\binaries" - if (!(Test-Path -Path $binaryDir)) { - New-Item -ItemType Directory -Path $binaryDir - } + git clone https://github.com/your-org/retina.git C:\retina; + cd C:\retina; + .\scripts\WindowsCilium.ps1 - $ProgressPreference = 'SilentlyContinue' - # Download eBPF-for-Windows. - $packageEbpfUrl = "https://github.com/microsoft/ebpf-for-windows/releases/download/Release-v0.18.0/Build-x64-native-only-NativeOnlyRelease.zip" - Invoke-WebRequest -Uri $packageEbpfUrl -OutFile "$binaryDir\\Build-x64-native-only-NativeOnlyRelease.zip" - Expand-Archive -Path "$binaryDir\\Build-x64-native-only-NativeOnlyRelease.zip" -DestinationPath "$binaryDir\\Build-x64-native-only-NativeOnlyRelease\\msi" - copy "$binaryDir\\Build-x64-native-only-NativeOnlyRelease\\msi\\Build-x64-native-only NativeOnlyRelease\\*.msi" $binaryDir - - # Download XDP-for-Windows. - $packageXdpUrl = "https://github.com/microsoft/xdp-for-windows/releases/download/v1.1.0%2Bbed474a/bin_Release_x64.zip" - Invoke-WebRequest -Uri $packageXdpUrl -OutFile "$binaryDir\\bin_Release_x64.zip" - Expand-Archive -Path "$binaryDir\\bin_Release_x64.zip" -DestinationPath "$binaryDir\\bin_Release_x64" - copy "$binaryDir\\bin_Release_x64\\amd64fre\\xdp.cer" $binaryDir - - Invoke-WebRequest -Uri "https://github.com/microsoft/xdp-for-windows/releases/download/v1.1.0%2Bbed474a/xdp-for-windows.1.1.0.msi" -OutFile "$binaryDir\\xdp-for-windows.1.1.0.msi" - - tree /f $binaryDir - - $installPath = ($pwd).Drive.Name + ":\ebpf-for-windows" - Write-Output "Installing eBPF for Windows" - Start-Process msiexec.exe -Wait -ArgumentList "/i eBPF-for-Windows.msi INSTALLFOLDER=$installPath ADDLOCAL=eBPF_Runtime_Components /qn" - Write-Output "eBPF for Windows installed" - sc.exe query ebpfcore - sc.exe query netebpfext - copy "$installPath\\ebpfapi.dll" $binaryDir - dir $binaryDir - - $installPath = ($pwd).Drive.Name + ":\xdp-for-windows" - Write-Output "Installing XDP for Windows" - CertUtil.exe -addstore Root xdp.cer - CertUtil.exe -addstore TrustedPublisher xdp.cer - Start-Process msiexec.exe -Wait -ArgumentList "/i xdp-for-windows.1.1.0.msi INSTALLFOLDER=$installPath /qn" - sc.exe query xdp - reg.exe add HKLM\\SYSTEM\\CurrentControlSet\\Services\\xdp\\Parameters /v XdpEbpfEnabled /d 1 /t REG_DWORD /f - net.exe stop xdp - net.exe start xdp - Write-Output "XDP for Windows installed" - dir $installPath - - restartPolicy: Never nodeSelector: kubernetes.io/os: windows securityContext: windowsOptions: runAsUserName: "NT AUTHORITY\\SYSTEM" - backoffLimit: 0 \ No newline at end of file + backoffLimit: 5 \ No newline at end of file From 0608d4977141171544bf10566b8721ddf4e02951 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Mon, 17 Feb 2025 15:15:56 -0800 Subject: [PATCH 28/82] Testing INSTALL-EBPF-XDP#11 --- scripts/install-ebpf-xdp.ps1 | 3 +++ test/e2e/jobs/jobs.go | 11 ----------- test/e2e/retina_e2e_test.go | 5 +---- test/e2e/yaml/windows/install-ebpf-xdp.yaml | 13 ++++++++++--- 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/scripts/install-ebpf-xdp.ps1 b/scripts/install-ebpf-xdp.ps1 index 393b4e3beb..687804fe22 100644 --- a/scripts/install-ebpf-xdp.ps1 +++ b/scripts/install-ebpf-xdp.ps1 @@ -605,6 +605,9 @@ Function Install-WindowsCilium If(-Not (Install-XDP -LocalPath:"$($LocalPath)")) {Throw} + # Create the probe ready file + New-Item -Path "C:\install-ebpf-xdp-probe-ready" -ItemType File -Force + Write-Host -Object:'Restarting' Start-Sleep -Seconds:5 diff --git a/test/e2e/jobs/jobs.go b/test/e2e/jobs/jobs.go index c2731f576a..5de5a5f367 100644 --- a/test/e2e/jobs/jobs.go +++ b/test/e2e/jobs/jobs.go @@ -106,17 +106,6 @@ func UninstallRetina(kubeConfigFilePath, chartPath string) *types.Job { return job } -func EnableTestSigningOn(kubeConfigFilePath string) *types.Job { - job := types.NewJob("Enable test signing on") - - job.AddStep(&kubernetes.ApplyYamlConfig{ - KubeConfigFilePath: kubeConfigFilePath, - YamlFilePath: "test/e2e/yaml/windows/enable-test-signing.yaml", - }, nil) - - return job -} - func InstallEbpfXdp(kubeConfigFilePath string) *types.Job { job := types.NewJob("Install ebpf and xdp") diff --git a/test/e2e/retina_e2e_test.go b/test/e2e/retina_e2e_test.go index 84c6854aee..0b890322bb 100644 --- a/test/e2e/retina_e2e_test.go +++ b/test/e2e/retina_e2e_test.go @@ -57,11 +57,8 @@ func TestE2ERetina(t *testing.T) { createTestInfra := types.NewRunner(t, jobs.CreateTestInfra(subID, rg, clusterName, location, kubeConfigFilePath, *common.CreateInfra)) createTestInfra.Run(ctx) - // Enable Test-Signing On - enableTestSigning := types.NewRunner(t, jobs.EnableTestSigningOn(kubeConfigFilePath)) - enableTestSigning.Run(ctx) // Install Ebpf and XDP - installEbpfAndXDP := types.NewRunner(t, jobs.InstallEbpfAndXDP(kubeConfigFilePath)) + installEbpfAndXDP := types.NewRunner(t, jobs.InstallEbpfXdp(kubeConfigFilePath)) installEbpfAndXDP.Run(ctx) t.Cleanup(func() { diff --git a/test/e2e/yaml/windows/install-ebpf-xdp.yaml b/test/e2e/yaml/windows/install-ebpf-xdp.yaml index 69ad6b29f5..7d1e62e9b1 100644 --- a/test/e2e/yaml/windows/install-ebpf-xdp.yaml +++ b/test/e2e/yaml/windows/install-ebpf-xdp.yaml @@ -20,9 +20,16 @@ spec: - -command - | git clone https://github.com/your-org/retina.git C:\retina; - cd C:\retina; - .\scripts\WindowsCilium.ps1 - + & C:\retina\scripts\install-ebpf-xdp.ps1 + while ($true) { Start-Sleep -Seconds 2147483; } + readinessProbe: + exec: + command: + - powershell.exe + - -command + - Test-Path C:\install-ebpf-xdp-probe-ready + initialDelaySeconds: 10 + periodSeconds: 5 nodeSelector: kubernetes.io/os: windows securityContext: From f8cbbc9aaf70fc0879ef75bc2f803344e77f478e Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Mon, 17 Feb 2025 15:40:38 -0800 Subject: [PATCH 29/82] Testing INSTALL-EBPF-XDP#12 --- .../framework/kubernetes/apply-yaml-config.go | 34 +++++++++++++------ 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/test/e2e/framework/kubernetes/apply-yaml-config.go b/test/e2e/framework/kubernetes/apply-yaml-config.go index d63c5ac86f..ee98cd2b99 100644 --- a/test/e2e/framework/kubernetes/apply-yaml-config.go +++ b/test/e2e/framework/kubernetes/apply-yaml-config.go @@ -11,8 +11,9 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/util/yaml" + "k8s.io/client-go/discovery" "k8s.io/client-go/dynamic" - "k8s.io/client-go/kubernetes" + "k8s.io/client-go/restmapper" "k8s.io/client-go/tools/clientcmd" ) @@ -34,16 +35,23 @@ func (a *ApplyYamlConfig) Run() error { return fmt.Errorf("error building kubeconfig: %w", err) } - clientset, err := kubernetes.NewForConfig(config) + dynamicClient, err := dynamic.NewForConfig(config) if err != nil { - return fmt.Errorf("error creating Kubernetes client: %w", err) + return fmt.Errorf("error creating dynamic client: %w", err) } - dynamicClient, err := dynamic.NewForConfig(config) + discoveryClient, err := discovery.NewDiscoveryClientForConfig(config) if err != nil { - return fmt.Errorf("error creating dynamic client: %w", err) + return fmt.Errorf("error creating discovery client: %w", err) + } + + resources, err := restmapper.GetAPIGroupResources(discoveryClient) + if err != nil { + return fmt.Errorf("error getting API group resources: %w", err) } + mapper := restmapper.NewDiscoveryRESTMapper(resources) + yamlFile, err := os.ReadFile(a.YamlFilePath) if err != nil { return fmt.Errorf("error reading YAML file: %w", err) @@ -56,20 +64,26 @@ func (a *ApplyYamlConfig) Run() error { return fmt.Errorf("error decoding YAML file: %w", err) } + // Get GroupVersionResource to invoke the dynamic client gvk := rawObj.GroupVersionKind() - mapping, err := clientset.RESTMapper().RESTMapping(gvk.GroupKind(), gvk.Version) + restMapping, err := mapper.RESTMapping(gvk.GroupKind(), gvk.Version) if err != nil { return fmt.Errorf("error getting REST mapping: %w", err) } + gvr := restMapping.Resource - resourceInterface := dynamicClient.Resource(mapping.Resource).Namespace(rawObj.GetNamespace()) - _, err = resourceInterface.Create(ctx, &rawObj, metav1.CreateOptions{}) + // Apply the YAML document + namespace := rawObj.GetNamespace() + if len(namespace) == 0 { + namespace = "default" + } + applyOpts := metav1.ApplyOptions{FieldManager: "kube-apply"} + _, err = dynamicClient.Resource(gvr).Namespace(namespace).Apply(ctx, rawObj.GetName(), &rawObj, applyOpts) if err != nil { - return fmt.Errorf("error applying YAML file: %w", err) + return fmt.Errorf("apply error: %w", err) } log.Printf("applied YAML file: %s\n", a.YamlFilePath) - return nil } From dcc7140cb4cc11c0b4681e30798599889b62bfe8 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Mon, 17 Feb 2025 19:19:26 -0800 Subject: [PATCH 30/82] Testing INSTALL-EBPF-XDP#13 --- test/e2e/jobs/jobs.go | 2 +- test/e2e/yaml/windows/install-ebpf-xdp.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/e2e/jobs/jobs.go b/test/e2e/jobs/jobs.go index 5de5a5f367..436015002d 100644 --- a/test/e2e/jobs/jobs.go +++ b/test/e2e/jobs/jobs.go @@ -111,7 +111,7 @@ func InstallEbpfXdp(kubeConfigFilePath string) *types.Job { job.AddStep(&kubernetes.ApplyYamlConfig{ KubeConfigFilePath: kubeConfigFilePath, - YamlFilePath: "test/e2e/yaml/windows/install-ebpf-xdp.yaml", + YamlFilePath: "yaml/windows/install-ebpf-xdp.yaml", }, nil) return job diff --git a/test/e2e/yaml/windows/install-ebpf-xdp.yaml b/test/e2e/yaml/windows/install-ebpf-xdp.yaml index 7d1e62e9b1..5315f82aba 100644 --- a/test/e2e/yaml/windows/install-ebpf-xdp.yaml +++ b/test/e2e/yaml/windows/install-ebpf-xdp.yaml @@ -19,8 +19,8 @@ spec: - powershell.exe - -command - | - git clone https://github.com/your-org/retina.git C:\retina; - & C:\retina\scripts\install-ebpf-xdp.ps1 + Invoke-WebRequest -Uri "https://raw.githubusercontent.com/vpidatala94/retina/user/vpidatala/POC/8/scripts/install-ebpf-xdp.ps1" -OutFile "C:\install-ebpf-xdp.ps1"; + & C:\install-ebpf-xdp.ps1; while ($true) { Start-Sleep -Seconds 2147483; } readinessProbe: exec: From e6eef6406e1116417e5bc9699989a4149d160a8f Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Mon, 17 Feb 2025 19:49:16 -0800 Subject: [PATCH 31/82] Testing INSTALL-EBPF-XDP#14 --- test/e2e/yaml/windows/install-ebpf-xdp.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/yaml/windows/install-ebpf-xdp.yaml b/test/e2e/yaml/windows/install-ebpf-xdp.yaml index 5315f82aba..ac82f4bc10 100644 --- a/test/e2e/yaml/windows/install-ebpf-xdp.yaml +++ b/test/e2e/yaml/windows/install-ebpf-xdp.yaml @@ -1,4 +1,4 @@ -apiVersion: batch/v1 +apiVersion: apps/v1 kind: DaemonSet metadata: name: ebpf-xdp-install From 9f170131022553d1f399e5ee6f7144ada27dce2e Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Mon, 17 Feb 2025 20:27:10 -0800 Subject: [PATCH 32/82] Testing INSTALL-EBPF-XDP#15 --- test/e2e/yaml/windows/install-ebpf-xdp.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/e2e/yaml/windows/install-ebpf-xdp.yaml b/test/e2e/yaml/windows/install-ebpf-xdp.yaml index ac82f4bc10..7b725e6c08 100644 --- a/test/e2e/yaml/windows/install-ebpf-xdp.yaml +++ b/test/e2e/yaml/windows/install-ebpf-xdp.yaml @@ -34,5 +34,4 @@ spec: kubernetes.io/os: windows securityContext: windowsOptions: - runAsUserName: "NT AUTHORITY\\SYSTEM" - backoffLimit: 5 \ No newline at end of file + runAsUserName: "NT AUTHORITY\\SYSTEM" \ No newline at end of file From cc39db9903f4b783ede376c602ee204e61a5ea39 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Mon, 17 Feb 2025 20:54:47 -0800 Subject: [PATCH 33/82] Testing INSTALL-EBPF-XDP#16 --- test/e2e/yaml/windows/install-ebpf-xdp.yaml | 23 +++++++++++---------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/test/e2e/yaml/windows/install-ebpf-xdp.yaml b/test/e2e/yaml/windows/install-ebpf-xdp.yaml index 7b725e6c08..fc5a312cfc 100644 --- a/test/e2e/yaml/windows/install-ebpf-xdp.yaml +++ b/test/e2e/yaml/windows/install-ebpf-xdp.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: DaemonSet metadata: name: ebpf-xdp-install - namespace: ebpf-xdp-install + namespace: ebpf-xdp-install # Ensure this namespace exists spec: selector: matchLabels: @@ -16,18 +16,19 @@ spec: - name: ebpf-xdp-install-container image: mcr.microsoft.com/windows/servercore:ltsc2022 command: - - powershell.exe - - -command - - | - Invoke-WebRequest -Uri "https://raw.githubusercontent.com/vpidatala94/retina/user/vpidatala/POC/8/scripts/install-ebpf-xdp.ps1" -OutFile "C:\install-ebpf-xdp.ps1"; - & C:\install-ebpf-xdp.ps1; - while ($true) { Start-Sleep -Seconds 2147483; } - readinessProbe: + - powershell.exe + - -command + - | + Invoke-WebRequest -Uri "https://raw.githubusercontent.com/vpidatala94/retina/user/vpidatala/POC/8/scripts/install-ebpf-xdp.ps1" -OutFile "C:\install-ebpf-xdp.ps1"; + & C:\install-ebpf-xdp.ps1; + # Instead of infinite sleep, consider a more specific wait or loop + while ($true) { Start-Sleep -Seconds 300; } + readinessProbe: exec: command: - - powershell.exe - - -command - - Test-Path C:\install-ebpf-xdp-probe-ready + - powershell.exe + - -command + - Test-Path C:\install-ebpf-xdp-probe-ready initialDelaySeconds: 10 periodSeconds: 5 nodeSelector: From 9a7769e6670eff2b966c585eca0ce2db66efad8a Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Mon, 17 Feb 2025 22:17:54 -0800 Subject: [PATCH 34/82] Testing INSTALL-EBPF-XDP#17 --- test/e2e/retina_e2e_test.go | 2 ++ test/plugin/eventwriter/event_writer_api.cpp | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/test/e2e/retina_e2e_test.go b/test/e2e/retina_e2e_test.go index 0b890322bb..3cefe0a10a 100644 --- a/test/e2e/retina_e2e_test.go +++ b/test/e2e/retina_e2e_test.go @@ -11,6 +11,7 @@ import ( "github.com/microsoft/retina/test/e2e/common" "github.com/microsoft/retina/test/e2e/framework/helpers" + "github.com/microsoft/retina/test/e2e/framework/kubernetes" "github.com/microsoft/retina/test/e2e/framework/types" jobs "github.com/microsoft/retina/test/e2e/jobs" "github.com/stretchr/testify/require" @@ -58,6 +59,7 @@ func TestE2ERetina(t *testing.T) { createTestInfra.Run(ctx) // Install Ebpf and XDP + job.AddStep(&kubernetes.CreateNamespace{"ebpf-xdp-install", kubeConfigFilePath}, nil) installEbpfAndXDP := types.NewRunner(t, jobs.InstallEbpfXdp(kubeConfigFilePath)) installEbpfAndXDP.Run(ctx) diff --git a/test/plugin/eventwriter/event_writer_api.cpp b/test/plugin/eventwriter/event_writer_api.cpp index 303829c6d0..49d0159248 100644 --- a/test/plugin/eventwriter/event_writer_api.cpp +++ b/test/plugin/eventwriter/event_writer_api.cpp @@ -8,7 +8,7 @@ std::vector> link_list; bpf_object* obj = NULL; -extern "C" __declspec(dllexport) DWORD +int set_filter(struct filter* flt) { uint8_t key = 0; int map_flt_fd = 0; @@ -26,7 +26,7 @@ set_filter(struct filter* flt) { return 0; } -extern "C" __declspec(dllexport) DWORD +int check_five_tuple_exists(struct five_tuple* fvt) { int map_evt_req_fd; int value = 0; @@ -42,7 +42,7 @@ check_five_tuple_exists(struct five_tuple* fvt) { return 0; } -extern "C" __declspec(dllexport) DWORD +int attach_program_to_interface(int ifindx) { struct bpf_program* prg = bpf_object__find_program_by_name(obj, "event_writer"); bpf_link* link = NULL; @@ -61,7 +61,7 @@ attach_program_to_interface(int ifindx) { return 0; } -extern "C" __declspec(dllexport) DWORD +int pin_maps_load_programs(void) { struct bpf_program* prg = NULL; struct bpf_map *map_ev, *map_met, *map_fvt, *map_flt; @@ -133,7 +133,7 @@ pin_maps_load_programs(void) { } // Function to unload programs and detach -extern "C" __declspec(dllexport) DWORD +int unload_programs_detach() { for (auto it = link_list.begin(); it != link_list.end(); it ++) { auto ifidx = it->first; @@ -153,3 +153,10 @@ unload_programs_detach() { return 0; } + + +int main(void) { + + + return 0; +} \ No newline at end of file From e7dc9e0e92dec808147ea085286367767e44b296 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Mon, 17 Feb 2025 23:04:44 -0800 Subject: [PATCH 35/82] Testing INSTALL-EBPF-XDP#18 --- test/plugin/eventwriter/event_writer.vcxproj | 2 +- .../event_writer/x64/Debug/event_writer.log | 1 + test/plugin/eventwriter/event_writer_api.cpp | 32 ++++++++++++++++++- 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 test/plugin/eventwriter/event_writer/x64/Debug/event_writer.log diff --git a/test/plugin/eventwriter/event_writer.vcxproj b/test/plugin/eventwriter/event_writer.vcxproj index 386c17b505..75f2d5bcb8 100644 --- a/test/plugin/eventwriter/event_writer.vcxproj +++ b/test/plugin/eventwriter/event_writer.vcxproj @@ -35,7 +35,7 @@ Unicode - DynamicLibrary + Application false v143 true diff --git a/test/plugin/eventwriter/event_writer/x64/Debug/event_writer.log b/test/plugin/eventwriter/event_writer/x64/Debug/event_writer.log new file mode 100644 index 0000000000..94f7fb7281 --- /dev/null +++ b/test/plugin/eventwriter/event_writer/x64/Debug/event_writer.log @@ -0,0 +1 @@ +C:\Users\vpidatala\Code\vinodRetina\retina\test\plugin\eventwriter\event_writer.vcxproj(140,5): error : This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is packages\eBPF-for-Windows.x64.0.20.0\build\native\ebpf-for-windows.x64.props. diff --git a/test/plugin/eventwriter/event_writer_api.cpp b/test/plugin/eventwriter/event_writer_api.cpp index 49d0159248..0a029969af 100644 --- a/test/plugin/eventwriter/event_writer_api.cpp +++ b/test/plugin/eventwriter/event_writer_api.cpp @@ -154,9 +154,39 @@ unload_programs_detach() { return 0; } +std::vector get_interface_indices() { + std::vector interface_indices; + ULONG buffer_size = 0; + GetAdaptersAddresses(AF_UNSPEC, 0, NULL, NULL, &buffer_size); + std::vector buffer(buffer_size); + PIP_ADAPTER_ADDRESSES adapters = reinterpret_cast(buffer.data()); + + if (GetAdaptersAddresses(AF_UNSPEC, 0, NULL, adapters, &buffer_size) == NO_ERROR) { + for (PIP_ADAPTER_ADDRESSES adapter = adapters; adapter != NULL; adapter = adapter->Next) { + interface_indices.push_back(adapter->IfIndex); + } + } else { + std::cerr << "Failed to get network adapters" << std::endl; + } -int main(void) { + return interface_indices; +} +int main() { + int ret; + ret = pin_maps_load_programs(); + if (ret != 0) { + return ret; + } + std::vector interface_indices = get_interface_indices(); + for (int ifindx : interface_indices) { + ret = attach_program_to_interface(ifindx); + if (ret != 0) { + return ret; + } + } + std::cout << "All programs attached successfully." << std::endl; + unload_programs_detach() return 0; } \ No newline at end of file From 7d5192ae72083d2cf15c3fb47a306dddb4b6b1e6 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Mon, 17 Feb 2025 23:40:18 -0800 Subject: [PATCH 36/82] Testing INSTALL-EBPF-XDP#19 --- test/e2e/jobs/jobs.go | 1 + test/e2e/retina_e2e_test.go | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/test/e2e/jobs/jobs.go b/test/e2e/jobs/jobs.go index 436015002d..207126abe5 100644 --- a/test/e2e/jobs/jobs.go +++ b/test/e2e/jobs/jobs.go @@ -108,6 +108,7 @@ func UninstallRetina(kubeConfigFilePath, chartPath string) *types.Job { func InstallEbpfXdp(kubeConfigFilePath string) *types.Job { job := types.NewJob("Install ebpf and xdp") + job.AddStep(&kubernetes.CreateNamespace{"ebpf-xdp-install", kubeConfigFilePath}, nil) job.AddStep(&kubernetes.ApplyYamlConfig{ KubeConfigFilePath: kubeConfigFilePath, diff --git a/test/e2e/retina_e2e_test.go b/test/e2e/retina_e2e_test.go index 3cefe0a10a..0b890322bb 100644 --- a/test/e2e/retina_e2e_test.go +++ b/test/e2e/retina_e2e_test.go @@ -11,7 +11,6 @@ import ( "github.com/microsoft/retina/test/e2e/common" "github.com/microsoft/retina/test/e2e/framework/helpers" - "github.com/microsoft/retina/test/e2e/framework/kubernetes" "github.com/microsoft/retina/test/e2e/framework/types" jobs "github.com/microsoft/retina/test/e2e/jobs" "github.com/stretchr/testify/require" @@ -59,7 +58,6 @@ func TestE2ERetina(t *testing.T) { createTestInfra.Run(ctx) // Install Ebpf and XDP - job.AddStep(&kubernetes.CreateNamespace{"ebpf-xdp-install", kubeConfigFilePath}, nil) installEbpfAndXDP := types.NewRunner(t, jobs.InstallEbpfXdp(kubeConfigFilePath)) installEbpfAndXDP.Run(ctx) From 6260e09d0792c856cd8b75c776063909510dbb63 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Tue, 18 Feb 2025 00:44:04 -0800 Subject: [PATCH 37/82] Testing INSTALL-EBPF-XDP#20 --- test/e2e/jobs/jobs.go | 4 +++- test/plugin/eventwriter/event_writer.vcxproj.filters | 7 ++++++- test/plugin/eventwriter/event_writer_api.cpp | 3 ++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/test/e2e/jobs/jobs.go b/test/e2e/jobs/jobs.go index 207126abe5..fa23bdabbd 100644 --- a/test/e2e/jobs/jobs.go +++ b/test/e2e/jobs/jobs.go @@ -108,7 +108,9 @@ func UninstallRetina(kubeConfigFilePath, chartPath string) *types.Job { func InstallEbpfXdp(kubeConfigFilePath string) *types.Job { job := types.NewJob("Install ebpf and xdp") - job.AddStep(&kubernetes.CreateNamespace{"ebpf-xdp-install", kubeConfigFilePath}, nil) + job.AddStep(&kubernetes.CreateNamespace{ + Namespace: "ebpf-xdp-install", + KubeConfigFilePath: kubeConfigFilePath}, nil) job.AddStep(&kubernetes.ApplyYamlConfig{ KubeConfigFilePath: kubeConfigFilePath, diff --git a/test/plugin/eventwriter/event_writer.vcxproj.filters b/test/plugin/eventwriter/event_writer.vcxproj.filters index d6dfd78037..a433b610b7 100644 --- a/test/plugin/eventwriter/event_writer.vcxproj.filters +++ b/test/plugin/eventwriter/event_writer.vcxproj.filters @@ -1,7 +1,8 @@  - + + @@ -14,4 +15,8 @@ + + + + \ No newline at end of file diff --git a/test/plugin/eventwriter/event_writer_api.cpp b/test/plugin/eventwriter/event_writer_api.cpp index 0a029969af..b545ed3142 100644 --- a/test/plugin/eventwriter/event_writer_api.cpp +++ b/test/plugin/eventwriter/event_writer_api.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include "event_writer.h" #include "event_writer_util.h" @@ -166,7 +167,7 @@ std::vector get_interface_indices() { interface_indices.push_back(adapter->IfIndex); } } else { - std::cerr << "Failed to get network adapters" << std::endl; + fprintf(stderr, "Failed to get network adapters"); } return interface_indices; From 9c0af2c611c8e8fcf9ac93d1fc60e6497eb8a050 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Tue, 18 Feb 2025 02:36:01 -0800 Subject: [PATCH 38/82] Testing INSTALL-EBPF-XDP#21 --- test/e2e/jobs/jobs.go | 3 ++- test/plugin/eventwriter/event_writer.vcxproj | 6 +++--- test/plugin/eventwriter/event_writer_api.cpp | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/test/e2e/jobs/jobs.go b/test/e2e/jobs/jobs.go index fa23bdabbd..dc5a329645 100644 --- a/test/e2e/jobs/jobs.go +++ b/test/e2e/jobs/jobs.go @@ -107,11 +107,12 @@ func UninstallRetina(kubeConfigFilePath, chartPath string) *types.Job { } func InstallEbpfXdp(kubeConfigFilePath string) *types.Job { - job := types.NewJob("Install ebpf and xdp") + job := types.NewJob("Create namespace ebpf-xdp-install") job.AddStep(&kubernetes.CreateNamespace{ Namespace: "ebpf-xdp-install", KubeConfigFilePath: kubeConfigFilePath}, nil) + job := types.NewJob("Install ebpf and xdp") job.AddStep(&kubernetes.ApplyYamlConfig{ KubeConfigFilePath: kubeConfigFilePath, YamlFilePath: "yaml/windows/install-ebpf-xdp.yaml", diff --git a/test/plugin/eventwriter/event_writer.vcxproj b/test/plugin/eventwriter/event_writer.vcxproj index 75f2d5bcb8..c8ea950e16 100644 --- a/test/plugin/eventwriter/event_writer.vcxproj +++ b/test/plugin/eventwriter/event_writer.vcxproj @@ -74,7 +74,7 @@ true false $(SolutionDir)packages\eBPF-for-Windows.x64.0.20.0\build\native\lib;$(SolutionDir)packages\XDP-for-Windows.1.1.0\build\native\lib;%(AdditionalLibraryDirectories) - ebpfapi.lib;%(AdditionalDependencies) + iphlpapi.lib;ebpfapi.lib;%(AdditionalDependencies) true @@ -88,7 +88,7 @@ true NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true - $(SolutionDir)packages\eBPF-for-Windows.x64.0.20.0\build\native\include;$(SolutionDir)packages\XDP-for-Windows.1.1.0\build\native\include;%(AdditionalIncludeDirectories) + $(SolutionDir)packages\eBPF-for-Windows.x64.0.20.0\build\native\include;$(SolutionDir)packages\XDP-for-Windows.1.1.0\build\native\include;C:\Users\vpidatala\Code\vinodRetina\retina\test\plugin\eventwriter\packages\Microsoft.Windows.SDK.CPP.10.0.26100.2454\c\Include\10.0.26100.0\um;%(AdditionalIncludeDirectories) stdcpp20 @@ -98,7 +98,7 @@ true false $(SolutionDir)packages\eBPF-for-Windows.x64.0.20.0\build\native\lib;$(SolutionDir)packages\XDP-for-Windows.1.1.0\build\native\lib;%(AdditionalLibraryDirectories) - ebpfapi.lib;%(AdditionalDependencies) + ebpfapi.lib;iphlpapi.lib;%(AdditionalDependencies) diff --git a/test/plugin/eventwriter/event_writer_api.cpp b/test/plugin/eventwriter/event_writer_api.cpp index b545ed3142..72765b72e0 100644 --- a/test/plugin/eventwriter/event_writer_api.cpp +++ b/test/plugin/eventwriter/event_writer_api.cpp @@ -187,7 +187,7 @@ int main() { } } - std::cout << "All programs attached successfully." << std::endl; + printf("All programs attached successfully.\n"); unload_programs_detach() return 0; } \ No newline at end of file From 760afd120fee6ad2ee7b81bd12ee648962703aee Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Tue, 18 Feb 2025 09:41:25 -0800 Subject: [PATCH 39/82] Testing INSTALL-EBPF-XDP#22 --- test/e2e/jobs/jobs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/jobs/jobs.go b/test/e2e/jobs/jobs.go index dc5a329645..b2890f26e9 100644 --- a/test/e2e/jobs/jobs.go +++ b/test/e2e/jobs/jobs.go @@ -112,7 +112,7 @@ func InstallEbpfXdp(kubeConfigFilePath string) *types.Job { Namespace: "ebpf-xdp-install", KubeConfigFilePath: kubeConfigFilePath}, nil) - job := types.NewJob("Install ebpf and xdp") + job = types.NewJob("Install ebpf and xdp") job.AddStep(&kubernetes.ApplyYamlConfig{ KubeConfigFilePath: kubeConfigFilePath, YamlFilePath: "yaml/windows/install-ebpf-xdp.yaml", From 030733093f6278fe9068dc64287b00f38751144a Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Tue, 18 Feb 2025 10:25:48 -0800 Subject: [PATCH 40/82] Testing INSTALL-EBPF-XDP#JOB --- test/e2e/jobs/jobs.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/e2e/jobs/jobs.go b/test/e2e/jobs/jobs.go index b2890f26e9..77484bd343 100644 --- a/test/e2e/jobs/jobs.go +++ b/test/e2e/jobs/jobs.go @@ -107,12 +107,10 @@ func UninstallRetina(kubeConfigFilePath, chartPath string) *types.Job { } func InstallEbpfXdp(kubeConfigFilePath string) *types.Job { - job := types.NewJob("Create namespace ebpf-xdp-install") + job := types.NewJob("Install ebpf and xdp") job.AddStep(&kubernetes.CreateNamespace{ - Namespace: "ebpf-xdp-install", - KubeConfigFilePath: kubeConfigFilePath}, nil) + Namespace: "ebpf-xdp-install"}, nil) - job = types.NewJob("Install ebpf and xdp") job.AddStep(&kubernetes.ApplyYamlConfig{ KubeConfigFilePath: kubeConfigFilePath, YamlFilePath: "yaml/windows/install-ebpf-xdp.yaml", From 39fa5e05d13abd738bd73c1bfaf9f9024c802b81 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Tue, 18 Feb 2025 11:59:12 -0800 Subject: [PATCH 41/82] Testing INSTALL-EBPF-XDP#JOB#1 --- test/e2e/jobs/jobs.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/e2e/jobs/jobs.go b/test/e2e/jobs/jobs.go index 77484bd343..a6408b1d6e 100644 --- a/test/e2e/jobs/jobs.go +++ b/test/e2e/jobs/jobs.go @@ -109,11 +109,11 @@ func UninstallRetina(kubeConfigFilePath, chartPath string) *types.Job { func InstallEbpfXdp(kubeConfigFilePath string) *types.Job { job := types.NewJob("Install ebpf and xdp") job.AddStep(&kubernetes.CreateNamespace{ - Namespace: "ebpf-xdp-install"}, nil) + KubeConfigFilePath: kubeConfigFilePath, + Namespace: "ebpf-xdp-install"}, nil) job.AddStep(&kubernetes.ApplyYamlConfig{ - KubeConfigFilePath: kubeConfigFilePath, - YamlFilePath: "yaml/windows/install-ebpf-xdp.yaml", + YamlFilePath: "yaml/windows/install-ebpf-xdp.yaml", }, nil) return job From 4493f49f86bcf9392ff8222eb57fc5ada6c2d8fb Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Tue, 18 Feb 2025 14:30:07 -0800 Subject: [PATCH 42/82] apply YAML config - switched to job --- test/e2e/retina_e2e_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/e2e/retina_e2e_test.go b/test/e2e/retina_e2e_test.go index 0b890322bb..01f076e26d 100644 --- a/test/e2e/retina_e2e_test.go +++ b/test/e2e/retina_e2e_test.go @@ -8,6 +8,7 @@ import ( "os" "path/filepath" "testing" + "time" "github.com/microsoft/retina/test/e2e/common" "github.com/microsoft/retina/test/e2e/framework/helpers" @@ -67,6 +68,7 @@ func TestE2ERetina(t *testing.T) { } }) + time.Sleep(10 * time.Minute) // Install and test Retina basic metrics basicMetricsE2E := types.NewRunner(t, jobs.InstallAndTestRetinaBasicMetrics(kubeConfigFilePath, chartPath, common.TestPodNamespace)) basicMetricsE2E.Run(ctx) From adc426d748c64b4771001a49fefa9a89af19ac3e Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Tue, 18 Feb 2025 15:30:00 -0800 Subject: [PATCH 43/82] apply YAML config - switched to job#2 --- test/e2e/yaml/windows/install-ebpf-xdp.yaml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/e2e/yaml/windows/install-ebpf-xdp.yaml b/test/e2e/yaml/windows/install-ebpf-xdp.yaml index fc5a312cfc..f1488ba0c3 100644 --- a/test/e2e/yaml/windows/install-ebpf-xdp.yaml +++ b/test/e2e/yaml/windows/install-ebpf-xdp.yaml @@ -1,12 +1,9 @@ -apiVersion: apps/v1 -kind: DaemonSet +apiVersion: batch/v1 +kind: Job metadata: name: ebpf-xdp-install namespace: ebpf-xdp-install # Ensure this namespace exists spec: - selector: - matchLabels: - name: ebpf-xdp-install template: metadata: labels: @@ -19,6 +16,7 @@ spec: - powershell.exe - -command - | + echo "Downloading install-ebpf-xdp.ps1" Invoke-WebRequest -Uri "https://raw.githubusercontent.com/vpidatala94/retina/user/vpidatala/POC/8/scripts/install-ebpf-xdp.ps1" -OutFile "C:\install-ebpf-xdp.ps1"; & C:\install-ebpf-xdp.ps1; # Instead of infinite sleep, consider a more specific wait or loop @@ -31,8 +29,12 @@ spec: - Test-Path C:\install-ebpf-xdp-probe-ready initialDelaySeconds: 10 periodSeconds: 5 + restartPolicy: Never + hostNetwork: true # Required for HostProcess nodeSelector: kubernetes.io/os: windows securityContext: windowsOptions: - runAsUserName: "NT AUTHORITY\\SYSTEM" \ No newline at end of file + hostProcess: true + runAsUserName: "Administrator" + backoffLimit: 4 \ No newline at end of file From 57daa98bf1b4af8b299d3475b6badd59e6373fc0 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Tue, 18 Feb 2025 16:09:11 -0800 Subject: [PATCH 44/82] apply YAML config - switched to job#2 --- test/e2e/yaml/windows/install-ebpf-xdp.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/e2e/yaml/windows/install-ebpf-xdp.yaml b/test/e2e/yaml/windows/install-ebpf-xdp.yaml index f1488ba0c3..a830497d65 100644 --- a/test/e2e/yaml/windows/install-ebpf-xdp.yaml +++ b/test/e2e/yaml/windows/install-ebpf-xdp.yaml @@ -1,22 +1,26 @@ -apiVersion: batch/v1 -kind: Job +apiVersion: apps/v1 +kind: DaemonSet metadata: name: ebpf-xdp-install namespace: ebpf-xdp-install # Ensure this namespace exists spec: + selector: + matchLabels: + name: ebpf-xdp-install template: metadata: labels: name: ebpf-xdp-install spec: + hostProcess: true # Required for HostProcess containers: - name: ebpf-xdp-install-container - image: mcr.microsoft.com/windows/servercore:ltsc2022 + image: mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0 command: - powershell.exe - -command - | - echo "Downloading install-ebpf-xdp.ps1" + echo "Installing eBPF XDP..." Invoke-WebRequest -Uri "https://raw.githubusercontent.com/vpidatala94/retina/user/vpidatala/POC/8/scripts/install-ebpf-xdp.ps1" -OutFile "C:\install-ebpf-xdp.ps1"; & C:\install-ebpf-xdp.ps1; # Instead of infinite sleep, consider a more specific wait or loop @@ -29,12 +33,8 @@ spec: - Test-Path C:\install-ebpf-xdp-probe-ready initialDelaySeconds: 10 periodSeconds: 5 - restartPolicy: Never - hostNetwork: true # Required for HostProcess nodeSelector: kubernetes.io/os: windows securityContext: windowsOptions: - hostProcess: true - runAsUserName: "Administrator" - backoffLimit: 4 \ No newline at end of file + runAsUserName: "NT AUTHORITY\\SYSTEM" \ No newline at end of file From 8f84b180b6d4162ba1edc96e74158cf35c00d5c6 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Tue, 18 Feb 2025 17:35:00 -0800 Subject: [PATCH 45/82] apply YAML config - switched to job#3 --- test/e2e/yaml/windows/install-ebpf-xdp.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/e2e/yaml/windows/install-ebpf-xdp.yaml b/test/e2e/yaml/windows/install-ebpf-xdp.yaml index a830497d65..9c8f1e6186 100644 --- a/test/e2e/yaml/windows/install-ebpf-xdp.yaml +++ b/test/e2e/yaml/windows/install-ebpf-xdp.yaml @@ -12,7 +12,6 @@ spec: labels: name: ebpf-xdp-install spec: - hostProcess: true # Required for HostProcess containers: - name: ebpf-xdp-install-container image: mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0 @@ -33,8 +32,10 @@ spec: - Test-Path C:\install-ebpf-xdp-probe-ready initialDelaySeconds: 10 periodSeconds: 5 + hostNetwork: true nodeSelector: kubernetes.io/os: windows securityContext: windowsOptions: + hostProcess: true runAsUserName: "NT AUTHORITY\\SYSTEM" \ No newline at end of file From ad97e9b147c506dbcbc49b0fbaae2e3206a015ab Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Tue, 18 Feb 2025 19:26:25 -0800 Subject: [PATCH 46/82] apply YAML config - switched to job#4 --- test/e2e/yaml/windows/install-ebpf-xdp.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/e2e/yaml/windows/install-ebpf-xdp.yaml b/test/e2e/yaml/windows/install-ebpf-xdp.yaml index 9c8f1e6186..2c5ea6134a 100644 --- a/test/e2e/yaml/windows/install-ebpf-xdp.yaml +++ b/test/e2e/yaml/windows/install-ebpf-xdp.yaml @@ -19,10 +19,10 @@ spec: - powershell.exe - -command - | - echo "Installing eBPF XDP..." - Invoke-WebRequest -Uri "https://raw.githubusercontent.com/vpidatala94/retina/user/vpidatala/POC/8/scripts/install-ebpf-xdp.ps1" -OutFile "C:\install-ebpf-xdp.ps1"; - & C:\install-ebpf-xdp.ps1; - # Instead of infinite sleep, consider a more specific wait or loop + echo "Installing eBPF XDP..."; + #Invoke-WebRequest -Uri "https://raw.githubusercontent.com/vpidatala94/retina/user/vpidatala/POC/8/scripts/install-ebpf-xdp.ps1" -OutFile "C:\install-ebpf-xdp.ps1"; + #& C:\install-ebpf-xdp.ps1; + New-Item -Path "C:\install-ebpf-xdp-probe-ready" -ItemType File -Force; while ($true) { Start-Sleep -Seconds 300; } readinessProbe: exec: From d7f9f7f02df72d6b9a74c3144ba03f46453ba73e Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Tue, 18 Feb 2025 19:44:44 -0800 Subject: [PATCH 47/82] apply YAML config - switched to job#3 --- test/e2e/yaml/windows/install-ebpf-xdp.yaml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/test/e2e/yaml/windows/install-ebpf-xdp.yaml b/test/e2e/yaml/windows/install-ebpf-xdp.yaml index 2c5ea6134a..7dcf6a0206 100644 --- a/test/e2e/yaml/windows/install-ebpf-xdp.yaml +++ b/test/e2e/yaml/windows/install-ebpf-xdp.yaml @@ -18,12 +18,7 @@ spec: command: - powershell.exe - -command - - | - echo "Installing eBPF XDP..."; - #Invoke-WebRequest -Uri "https://raw.githubusercontent.com/vpidatala94/retina/user/vpidatala/POC/8/scripts/install-ebpf-xdp.ps1" -OutFile "C:\install-ebpf-xdp.ps1"; - #& C:\install-ebpf-xdp.ps1; - New-Item -Path "C:\install-ebpf-xdp-probe-ready" -ItemType File -Force; - while ($true) { Start-Sleep -Seconds 300; } + - "echo 'Installing eBPF XDP...'; Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/vpidatala94/retina/user/vpidatala/POC/8/scripts/install-ebpf-xdp.ps1' -OutFile 'C:\install-ebpf-xdp.ps1'; while ($true) { Start-Sleep -Seconds 300; }" readinessProbe: exec: command: From 3809135b3ae905e68b6e6ad394c9063c6283928e Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Tue, 18 Feb 2025 19:50:06 -0800 Subject: [PATCH 48/82] apply YAML config - switched to job#4 --- test/e2e/yaml/windows/install-ebpf-xdp.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/yaml/windows/install-ebpf-xdp.yaml b/test/e2e/yaml/windows/install-ebpf-xdp.yaml index 7dcf6a0206..cad17d26ce 100644 --- a/test/e2e/yaml/windows/install-ebpf-xdp.yaml +++ b/test/e2e/yaml/windows/install-ebpf-xdp.yaml @@ -18,7 +18,7 @@ spec: command: - powershell.exe - -command - - "echo 'Installing eBPF XDP...'; Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/vpidatala94/retina/user/vpidatala/POC/8/scripts/install-ebpf-xdp.ps1' -OutFile 'C:\install-ebpf-xdp.ps1'; while ($true) { Start-Sleep -Seconds 300; }" + - "echo 'Installing eBPF XDP...'; Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/vpidatala94/retina/user/vpidatala/POC/8/scripts/install-ebpf-xdp.ps1' -OutFile 'C:\install-ebpf-xdp.ps1'; & C:\install-ebpf-xdp.ps1; while ($true) { Start-Sleep -Seconds 300; }" readinessProbe: exec: command: From 2d8b0a47906a531a862beeca01e388c367439a97 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Tue, 18 Feb 2025 19:52:58 -0800 Subject: [PATCH 49/82] apply YAML config - switched to job#5 --- test/e2e/yaml/windows/install-ebpf-xdp.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/yaml/windows/install-ebpf-xdp.yaml b/test/e2e/yaml/windows/install-ebpf-xdp.yaml index cad17d26ce..eb7bd81b4f 100644 --- a/test/e2e/yaml/windows/install-ebpf-xdp.yaml +++ b/test/e2e/yaml/windows/install-ebpf-xdp.yaml @@ -18,7 +18,7 @@ spec: command: - powershell.exe - -command - - "echo 'Installing eBPF XDP...'; Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/vpidatala94/retina/user/vpidatala/POC/8/scripts/install-ebpf-xdp.ps1' -OutFile 'C:\install-ebpf-xdp.ps1'; & C:\install-ebpf-xdp.ps1; while ($true) { Start-Sleep -Seconds 300; }" + - 'echo "Installing eBPF XDP..."; Invoke-WebRequest -Uri "https://raw.githubusercontent.com/vpidatala94/retina/user/vpidatala/POC/8/scripts/install-ebpf-xdp.ps1" -OutFile "C:\\install-ebpf-xdp.ps1"; & C:\\install-ebpf-xdp.ps1; while ($true) { Start-Sleep -Seconds 300; }' readinessProbe: exec: command: From 1f590f1e19fc6f79f27cbc36af48a186e6051792 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Tue, 18 Feb 2025 21:13:58 -0800 Subject: [PATCH 50/82] apply YAML config - switched to job#6 --- scripts/install-ebpf-xdp.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install-ebpf-xdp.ps1 b/scripts/install-ebpf-xdp.ps1 index 687804fe22..a144561926 100644 --- a/scripts/install-ebpf-xdp.ps1 +++ b/scripts/install-ebpf-xdp.ps1 @@ -211,7 +211,7 @@ Function Disable-TestSigning Write-Host -Object:"`tDisabling Test Signing" - If(Assert-TestSigningIsEnabled -Silent) + If(Assert-TestSigningIsEnabled) { Start-Process -FilePath:"$($env:WinDir)\System32\BCDEdit.exe" -ArgumentList @('/Set TestSigning Off') -PassThru | Wait-Process From 5876971dd6f81fa3af906d34a433f92a31a86836 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Tue, 18 Feb 2025 21:19:21 -0800 Subject: [PATCH 51/82] apply YAML config - switched to job#7 --- scripts/install-ebpf-xdp.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install-ebpf-xdp.ps1 b/scripts/install-ebpf-xdp.ps1 index a144561926..65376a7ecf 100644 --- a/scripts/install-ebpf-xdp.ps1 +++ b/scripts/install-ebpf-xdp.ps1 @@ -596,7 +596,7 @@ Function Install-WindowsCilium Write-Host 'Installing Windows Cilium' - If(-Not (Assert-TestSigningIsEnabled -Silent)) + If(-Not (Assert-TestSigningIsEnabled)) { If(-Not (Enable-TestSigning -Reboot)) { Throw } } From 820764ab8c57dc5970f6e485f2c9985d1f842d15 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Tue, 18 Feb 2025 23:12:47 -0800 Subject: [PATCH 52/82] apply YAML config - switched to job#8 --- scripts/install-ebpf-xdp.ps1 | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/install-ebpf-xdp.ps1 b/scripts/install-ebpf-xdp.ps1 index 65376a7ecf..4fd552397d 100644 --- a/scripts/install-ebpf-xdp.ps1 +++ b/scripts/install-ebpf-xdp.ps1 @@ -42,7 +42,7 @@ Function Assert-SoftwareInstalled $software = Get-WmiObject -Class:'Win32_Product' | Where-Object -Property:'Name' -like "*$($SoftwareName)*" If($software -And - (-Not [String]::IsNullOrWhiteSpace($Version))) + (-Not [String]::IsNullOrWhiteSpace($SoftwareVersion))) { $software = $software | Where-Object -Property:'Version' -like "*$($SoftwareVersion)*" } @@ -60,7 +60,7 @@ Function Assert-SoftwareInstalled $isInstalled = $true If($ServiceState -And - -Not ($state.Staus -INE $ServiceState)) + -Not ($state.Status -INE $ServiceState)) { Write-Warning -Message:"`t$ServiceName is $$(state.Status)" } @@ -211,7 +211,7 @@ Function Disable-TestSigning Write-Host -Object:"`tDisabling Test Signing" - If(Assert-TestSigningIsEnabled) + If(Assert-TestSigningIsEnabled -Silent) { Start-Process -FilePath:"$($env:WinDir)\System32\BCDEdit.exe" -ArgumentList @('/Set TestSigning Off') -PassThru | Wait-Process @@ -389,12 +389,13 @@ Function Install-eBPF Try { + Write-Host 'Installing extended Berkley Packet Filter for Windows' If(-Not (Assert-TestSigningIsEnabled -Silent)) { If(-Not (Enable-TestSigning -Reboot)) { Throw } } - If(Assert-SoftwareInstalled -SoftwareName:'eBPF for Windows') + If(Assert-SoftwareInstalled -SoftwareName:'eBPFCore') { Write-Host 'extended Berkley Packet Filter for Windows is already installed' return $isSuccess @@ -542,6 +543,7 @@ Function Install-XDP } } + $state = Get-Service -Name:'XDP' } @@ -596,7 +598,7 @@ Function Install-WindowsCilium Write-Host 'Installing Windows Cilium' - If(-Not (Assert-TestSigningIsEnabled)) + If(-Not (Assert-TestSigningIsEnabled -Silent)) { If(-Not (Enable-TestSigning -Reboot)) { Throw } } @@ -617,6 +619,7 @@ Function Install-WindowsCilium } Catch { + Write-Host "Exception: $_" $isSuccess = $false } From fa6159d21c9248e34ecc2297ab251552f0a29304 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Tue, 18 Feb 2025 23:16:12 -0800 Subject: [PATCH 53/82] apply YAML config - switched to job#9 --- scripts/install-ebpf-xdp.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install-ebpf-xdp.ps1 b/scripts/install-ebpf-xdp.ps1 index 4fd552397d..dcb0ece150 100644 --- a/scripts/install-ebpf-xdp.ps1 +++ b/scripts/install-ebpf-xdp.ps1 @@ -395,7 +395,7 @@ Function Install-eBPF If(-Not (Enable-TestSigning -Reboot)) { Throw } } - If(Assert-SoftwareInstalled -SoftwareName:'eBPFCore') + If(Assert-SoftwareInstalled -SoftwareName:'ebpf-for-windows') { Write-Host 'extended Berkley Packet Filter for Windows is already installed' return $isSuccess @@ -603,9 +603,9 @@ Function Install-WindowsCilium If(-Not (Enable-TestSigning -Reboot)) { Throw } } - If(-Not (Install-eBPF -LocalPath:"$($LocalPath)")) {Throw} + If(-Not (Install-eBPF)) {Throw} - If(-Not (Install-XDP -LocalPath:"$($LocalPath)")) {Throw} + If(-Not (Install-XDP)) {Throw} # Create the probe ready file New-Item -Path "C:\install-ebpf-xdp-probe-ready" -ItemType File -Force From 32c4718ba56953925acd0955c165a9dfb14a131d Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Tue, 18 Feb 2025 23:28:51 -0800 Subject: [PATCH 54/82] apply YAML config - switched to job#10 --- scripts/install-ebpf-xdp.ps1 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/install-ebpf-xdp.ps1 b/scripts/install-ebpf-xdp.ps1 index dcb0ece150..427e3bbdc8 100644 --- a/scripts/install-ebpf-xdp.ps1 +++ b/scripts/install-ebpf-xdp.ps1 @@ -372,7 +372,7 @@ Function Assert-WindowsCiliumIsReady .Example # Install eBPF for Windows - Install-eBPF -LocalPath:"$($env:LocalAppData)\Temp" + Install-eBPF -LocalPath:"$env:TEMP" #> Function Install-eBPF { @@ -382,7 +382,7 @@ Function Install-eBPF ( [Parameter(ParameterSetName='Default',Mandatory=$false)] [ValidateScript({Test-Path $_ -PathType:'Container'})] - [String] $LocalPath = "$($env:LocalAppData)\Temp" + [String] $LocalPath = "$env:TEMP" ) [Boolean] $isSuccess = $true @@ -445,7 +445,7 @@ Function Install-eBPF .Example # Install the eXpress Data Path service - Install-XDP -LocalPath:"$($env:LocalAppData)\Temp" + Install-XDP -LocalPath:"$env:TEMP" #> Function Install-XDP { @@ -455,7 +455,7 @@ Function Install-XDP ( [Parameter(ParameterSetName='Default',Mandatory=$false)] [ValidateScript({Test-Path $_ -PathType:'Container'})] - [String] $LocalPath = "$($env:LocalAppData)\Temp" + [String] $LocalPath = "$env:TEMP" ) [Boolean] $isSuccess = $true @@ -652,7 +652,7 @@ Function Uninstall-eBPF ( [Parameter(ParameterSetName='Default',Mandatory=$false)] [ValidateScript({Test-Path $_ -PathType:'Container'})] - [String] $LocalPath = "$($env:LocalAppData)\Temp" + [String] $LocalPath = "$env:TEMP" ) Write-Host 'Uninstalling the extended Berkley Packet Filter for Windows' @@ -746,7 +746,7 @@ Function Uninstall-XDP ( [Parameter(ParameterSetName='Default',Mandatory=$false)] [ValidateScript({Test-Path $_ -PathType:'Container'})] - [String] $LocalPath = "$($env:LocalAppData)\Temp" + [String] $LocalPath = "$env:TEMP" ) Write-Host 'Uninstalling eXpress Data Path for Windows' @@ -839,7 +839,7 @@ Function Uninstall-WindowsCilium ( [Parameter(ParameterSetName='Default',Mandatory=$false)] [ValidateScript({Test-Path $_ -PathType:'Container'})] - [String] $LocalPath = "$($env:LocalAppData)\Temp", + [String] $LocalPath = "$env:TEMP", [Parameter(ParameterSetName='Default',Mandatory=$false)] [Switch] $DisableTestSigning, From eb3cf4ad24a434c422012178eed2acbbd3a1c7df Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Tue, 18 Feb 2025 23:36:56 -0800 Subject: [PATCH 55/82] apply YAML config - switched to job#11 --- scripts/install-ebpf-xdp.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install-ebpf-xdp.ps1 b/scripts/install-ebpf-xdp.ps1 index 427e3bbdc8..4973c03d13 100644 --- a/scripts/install-ebpf-xdp.ps1 +++ b/scripts/install-ebpf-xdp.ps1 @@ -422,8 +422,8 @@ Function Install-eBPF Catch { $isSuccess = $false - - Uninstall-eBPF -LocalPath:"$($LocalPath)" + Write-Host "EBPF install failed : $_" + Uninstall-eBPF } Return $isSuccess @@ -567,8 +567,8 @@ Function Install-XDP Catch { $isSuccess = $false - - Uninstall-XDP -LocalPath:"$($LocalPath)" + Write-Host "XDP install failed : $_" + Uninstall-XDP } Return $isSuccess From cf4cdd5e726c0a849662cf5eab54428501230554 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Tue, 18 Feb 2025 23:49:47 -0800 Subject: [PATCH 56/82] removing mock restart --- scripts/install-ebpf-xdp.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install-ebpf-xdp.ps1 b/scripts/install-ebpf-xdp.ps1 index 4973c03d13..09334d655f 100644 --- a/scripts/install-ebpf-xdp.ps1 +++ b/scripts/install-ebpf-xdp.ps1 @@ -614,7 +614,7 @@ Function Install-WindowsCilium Start-Sleep -Seconds:5 - Restart-Computer + #Restart-Computer } Catch From b2f9280ee27372c248155d2d58f737c3fa8579c0 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Wed, 19 Feb 2025 00:11:01 -0800 Subject: [PATCH 57/82] ebpf curl fixed --- scripts/install-ebpf-xdp.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install-ebpf-xdp.ps1 b/scripts/install-ebpf-xdp.ps1 index 09334d655f..b6b0fc1ddc 100644 --- a/scripts/install-ebpf-xdp.ps1 +++ b/scripts/install-ebpf-xdp.ps1 @@ -404,7 +404,7 @@ Function Install-eBPF Write-Host 'Installing extended Berkley Packet Filter for Windows' $ProgressPreference = 'SilentlyContinue' # Download eBPF-for-Windows. - $packageEbpfUrl = "https://github.com/microsoft/ebpf-for-windows/releases/download/Release-v0.20.0/Build-x64-native-only-NativeOnlyRelease.zip" + $packageEbpfUrl = "https://github.com/microsoft/ebpf-for-windows/releases/download/Release-v0.20.0/Build-x64-native-only.NativeOnlyRelease.zip" Invoke-WebRequest -Uri $packageEbpfUrl -OutFile "$LocalPath\\Build-x64-native-only-NativeOnlyRelease.zip" Expand-Archive -Path "$LocalPath\\Build-x64-native-only-NativeOnlyRelease.zip" -DestinationPath "$LocalPath\\Build-x64-native-only-NativeOnlyRelease\\msi" Start-Process -FilePath:"$($env:WinDir)\System32\MSIExec.exe" -ArgumentList @("/i $($LocalPath)\ebpf-for-windows.msi", '/qn', "INSTALLFOLDER=`"$($env:ProgramFiles)\ebpf-for-windows`"", 'ADDLOCAL=eBPF_Runtime_Components') -PassThru | Wait-Process From bceba984a8564e406ff3090db359b13df7756f9f Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Wed, 19 Feb 2025 00:23:17 -0800 Subject: [PATCH 58/82] ebpf curl fixed#2 --- scripts/install-ebpf-xdp.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install-ebpf-xdp.ps1 b/scripts/install-ebpf-xdp.ps1 index b6b0fc1ddc..8f99a45efe 100644 --- a/scripts/install-ebpf-xdp.ps1 +++ b/scripts/install-ebpf-xdp.ps1 @@ -395,7 +395,7 @@ Function Install-eBPF If(-Not (Enable-TestSigning -Reboot)) { Throw } } - If(Assert-SoftwareInstalled -SoftwareName:'ebpf-for-windows') + If(Assert-SoftwareInstalled -SoftwareName:'ebpfCore') { Write-Host 'extended Berkley Packet Filter for Windows is already installed' return $isSuccess From ef83ec1992723b71c4c9b9a216ed870a5ac5b66a Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Wed, 19 Feb 2025 00:56:48 -0800 Subject: [PATCH 59/82] ebpf curl fixed#3 --- scripts/install-ebpf-xdp.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/install-ebpf-xdp.ps1 b/scripts/install-ebpf-xdp.ps1 index 8f99a45efe..834e05446b 100644 --- a/scripts/install-ebpf-xdp.ps1 +++ b/scripts/install-ebpf-xdp.ps1 @@ -390,12 +390,12 @@ Function Install-eBPF Try { Write-Host 'Installing extended Berkley Packet Filter for Windows' - If(-Not (Assert-TestSigningIsEnabled -Silent)) + If(-Not (Assert-TestSigningIsEnabled)) { If(-Not (Enable-TestSigning -Reboot)) { Throw } } - If(Assert-SoftwareInstalled -SoftwareName:'ebpfCore') + If(Assert-SoftwareInstalled -ServiceName:"eBPFCore") { Write-Host 'extended Berkley Packet Filter for Windows is already installed' return $isSuccess @@ -417,7 +417,7 @@ Function Install-eBPF Throw } - $isSuccess = Assert-SoftwareInstalled -SoftwareName:'eBPF for Windows' + $isSuccess = Assert-SoftwareInstalled -ServiceName:"eBPFCore" } Catch { @@ -474,9 +474,9 @@ Function Install-XDP Invoke-WebRequest -Uri $packageXdpUrl -OutFile "$LocalPath\\bin_Release_x64.zip" Expand-Archive -Path "$LocalPath\\bin_Release_x64.zip" -DestinationPath "$LocalPath\\bin_Release_x64" copy "$LocalPath\\bin_Release_x64\\amd64fre\\xdp.cer" $LocalPath - CertUtil.exe -addstore Root $LocalPath\xdp.cer - CertUtil.exe -addstore TrustedPublisher $LocalPath\xdp.cer - Start-Process -FilePath:"$($env:WinDir)\System32\MSIExec.exe" -ArgumentList @("/i $($LocalPath)\xdp-for-windows.1.1.0.msi", '/qn') -PassThru | Wait-Process + CertUtil.exe -addstore Root xdp.cer + CertUtil.exe -addstore TrustedPublisher xdp.cer + Start-Process -FilePath:"$($env:WinDir)\System32\MSIExec.exe" -ArgumentList @("/i $LocalPath\bin_Release_x64\xdp-for-windows.1.1.0.msi", '/qn') -PassThru | Wait-Process sc.exe query xdp reg.exe add HKLM\\SYSTEM\\CurrentControlSet\\Services\\xdp\\Parameters /v XdpEbpfEnabled /d 1 /t REG_DWORD /f net.exe stop xdp From bf16fed87720fe857d179f8fe659a0b7bef0308d Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Wed, 19 Feb 2025 01:07:55 -0800 Subject: [PATCH 60/82] ebpf curl fixed#4 --- scripts/install-ebpf-xdp.ps1 | 85 +++--------------------------------- 1 file changed, 5 insertions(+), 80 deletions(-) diff --git a/scripts/install-ebpf-xdp.ps1 b/scripts/install-ebpf-xdp.ps1 index 834e05446b..b90f49596c 100644 --- a/scripts/install-ebpf-xdp.ps1 +++ b/scripts/install-ebpf-xdp.ps1 @@ -476,93 +476,18 @@ Function Install-XDP copy "$LocalPath\\bin_Release_x64\\amd64fre\\xdp.cer" $LocalPath CertUtil.exe -addstore Root xdp.cer CertUtil.exe -addstore TrustedPublisher xdp.cer - Start-Process -FilePath:"$($env:WinDir)\System32\MSIExec.exe" -ArgumentList @("/i $LocalPath\bin_Release_x64\xdp-for-windows.1.1.0.msi", '/qn') -PassThru | Wait-Process + Invoke-WebRequest -Uri "https://github.com/microsoft/xdp-for-windows/releases/download/v1.1.0%2Bbed474a/xdp-for-windows.1.1.0.msi" -OutFile "$LocalPath\xdp-for-windows.1.1.0.msi" + Start-Process -FilePath:"$($env:WinDir)\System32\MSIExec.exe" -ArgumentList @("/i $LocalPath\xdp-for-windows.1.1.0.msi", '/qn') -PassThru | Wait-Process sc.exe query xdp reg.exe add HKLM\\SYSTEM\\CurrentControlSet\\Services\\xdp\\Parameters /v XdpEbpfEnabled /d 1 /t REG_DWORD /f net.exe stop xdp net.exe start xdp Write-Output "XDP for Windows installed" - - $regValue = New-ItemProperty -Path:'HKLM:\SYSTEM\CurrentControlSet\Services\xdp\Parameters' -Name:'xdpEbpfEnabled' -PropertyType:'DWORD' -Value:1 -Force - If($regValue.xdpEbpfEnabled -IEQ 1) - { - [Object] $state = Get-Service -Name:'XDP' - - For([Byte]$i = 0; - $i -ILE 5; - $i++) - { - If($state.Status -IEQ 'Stopped') - { - Break - } - Else - { - If($state.Status -IEQ 'Running') - { - Stop-Service -Name:'XDP' -Force - } - ElseIf($state.Status -IEQ 'StopPending') - { - Start-Sleep -Seconds:5 - } - Else - { - Write-Error -Message:"XDP service is $($state.status)" - - Throw - } - } - - $state = Get-Service -Name:'XDP' - } - - For([Byte]$i = 0; - $i -ILE 5; - $i++) - { - If($state.Status -IEQ 'Running') - { - Break - } - Else - { - If($state.Status -IEQ 'Stopped') - { - Start-Service -Name:'XDP' - } - ElseIf($state.Status -IEQ 'StartPending') - { - Start-Sleep -Seconds:5 - } - Else - { - Write-Error -Message:"XDP service is $($state.Status)" - - Throw - } - } - - - $state = Get-Service -Name:'XDP' - } - - If(-Not (Assert-SoftwareInstalled -ServiceName:'XDP' -Silent)) - { - Write-Error -Message:"`tXDP service failed to install" - - Throw - } - - $isSuccess = Assert-SoftwareInstalled -SoftwareName:'XDP for Windows' - } - Else - { - Write-Error -Message:"`tFailed to set regKey" - } - Write-Host "Setting SDDL for XDP service" xdpcfg.exe SetDeviceSddl "D:P(A;;GA;;;SY)(A;;GA;;;BA)" + If(-Not (Assert-SoftwareInstalled -SoftwareName:'XDP for Windows' -Silent)) { + Throw + } } Catch { From 20bd6c277fdc5822bb3c802eadd34c65bbffe730 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Wed, 19 Feb 2025 01:26:58 -0800 Subject: [PATCH 61/82] ebpf curl fixed#5 --- scripts/install-ebpf-xdp.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install-ebpf-xdp.ps1 b/scripts/install-ebpf-xdp.ps1 index b90f49596c..704bb136d8 100644 --- a/scripts/install-ebpf-xdp.ps1 +++ b/scripts/install-ebpf-xdp.ps1 @@ -472,7 +472,7 @@ Function Install-XDP Write-Host 'Installing eXpress Data Path for Windows' $packageXdpUrl = "https://github.com/microsoft/xdp-for-windows/releases/download/v1.1.0%2Bbed474a/bin_Release_x64.zip" Invoke-WebRequest -Uri $packageXdpUrl -OutFile "$LocalPath\\bin_Release_x64.zip" - Expand-Archive -Path "$LocalPath\\bin_Release_x64.zip" -DestinationPath "$LocalPath\\bin_Release_x64" + Expand-Archive -Path "$LocalPath\\bin_Release_x64.zip" -DestinationPath "$LocalPath\\bin_Release_x64" -Force copy "$LocalPath\\bin_Release_x64\\amd64fre\\xdp.cer" $LocalPath CertUtil.exe -addstore Root xdp.cer CertUtil.exe -addstore TrustedPublisher xdp.cer From f9066906e557a3a094fd53033b921c7bae7c8121 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Wed, 19 Feb 2025 01:44:01 -0800 Subject: [PATCH 62/82] XDP installed --- scripts/install-ebpf-xdp.ps1 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/install-ebpf-xdp.ps1 b/scripts/install-ebpf-xdp.ps1 index 704bb136d8..109546ef05 100644 --- a/scripts/install-ebpf-xdp.ps1 +++ b/scripts/install-ebpf-xdp.ps1 @@ -474,17 +474,18 @@ Function Install-XDP Invoke-WebRequest -Uri $packageXdpUrl -OutFile "$LocalPath\\bin_Release_x64.zip" Expand-Archive -Path "$LocalPath\\bin_Release_x64.zip" -DestinationPath "$LocalPath\\bin_Release_x64" -Force copy "$LocalPath\\bin_Release_x64\\amd64fre\\xdp.cer" $LocalPath - CertUtil.exe -addstore Root xdp.cer - CertUtil.exe -addstore TrustedPublisher xdp.cer + copy "$LocalPath\\bin_Release_x64\\amd64fre\\xdpcfg.exe" $LocalPath + CertUtil.exe -addstore Root "$LocalPath\xdp.cer" + CertUtil.exe -addstore TrustedPublisher "$LocalPath\xdp.cer" Invoke-WebRequest -Uri "https://github.com/microsoft/xdp-for-windows/releases/download/v1.1.0%2Bbed474a/xdp-for-windows.1.1.0.msi" -OutFile "$LocalPath\xdp-for-windows.1.1.0.msi" Start-Process -FilePath:"$($env:WinDir)\System32\MSIExec.exe" -ArgumentList @("/i $LocalPath\xdp-for-windows.1.1.0.msi", '/qn') -PassThru | Wait-Process sc.exe query xdp - reg.exe add HKLM\\SYSTEM\\CurrentControlSet\\Services\\xdp\\Parameters /v XdpEbpfEnabled /d 1 /t REG_DWORD /f + reg.exe add "HKLM\SYSTEM\CurrentControlSet\Services\xdp\Parameters" /v XdpEbpfEnabled /d 1 /t REG_DWORD /f net.exe stop xdp net.exe start xdp Write-Output "XDP for Windows installed" Write-Host "Setting SDDL for XDP service" - xdpcfg.exe SetDeviceSddl "D:P(A;;GA;;;SY)(A;;GA;;;BA)" + & "$LocalPath\xdpcfg.exe" SetDeviceSddl "D:P(A;;GA;;;SY)(A;;GA;;;BA)" If(-Not (Assert-SoftwareInstalled -SoftwareName:'XDP for Windows' -Silent)) { Throw } From 6140121a48c4a71fee508ca992ad2f9c13ca4ccb Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Wed, 19 Feb 2025 02:51:16 -0800 Subject: [PATCH 63/82] Event Writer EXE --- ...{event_writer_api.cpp => event_writer.cpp} | 80 +++++++++++-------- test/plugin/eventwriter/event_writer.vcxproj | 49 +----------- test/plugin/eventwriter/event_writer_util.cpp | 29 ------- test/plugin/eventwriter/event_writer_util.h | 6 -- test/plugin/eventwriter/packages.config | 10 +++ test/plugin/eventwriter/placeholder.go | 3 - 6 files changed, 59 insertions(+), 118 deletions(-) rename test/plugin/eventwriter/{event_writer_api.cpp => event_writer.cpp} (84%) delete mode 100644 test/plugin/eventwriter/event_writer_util.cpp delete mode 100644 test/plugin/eventwriter/event_writer_util.h create mode 100644 test/plugin/eventwriter/packages.config delete mode 100644 test/plugin/eventwriter/placeholder.go diff --git a/test/plugin/eventwriter/event_writer_api.cpp b/test/plugin/eventwriter/event_writer.cpp similarity index 84% rename from test/plugin/eventwriter/event_writer_api.cpp rename to test/plugin/eventwriter/event_writer.cpp index 72765b72e0..a94d6b3bd2 100644 --- a/test/plugin/eventwriter/event_writer_api.cpp +++ b/test/plugin/eventwriter/event_writer.cpp @@ -1,10 +1,11 @@ +#include +#include #include #include -#include -#include + #include #include "event_writer.h" -#include "event_writer_util.h" +#include std::vector> link_list; bpf_object* obj = NULL; @@ -27,20 +28,47 @@ set_filter(struct filter* flt) { return 0; } -int -check_five_tuple_exists(struct five_tuple* fvt) { - int map_evt_req_fd; - int value = 0; +int pin_map(const char* pin_path, bpf_map* map) { + int map_fd = 0; + // Attempt to open the pinned map + map_fd = bpf_obj_get(pin_path); + if (map_fd < 0) { + // Get the file descriptor of the map + map_fd = bpf_map__fd(map); + + if (map_fd < 0) { + fprintf(stderr, "%s - failed to get map file descriptor\n", __FUNCTION__); + return 1; + } - map_evt_req_fd = bpf_obj_get(FIVE_TUPLE_MAP_PIN_PATH); - if (map_evt_req_fd < 0) { - return 1; + if (bpf_obj_pin(map_fd, pin_path) < 0) { + fprintf(stderr, "%s - failed to pin map to %s\n", pin_path, __FUNCTION__); + return 1; + } + + printf("%s - map successfully pinned at %s\n", pin_path, __FUNCTION__); + } else { + printf("%s -pinned map found at %s\n", pin_path, __FUNCTION__); } - if (bpf_map_lookup_elem(map_evt_req_fd, fvt, &value) != 0) { - return 1; + return 0; +} + +std::vector get_interface_indices() { + std::vector interface_indices; + ULONG buffer_size = 0; + GetAdaptersAddresses(AF_UNSPEC, 0, NULL, NULL, &buffer_size); + std::vector buffer(buffer_size); + PIP_ADAPTER_ADDRESSES adapters = reinterpret_cast(buffer.data()); + + if (GetAdaptersAddresses(AF_UNSPEC, 0, NULL, adapters, &buffer_size) == NO_ERROR) { + for (PIP_ADAPTER_ADDRESSES adapter = adapters; adapter != NULL; adapter = adapter->Next) { + interface_indices.push_back(adapter->IfIndex); + } + } else { + fprintf(stderr, "Failed to get network adapters"); } - return 0; + return interface_indices; } int @@ -155,26 +183,10 @@ unload_programs_detach() { return 0; } -std::vector get_interface_indices() { - std::vector interface_indices; - ULONG buffer_size = 0; - GetAdaptersAddresses(AF_UNSPEC, 0, NULL, NULL, &buffer_size); - std::vector buffer(buffer_size); - PIP_ADAPTER_ADDRESSES adapters = reinterpret_cast(buffer.data()); - - if (GetAdaptersAddresses(AF_UNSPEC, 0, NULL, adapters, &buffer_size) == NO_ERROR) { - for (PIP_ADAPTER_ADDRESSES adapter = adapters; adapter != NULL; adapter = adapter->Next) { - interface_indices.push_back(adapter->IfIndex); - } - } else { - fprintf(stderr, "Failed to get network adapters"); - } - - return interface_indices; -} - -int main() { +int main(int argc, char* argv[]) { int ret; + + printf ("Starting event writer\n"); ret = pin_maps_load_programs(); if (ret != 0) { return ret; @@ -187,7 +199,7 @@ int main() { } } - printf("All programs attached successfully.\n"); - unload_programs_detach() + std::this_thread::sleep_for(std::chrono::minutes(15)); + unload_programs_detach(); return 0; } \ No newline at end of file diff --git a/test/plugin/eventwriter/event_writer.vcxproj b/test/plugin/eventwriter/event_writer.vcxproj index c8ea950e16..5d9b1bfd3b 100644 --- a/test/plugin/eventwriter/event_writer.vcxproj +++ b/test/plugin/eventwriter/event_writer.vcxproj @@ -9,10 +9,6 @@ 10.0.26100.2454 - - Debug - x64 - Release x64 @@ -28,12 +24,6 @@ $(SolutionDir)packages\XDP-for-Windows.1.1.0\build\native\ - - Application - true - v143 - Unicode - Application false @@ -46,40 +36,13 @@ - - - - - event_writer - event_writer - - - Level3 - true - _DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - $(SolutionDir)packages\eBPF-for-Windows.x64.0.20.0\build\native\include;$(SolutionDir)packages\XDP-for-Windows.1.1.0\build\native\include;%(AdditionalIncludeDirectories) - stdcpp20 - ProgramDatabase - - - Console - true - false - $(SolutionDir)packages\eBPF-for-Windows.x64.0.20.0\build\native\lib;$(SolutionDir)packages\XDP-for-Windows.1.1.0\build\native\lib;%(AdditionalLibraryDirectories) - iphlpapi.lib;ebpfapi.lib;%(AdditionalDependencies) - - - true - - Level3 @@ -88,7 +51,7 @@ true NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true - $(SolutionDir)packages\eBPF-for-Windows.x64.0.20.0\build\native\include;$(SolutionDir)packages\XDP-for-Windows.1.1.0\build\native\include;C:\Users\vpidatala\Code\vinodRetina\retina\test\plugin\eventwriter\packages\Microsoft.Windows.SDK.CPP.10.0.26100.2454\c\Include\10.0.26100.0\um;%(AdditionalIncludeDirectories) + $(SolutionDir)packages\Microsoft.Windows.SDK.CPP.10.0.26100.2454\c\Include\10.0.26100.0\um;$(SolutionDir)packages\eBPF-for-Windows.x64.0.20.0\build\native\include;$(SolutionDir)packages\XDP-for-Windows.1.1.0\build\native\include;%(AdditionalIncludeDirectories) stdcpp20 @@ -97,7 +60,7 @@ true true false - $(SolutionDir)packages\eBPF-for-Windows.x64.0.20.0\build\native\lib;$(SolutionDir)packages\XDP-for-Windows.1.1.0\build\native\lib;%(AdditionalLibraryDirectories) + $(SolutionDir)packages\Microsoft.Windows.SDK.CPP.x64.10.0.26100.2454\c\um\x64;$(SolutionDir)packages\eBPF-for-Windows.x64.0.20.0\build\native\lib;$(SolutionDir)packages\XDP-for-Windows.1.1.0\build\native\lib;%(AdditionalLibraryDirectories) ebpfapi.lib;iphlpapi.lib;%(AdditionalDependencies) @@ -105,13 +68,7 @@ - - - - - - - + diff --git a/test/plugin/eventwriter/event_writer_util.cpp b/test/plugin/eventwriter/event_writer_util.cpp deleted file mode 100644 index 72a656efcb..0000000000 --- a/test/plugin/eventwriter/event_writer_util.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include -#include -#include - -int pin_map(const char* pin_path, bpf_map* map) { - int map_fd = 0; - // Attempt to open the pinned map - map_fd = bpf_obj_get(pin_path); - if (map_fd < 0) { - // Get the file descriptor of the map - map_fd = bpf_map__fd(map); - - if (map_fd < 0) { - fprintf(stderr, "%s - failed to get map file descriptor\n", __FUNCTION__); - return 1; - } - - if (bpf_obj_pin(map_fd, pin_path) < 0) { - fprintf(stderr, "%s - failed to pin map to %s\n", pin_path, __FUNCTION__); - return 1; - } - - printf("%s - map successfully pinned at %s\n", pin_path, __FUNCTION__); - } else { - printf("%s -pinned map found at %s\n", pin_path, __FUNCTION__); - } - return 0; -} \ No newline at end of file diff --git a/test/plugin/eventwriter/event_writer_util.h b/test/plugin/eventwriter/event_writer_util.h deleted file mode 100644 index 973af0c5e3..0000000000 --- a/test/plugin/eventwriter/event_writer_util.h +++ /dev/null @@ -1,6 +0,0 @@ -#include -#include -#include -#include - -int pin_map(const char* pin_path, bpf_map* map); \ No newline at end of file diff --git a/test/plugin/eventwriter/packages.config b/test/plugin/eventwriter/packages.config new file mode 100644 index 0000000000..39a3e211d6 --- /dev/null +++ b/test/plugin/eventwriter/packages.config @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/test/plugin/eventwriter/placeholder.go b/test/plugin/eventwriter/placeholder.go deleted file mode 100644 index fd0225add9..0000000000 --- a/test/plugin/eventwriter/placeholder.go +++ /dev/null @@ -1,3 +0,0 @@ -package cprog //nolint:all - -// This file is a placeholder to make Go include this directory when vendoring. From e1d257a03233bdd57b289d6ede52f00a98a4868a Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Wed, 19 Feb 2025 03:05:25 -0800 Subject: [PATCH 64/82] Event Writer EXE#2 --- .../e2e/yaml/windows/enable-test-signing.yaml | 27 -------------- .../yaml/windows/install-event-writer.yaml | 36 +++++++++++++++++++ test/plugin/eventwriter/event_writer.cpp | 3 +- 3 files changed, 38 insertions(+), 28 deletions(-) delete mode 100644 test/e2e/yaml/windows/enable-test-signing.yaml create mode 100644 test/e2e/yaml/windows/install-event-writer.yaml diff --git a/test/e2e/yaml/windows/enable-test-signing.yaml b/test/e2e/yaml/windows/enable-test-signing.yaml deleted file mode 100644 index 7b3b4f0763..0000000000 --- a/test/e2e/yaml/windows/enable-test-signing.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: enable-test-signing - namespace: default -spec: - template: - spec: - hostNetwork: true # Required for HostProcess - nodeSelector: - kubernetes.io/os: windows - securityContext: - windowsOptions: - hostProcess: true - runAsUserName: "NT AUTHORITY\\SYSTEM" - restartPolicy: Never - containers: - - name: enable-test-signing - image: mcr.microsoft.com/windows/servercore:ltsc2022 - command: - - powershell.exe - - -command - - | - Write-Host 'Enable test signing' - bcdedit /set testsigning on - Start-Sleep -Seconds 5 - Restart-Computer localhost \ No newline at end of file diff --git a/test/e2e/yaml/windows/install-event-writer.yaml b/test/e2e/yaml/windows/install-event-writer.yaml new file mode 100644 index 0000000000..16d0ca1b42 --- /dev/null +++ b/test/e2e/yaml/windows/install-event-writer.yaml @@ -0,0 +1,36 @@ +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: install-event-writer + namespace: install-event-writer # Ensure this namespace exists +spec: + selector: + matchLabels: + name: install-event-writer + template: + metadata: + labels: + name: install-event-writer + spec: + containers: + - name: install-event-writer-container + image: mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0 + command: + - powershell.exe + - -command + - 'echo "Installing event-writer..."; Invoke-WebRequest -Uri "https://raw.githubusercontent.com/vpidatala94/retina/user/vpidatala/POC/8/scripts/install-ebpf-xdp.ps1" -OutFile "C:\\install-ebpf-xdp.ps1"; & C:\\install-ebpf-xdp.ps1; while ($true) { Start-Sleep -Seconds 300; }' + readinessProbe: + exec: + command: + - powershell.exe + - -command + - Test-Path C:\install-event-writer-probe-ready + initialDelaySeconds: 10 + periodSeconds: 5 + hostNetwork: true + nodeSelector: + kubernetes.io/os: windows + securityContext: + windowsOptions: + hostProcess: true + runAsUserName: "NT AUTHORITY\\SYSTEM" \ No newline at end of file diff --git a/test/plugin/eventwriter/event_writer.cpp b/test/plugin/eventwriter/event_writer.cpp index a94d6b3bd2..7234daeb48 100644 --- a/test/plugin/eventwriter/event_writer.cpp +++ b/test/plugin/eventwriter/event_writer.cpp @@ -199,7 +199,8 @@ int main(int argc, char* argv[]) { } } - std::this_thread::sleep_for(std::chrono::minutes(15)); + //Sleep for 10 minutes + Sleep(600000); unload_programs_detach(); return 0; } \ No newline at end of file From d7e33284983d79e3bed1b659492f5709721b7550 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Wed, 19 Feb 2025 03:10:19 -0800 Subject: [PATCH 65/82] Checking-in Event Writer --- .../x64/Release/bpf_event_writer.sys | Bin 0 -> 11632 bytes .../eventwriter/x64/Release/event_writer.exe | Bin 0 -> 19456 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 test/plugin/eventwriter/x64/Release/bpf_event_writer.sys create mode 100644 test/plugin/eventwriter/x64/Release/event_writer.exe diff --git a/test/plugin/eventwriter/x64/Release/bpf_event_writer.sys b/test/plugin/eventwriter/x64/Release/bpf_event_writer.sys new file mode 100644 index 0000000000000000000000000000000000000000..49e06cee5e1256a66a5dfec44c0dc31d1f40d124 GIT binary patch literal 11632 zcmeG?3sh5AwkIKp;b($~;s?EIQ2Z1xporCKqJS3-8UepW`6iHxkS4(*qc#O%&0J%t zzuJ!4psl~Q7Oe_utsqvRqD8HWT1RYWTCII8YODQNGkf2gNaWc!@6Eio=5zoK8Zj0V626=YRcZ26o5Z2Rf2H-Y5H13)Cn3q~z*N zl)+e#W6YROWo6{&7nrF`EoCgsr}X($?383`enGZ2+~40v;ZhycuV?nuamEqu5?c3c zbP}{f>lQ>$=ddX{h2xt>VEf$B;%E(r4IEC=XXRqw_Lgem2+3aRO?n^Po8#uSlD@=O z*l`e%1ErITY5|OGn6dz$SQirF1IS&FOdL?aNvlp0A|UB1cPCe0VDd`b2ne24l4>Dj zG!osQA*2lJ{RuI209;PUB0zK$Au&k*6=;oc8|o6E31NOk7RljeZIKypFfK5fD1m}? z51E9x@47LQaCS0H0V?ypifD6 zC?23Bq(0oh3v#~D02AeUdI&*P3Hn??Whz2eIuw-a1;qoDpl^PL!Gt6V$Hgh390kP# zlpvQdIUxl}l_+O{f^vPKcmPF6X1GzCSCGZ84XzOIj0?&r##+O$XBk7NP!f?s(}P^?2AiXdNk%yg|J`^bI?eX#~kn|yAk-?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OkPy|MoZ0hqz^2OqD}TuOpy#{;xr-C8o&D3d#g*qZIVXpFo7Hpe u$hx;@JGbvzGHds?89CqjOAnd0gbzTVBE#x>$yQ(iv1f%ukWS+ literal 0 HcmV?d00001 diff --git a/test/plugin/eventwriter/x64/Release/event_writer.exe b/test/plugin/eventwriter/x64/Release/event_writer.exe new file mode 100644 index 0000000000000000000000000000000000000000..64d2a4f179bccf4db9159f7a3b6b1570460acc51 GIT binary patch literal 19456 zcmeHv4}4Qqmj6wglt5cj{sdb=36e?`!9Y<91xaWNw@#`R3ZfR%v`uM-G>ORz6h~)@ z0VO^%({&s_j>~ z;QT)O`+a`D&wgf}ym#(B_uO;OJ?Gr>?mc<6>YjF%$r#h)P9_=a0Hn(KGe8 z{lIwk!q``4bm*L~%&2MhhAqKRV13BlVrg*u{Q=2R@3Dj;ev8*{DZgWtr6thlnVXwC z&Z@D#@p<2g4XjH)XbYkVY&UGvh5>r*s?>>8GxG5&gH0cNg> zT{{ynPn7MLzFN*;EK8s+K-LZfDHT^HtHZczrxdujK8z84zFNlEAeDlQ4H2wk>k zzSA%y#ASgrb3=`8 z$<5frtAGMeM)WD8qDYq=|K_S>tZfVs)wpTwWw_HWJ7bBtL6uOG#{RUqTHwW!P_a9TdQdR zFpfQFwFvINB7*3l64wak;BQ|AUZ6S2<%5`81X7spO7Qq944Td3+-RDRku=|DA^u(9 zU>U`L%Xb=~gE&dQ?F2Vf988y<^igXylDrmBT|rdxIUdu=Z}Vs;X8rDT#?E%>q}&7f zG#mLf#bqK`YlY6bX*|~`esRNbnoCSa40y8eC*VMe*Dj1wK%;a!U?8G%ka+KDUF6P@ z+#p}{H0N9ha!b9Yqq!-#f(d_i03|xwt+G5ooA>= z+;9y5I4jFQE(}?mNV6l&Cy#tTpPVAdWy8mdL0^1`W6jhF=Wtp}ir)d54T?5R(D7IS zkKGM-ygRSE+-lQd4rsLVcsU;EWPz_&6eo&L6dy^NUzsNCBTH8MXQuC!TRDxlmTx;N zt>atHQ-B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|E*Y2*{-Ml-vyLET_?x%L|+?~J2wx?uIVo%?m{yoZ`!97EJD5stWJ{>#zcN(85 NdFD@Ar~i#6|DTKg@bmxx literal 0 HcmV?d00001 From 21b2938603a5eeab6f435e1d7779ec1fec3a8409 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Wed, 19 Feb 2025 03:24:01 -0800 Subject: [PATCH 66/82] Checking-in Event Writer#YAML --- test/e2e/yaml/windows/install-event-writer.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/yaml/windows/install-event-writer.yaml b/test/e2e/yaml/windows/install-event-writer.yaml index 16d0ca1b42..b412c77afb 100644 --- a/test/e2e/yaml/windows/install-event-writer.yaml +++ b/test/e2e/yaml/windows/install-event-writer.yaml @@ -18,7 +18,7 @@ spec: command: - powershell.exe - -command - - 'echo "Installing event-writer..."; Invoke-WebRequest -Uri "https://raw.githubusercontent.com/vpidatala94/retina/user/vpidatala/POC/8/scripts/install-ebpf-xdp.ps1" -OutFile "C:\\install-ebpf-xdp.ps1"; & C:\\install-ebpf-xdp.ps1; while ($true) { Start-Sleep -Seconds 300; }' + - 'echo "Installing event-writer..."; Invoke-WebRequest -Uri "https://github.com/vpidatala94/retina/blob/user/vpidatala/POC/8/test/plugin/eventwriter/x64/Release/bpf_event_writer.sys" -OutFile "C:\\bpf_event_writer.sys"; Invoke-WebRequest -Uri "https://github.com/vpidatala94/retina/blob/user/vpidatala/POC/8/test/plugin/eventwriter/x64/Release/event_writer.exe" -OutFile "C:\\event_writer.exe"; & "C:\\event_writer.exe" ; New-Item -Path "C:\install-event-writer-probe-ready" -ItemType File -Force; while ($true) { Start-Sleep -Seconds 300; }' readinessProbe: exec: command: From bb5bce793233346f8b07891aa7cc816f0d8a45ff Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Wed, 19 Feb 2025 03:34:31 -0800 Subject: [PATCH 67/82] Checking-in Event Writer#YAML#2 --- test/plugin/eventwriter/event_writer.cpp | 42 ++++++++++++------ .../x64/Release/bpf_event_writer.sys | Bin 11632 -> 11632 bytes .../eventwriter/x64/Release/event_writer.exe | Bin 19456 -> 18944 bytes 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/test/plugin/eventwriter/event_writer.cpp b/test/plugin/eventwriter/event_writer.cpp index 7234daeb48..3305a04d48 100644 --- a/test/plugin/eventwriter/event_writer.cpp +++ b/test/plugin/eventwriter/event_writer.cpp @@ -53,22 +53,36 @@ int pin_map(const char* pin_path, bpf_map* map) { return 0; } -std::vector get_interface_indices() { - std::vector interface_indices; - ULONG buffer_size = 0; - GetAdaptersAddresses(AF_UNSPEC, 0, NULL, NULL, &buffer_size); - std::vector buffer(buffer_size); - PIP_ADAPTER_ADDRESSES adapters = reinterpret_cast(buffer.data()); - - if (GetAdaptersAddresses(AF_UNSPEC, 0, NULL, adapters, &buffer_size) == NO_ERROR) { - for (PIP_ADAPTER_ADDRESSES adapter = adapters; adapter != NULL; adapter = adapter->Next) { - interface_indices.push_back(adapter->IfIndex); +std::vector get_physical_interface_indices() +{ + std::vector physical_indices; + ULONG flags = GAA_FLAG_INCLUDE_PREFIX; + ULONG family = AF_UNSPEC; + ULONG outBufLen = 0; + PIP_ADAPTER_ADDRESSES pAddresses = NULL; + PIP_ADAPTER_ADDRESSES pCurrAddresses = NULL; + + // Get the size needed for the buffer + if (GetAdaptersAddresses(family, flags, NULL, pAddresses, &outBufLen) == ERROR_BUFFER_OVERFLOW) { + pAddresses = (IP_ADAPTER_ADDRESSES*)malloc(outBufLen); + } + + // Get the actual data + if (GetAdaptersAddresses(family, flags, NULL, pAddresses, &outBufLen) == NO_ERROR) { + pCurrAddresses = pAddresses; + while (pCurrAddresses) { + if (pCurrAddresses->IfType == IF_TYPE_ETHERNET_CSMACD && pCurrAddresses->OperStatus == IfOperStatusUp) { + physical_indices.push_back(pCurrAddresses->IfIndex); + } + pCurrAddresses = pCurrAddresses->Next; } - } else { - fprintf(stderr, "Failed to get network adapters"); } - return interface_indices; + if (pAddresses) { + free(pAddresses); + } + + return physical_indices; } int @@ -191,7 +205,7 @@ int main(int argc, char* argv[]) { if (ret != 0) { return ret; } - std::vector interface_indices = get_interface_indices(); + std::vector interface_indices = get_physical_interface_indices(); for (int ifindx : interface_indices) { ret = attach_program_to_interface(ifindx); if (ret != 0) { diff --git a/test/plugin/eventwriter/x64/Release/bpf_event_writer.sys b/test/plugin/eventwriter/x64/Release/bpf_event_writer.sys index 49e06cee5e1256a66a5dfec44c0dc31d1f40d124..6428d6d2e10aaa6229838d979af5c1e46851cc03 100644 GIT binary patch delta 505 zcmVXAQq^7en0Rj{rn8CGY000000ssI2d;kCdfHMF9fE54$ z00000n8A}$6*3SS?$B6ro{B-Y!|=o~F(!wzlobpSAjg%1fg6DG!akc>CaE!A$H+O6 zR4?5gQ=*r5_ZBQ)Jd?mCOduh?#F#IpO7pw@yF9OjDFl01v^-$bO7{z=UTWCa`}?yj zCl3K2WRm%S56&Dcir^kiRgG@3d3YwXjqqO1XW*{0`n2FVvs)DDf~21_>&LNQUo0HNItYWrgKDq^g= zRNxPa?(QX*eTcOsHmVtZwu5qZ#GuS+0wH4Y5WDQCbmYo#8PY6*b>WZc1k#jK;w7%= zt2lnP+*>5BT1{~DvwvoFTsIeBM=AEHap$BmHh2Yqktk@GlNC8fY@|a08#@fC@@#fk z&94ue@}h4fTqLumJSTn-(9(D=P^1bIk&;_nz#6iex?CqP9gujYfq=xao4@up+?`+R zEmp!6S002H3Q91AktJ2YK^QNP@4lfTYJuqyr9{_=COkxrGp=mAwujkKOq v-(Hrg&^@_5inY^~87XueBF&{J(rvC*J<%-2ys)DruLZC|CFb=200000a&6)J delta 505 zcmVXAQlg+a-0Rj{rAG@_@000000ssI2d;kCdfHMF9fE54$ z00000AG?!M6*3S|e^}7nUzkFiHIfKlCXi0ElobpSAXZ3Pgp$Z;{Gi&!GDi6CY3n{d z^_PNfKq1rjgeZ6$29v-hOdzYm1hXhhD5f5jjZ^=I2{oX76?)R$vM4C-nwnx+1aGq} zCl3K23%Flm7!Bx9*IQ{~AU7}Fh#Y9WeVncHjg;>E*El}Evs)&LNQUo0B}zLMdEI!=Ze20 z)lpd2@k(%J6XH>-oJAhfyMTQ`2u&@vacZod^B?CBb8M17!j1ApZnG_-H*s-4$;=n5Wsj+@pvZz;Q?+pmObEqiVGUI-+rf=@=c0$>D=x7xH00000dq&$X diff --git a/test/plugin/eventwriter/x64/Release/event_writer.exe b/test/plugin/eventwriter/x64/Release/event_writer.exe index 64d2a4f179bccf4db9159f7a3b6b1570460acc51..d849be6878cd6671a8d675bb328e75f173fb27df 100644 GIT binary patch delta 6682 zcmeHLeNqZtUO*{R%<1-YMMF?2$&FqeO(c&?bG*c-WZI}MC(WVxbL^`Jt(^R z*ZaG();_;|_TFdj^Re$f2by1(ns-Y3Vx_d*zx&m5!flfx!MkY@_((|Ccj zZtB&!j9n&4BV#uR>lh2m#E4%rV@tuFErv;Z>Lh6oKPMH>NQNjDL=G*W5kDt<f$YxqfE)4iFc!*dG_8%ebx@MWx%{7Hw=|#k$ZmdAj_cHAMT&sC z3mx{((UvDAc|#0;T6rn@3f!x~YL_$or-aTgl+}{IR@IcxXG2=pt+rLVR8_mFwpF`| z3$L|#UHSGWL-w(f+BRKn`>quf+gs_%mkkW4Q#5Hd~WWs zru(-kuOX3-LW;A(@u0_P z_dVK5X^I(o@SqdC`5n8B}&FgGhG%)d`WHvEB+ z!GB=w{bUe%N7q|J_SW|ev26f`@Nxnw-SHmmDMUO%VEww|BODU6-Ovv0Hl2jYN!M+1 z;(HMb+F?5Q(r~azIG7;jsF~x>LwRATPBR<8Jd{+pXf|Dxz(tMe!aSN{;lf`ge5mBZ zSm62;V>TzT@bFhR@0|%Y=-$B$MZm;77>d+FrW4FaCy>`$k+=4-m98x4>Y?iaYtbFS zMB@O5XZTVy zRqUWNFQzp2sHK1QzOc@o(!%Jcl_KarQEbf?E~k_GI)O1i&eGnp9v-!mMxq{o(2z}o ztZg$E1poP}<~WK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qm=h0{_b(Ob$k{-Pp5!y0iHn$mBCXg%|TXbMPEv9dkuahQ$dF^ToSU;UhstJpx40@ zIzhc|=GB-yqhWOFq6GIY?wUb#AiMxFm+5!~yc0a(r-pn8DB?2fghLMCgP>yQ&;_?0 zM2-?31(D8i;PrH`Ub%^icf78&6PWB^Y$iHu2%b961lAe+I^fR?{^!8AKxDKRc-xQ< z1AmpF_dN^@fJle%qQQUU1+yH9w6;vge*#ZR8-NEvG%(>dCu2W>jtBTB(9gk}v#kX4?G9*o`cdbnD~5M$pzd1A|=9BgQxdF zGl&ee00%&W=u6k_dfcry!Q+9&_JjJtP>vXz-0EsAZVj|vXzgzewhpxpx6PAJ2>%a*H?hnB From 2d8bda60004c2aed4d621579c8f1344a878e3cad Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Wed, 19 Feb 2025 03:37:56 -0800 Subject: [PATCH 68/82] Checking-in Event Writer#YAML#3 --- scripts/install-ebpf-xdp.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/install-ebpf-xdp.ps1 b/scripts/install-ebpf-xdp.ps1 index 109546ef05..2ff5c9bd9f 100644 --- a/scripts/install-ebpf-xdp.ps1 +++ b/scripts/install-ebpf-xdp.ps1 @@ -519,7 +519,7 @@ Function Install-WindowsCilium { If(Assert-WindowsCiliumIsReady) { Write-Host 'Windows Cilium Installed already' - return + return } Write-Host 'Installing Windows Cilium' @@ -540,8 +540,11 @@ Function Install-WindowsCilium Start-Sleep -Seconds:5 - #Restart-Computer + If(Assert-WindowsCiliumIsReady) { + Throw "Cilium for Windows is not ready" + } + Restart-Computer } Catch { From 90361c575b3c186d21c9039fd3dbd81b4bcdc0aa Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Wed, 19 Feb 2025 03:46:53 -0800 Subject: [PATCH 69/82] Checking-in Event Writer#YAML#4 --- test/e2e/jobs/jobs.go | 13 +++++++++++++ test/e2e/retina_e2e_test.go | 18 ++++++++++++++---- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/test/e2e/jobs/jobs.go b/test/e2e/jobs/jobs.go index a6408b1d6e..89c393fa30 100644 --- a/test/e2e/jobs/jobs.go +++ b/test/e2e/jobs/jobs.go @@ -119,6 +119,19 @@ func InstallEbpfXdp(kubeConfigFilePath string) *types.Job { return job } +func InstallEventWriter(kubeConfigFilePath string) *types.Job { + job := types.NewJob("Install event writer") + job.AddStep(&kubernetes.CreateNamespace{ + KubeConfigFilePath: kubeConfigFilePath, + Namespace: "install-event-writer"}, nil) + + job.AddStep(&kubernetes.ApplyYamlConfig{ + YamlFilePath: "yaml/windows/install-event-writer.yaml", + }, nil) + + return job +} + func InstallAndTestRetinaBasicMetrics(kubeConfigFilePath, chartPath string, testPodNamespace string) *types.Job { job := types.NewJob("Install and test Retina with basic metrics") diff --git a/test/e2e/retina_e2e_test.go b/test/e2e/retina_e2e_test.go index 01f076e26d..4409cba8e4 100644 --- a/test/e2e/retina_e2e_test.go +++ b/test/e2e/retina_e2e_test.go @@ -69,15 +69,25 @@ func TestE2ERetina(t *testing.T) { }) time.Sleep(10 * time.Minute) + + // Install Ebpf and XDP + installEventWriter := types.NewRunner(t, jobs.installEventWriter(kubeConfigFilePath)) + installEventWriter.Run(ctx) + + time.Sleep(10 * time.Minute) + // Install and test Retina basic metrics basicMetricsE2E := types.NewRunner(t, jobs.InstallAndTestRetinaBasicMetrics(kubeConfigFilePath, chartPath, common.TestPodNamespace)) basicMetricsE2E.Run(ctx) + time.Sleep(10 * time.Minute) // Upgrade and test Retina with advanced metrics - advanceMetricsE2E := types.NewRunner(t, jobs.UpgradeAndTestRetinaAdvancedMetrics(kubeConfigFilePath, chartPath, profilePath, common.TestPodNamespace)) - advanceMetricsE2E.Run(ctx) + //advanceMetricsE2E := types.NewRunner(t, jobs.UpgradeAndTestRetinaAdvancedMetrics(kubeConfigFilePath, chartPath, profilePath, common.TestPodNamespace)) + //advanceMetricsE2E.Run(ctx) // Install and test Hubble basic metrics - validatehubble := types.NewRunner(t, jobs.ValidateHubble(kubeConfigFilePath, hubblechartPath, common.TestPodNamespace)) - validatehubble.Run(ctx) + //validatehubble := types.NewRunner(t, jobs.ValidateHubble(kubeConfigFilePath, hubblechartPath, common.TestPodNamespace)) + //validatehubble.Run(ctx) + + // Install and test Cilium Windows basics and advanced metrics } From c9b42c8425837fbf26a68d1f9be1b8213f89ff41 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Wed, 19 Feb 2025 09:49:16 -0800 Subject: [PATCH 70/82] Checking-in Event Writer#YAML#5 --- test/plugin/eventwriter/event_writer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/test/plugin/eventwriter/event_writer.cpp b/test/plugin/eventwriter/event_writer.cpp index 3305a04d48..42be7622f7 100644 --- a/test/plugin/eventwriter/event_writer.cpp +++ b/test/plugin/eventwriter/event_writer.cpp @@ -87,6 +87,7 @@ std::vector get_physical_interface_indices() int attach_program_to_interface(int ifindx) { + printf("%s - Attaching program to interface with ifindex %d\n", ifindx, __FUNCTION__); struct bpf_program* prg = bpf_object__find_program_by_name(obj, "event_writer"); bpf_link* link = NULL; if (prg == NULL) { From 728e752e4d6e7853d447824fda3a6b5c445588e8 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Wed, 19 Feb 2025 09:52:22 -0800 Subject: [PATCH 71/82] Checking-in Event Writer#YAML#6 --- .../eventwriter/x64/Release/event_writer.exe | Bin 18944 -> 18944 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/test/plugin/eventwriter/x64/Release/event_writer.exe b/test/plugin/eventwriter/x64/Release/event_writer.exe index d849be6878cd6671a8d675bb328e75f173fb27df..cd0798080feafd5b16795cf44eead5e22143378a 100644 GIT binary patch delta 6214 zcmeHKeN>d!nZNJLyf7#*!^cEE2AP2w7#JXcnjmPLiAY{88lu#)Mk9Vj(-=c=FeEV@ zHiNA=OILD9*P8UyoaW?Uk2$5%W;Ls)vtR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Zw1{Mo6EF4WD9=6Zj5^oXl^#WH3Tr5x# z=oVNmFdwLo|Cp%IECPMP-XriOfzJqBC~%sSTc!QHbQvE{eK;_zFYx~13_(OJ!y zzq%tkZA-B^E(jz14OR1L#rdYrYW`U9_?#ZR4>7R+`Wn$EKVl1NIx2f&+HJ&pJe0nQN8)3|@4In{y6ZvAKi+n@skqchl)`NEF;p)8oO_sR3v3Djeu+I@@3v-H1CXE#P&37=UPhk z@@GqvQ)#JRz|x7x`t|FVf9nxM*YGz>6C0YRGG?Kw*Lojv&U)Yh%JYx*&G&f7x9KLI z!E1-F853I4Z1lmx`Ao1k!QXXD3>$?lh0loLhscK}nt7;lgU@{nlh!Z%`R{^;_uvBB-s0N@-x~N< zj`Hn;&kx_ZQNF*!XDP$4WkxuYu{UriuY`}?@I8)yGuT9MDl=~oFJg}@#THw7gUFI_ z`8I>sIm%ZFUl6_*M)~fCuM56SqkQY&+gXMK>y-2^daDwcx-X#cpI>%AYJ4Ko`d`bI^o0w!2v!Y^fkcRM1$`J&cRtZ z2>$3Zlg`fB<8X$$b@Z_hVYpxn11oVLPKHjW<#q^lV)Q{s2WA0|vrXU-mOwh86IMb7 zpcB>z|LCKSj>}WH14H2G2;J=Q!2#uShy%9~;YB^b7{eW#0O>;~N`Z4ArQp!ryBR{A zBRm8l&H&Javy^l*@Hq%^+JUYtbPTzK^$_wCHu;3n4BRdBUjpBSP(^sYu}FuJfCnD? ztRKxhvU_6VI`E<1|YLpo_E zjH{5-NTv()ySR_fLdQdxy#hH79gksl7%~i Date: Wed, 19 Feb 2025 11:09:06 -0800 Subject: [PATCH 72/82] Checking-in Event Writer#YAML#7 --- test/e2e/yaml/windows/install-event-writer.yaml | 2 +- test/plugin/eventwriter/event_writer.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/yaml/windows/install-event-writer.yaml b/test/e2e/yaml/windows/install-event-writer.yaml index b412c77afb..541400023e 100644 --- a/test/e2e/yaml/windows/install-event-writer.yaml +++ b/test/e2e/yaml/windows/install-event-writer.yaml @@ -18,7 +18,7 @@ spec: command: - powershell.exe - -command - - 'echo "Installing event-writer..."; Invoke-WebRequest -Uri "https://github.com/vpidatala94/retina/blob/user/vpidatala/POC/8/test/plugin/eventwriter/x64/Release/bpf_event_writer.sys" -OutFile "C:\\bpf_event_writer.sys"; Invoke-WebRequest -Uri "https://github.com/vpidatala94/retina/blob/user/vpidatala/POC/8/test/plugin/eventwriter/x64/Release/event_writer.exe" -OutFile "C:\\event_writer.exe"; & "C:\\event_writer.exe" ; New-Item -Path "C:\install-event-writer-probe-ready" -ItemType File -Force; while ($true) { Start-Sleep -Seconds 300; }' + - 'echo "Installing event-writer..."; Invoke-WebRequest -Uri "https://github.com/vpidatala94/retina/raw/user/vpidatala/POC/8/test/plugin/eventwriter/x64/Release/bpf_event_writer.sys" -OutFile "C:\\bpf_event_writer.sys"; Invoke-WebRequest -Uri "https://github.com/vpidatala94/retina/raw/user/vpidatala/POC/8/test/plugin/eventwriter/x64/Release/event_writer.exe" -OutFile "C:\\event_writer.exe"; & "C:\\event_writer.exe"; New-Item -Path "C:\\install-event-writer-probe-ready" -ItemType File -Force; while ($true) { Start-Sleep -Seconds 300; }' readinessProbe: exec: command: diff --git a/test/plugin/eventwriter/event_writer.cpp b/test/plugin/eventwriter/event_writer.cpp index 42be7622f7..b55f3c7506 100644 --- a/test/plugin/eventwriter/event_writer.cpp +++ b/test/plugin/eventwriter/event_writer.cpp @@ -87,7 +87,7 @@ std::vector get_physical_interface_indices() int attach_program_to_interface(int ifindx) { - printf("%s - Attaching program to interface with ifindex %d\n", ifindx, __FUNCTION__); + printf("%s - Attaching program to interface with ifindex %d\n", __FUNCTION__, ifindx); struct bpf_program* prg = bpf_object__find_program_by_name(obj, "event_writer"); bpf_link* link = NULL; if (prg == NULL) { From 432543d94364337d235b7099a9e4fbcc52823ac1 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Wed, 19 Feb 2025 11:27:15 -0800 Subject: [PATCH 73/82] Checking-in Event Writer#YAML#8 --- test/plugin/eventwriter/event_writer.vcxproj | 2 +- .../x64/Release/bpf_event_writer.sys | Bin 11632 -> 11632 bytes .../eventwriter/x64/Release/event_writer.exe | Bin 18944 -> 18944 bytes 3 files changed, 1 insertion(+), 1 deletion(-) diff --git a/test/plugin/eventwriter/event_writer.vcxproj b/test/plugin/eventwriter/event_writer.vcxproj index 5d9b1bfd3b..2197cf7402 100644 --- a/test/plugin/eventwriter/event_writer.vcxproj +++ b/test/plugin/eventwriter/event_writer.vcxproj @@ -49,7 +49,7 @@ true true true - NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + NDEBUG;_WINDOWS;%(PreprocessorDefinitions) true $(SolutionDir)packages\Microsoft.Windows.SDK.CPP.10.0.26100.2454\c\Include\10.0.26100.0\um;$(SolutionDir)packages\eBPF-for-Windows.x64.0.20.0\build\native\include;$(SolutionDir)packages\XDP-for-Windows.1.1.0\build\native\include;%(AdditionalIncludeDirectories) stdcpp20 diff --git a/test/plugin/eventwriter/x64/Release/bpf_event_writer.sys b/test/plugin/eventwriter/x64/Release/bpf_event_writer.sys index 6428d6d2e10aaa6229838d979af5c1e46851cc03..08a74e210265f80bdae241a61c7f427aabdc8c43 100644 GIT binary patch delta 507 zcmVS$P@+Zhz>vNOj$h0 zqI)SB5IMT;jW8hz7Xm+%z$Q!}>HmLwaFG2XG6isdv{b-y%@+oz90V;>piJ#K5Cwzm zvn(eM0U*zMnX0!)z&wq&7kh{8DL`UAVTk>;)HV+raZ4S;%c-+lDBS~pLDng_qlOUw(ICD1&;`?`?Q}>>b{Oeyn%2V6zCtfn(>5%%mHlf zqzMRt*{eUT&oNwt+{-wB0%8=ymV+gJWkbzf7>quS6TOftD;+xm$|eKRDZv@w)TqGL z=!59sl$^X8nu)~VL0c@R+)f%bfSZ4SfOAExM|Dh^EQTNFeeK&7)Md*V>msg-Put+^ zzV}XcS9z2mhJ^_je0$x1lykU^y?YDKR8FKW`~WZ@*pZ!IqV%FVdSW(`O3kf61cs3U x88{NIFT~Csi#F#N-nUFrpFx#o#_r39jF?ZLI3~&002Qx+=~DJ delta 507 zcmVNXU0Rk!cjDnKi-{FP9j%}<1i)ASBFbxI?Duzgg_YDC70R;dAf&l=b-3@B{V)ZIw zth-d;4~p*YC6|4OwIw#H8Gg2da(2X^%xMB4V(}2W?5K3)%5WLdEP{36kLd)`lvCm* zuIQ^cezx3OB(7RbaP+f(W_4UQ7hp#z_Nj5_q%t;m1%Qz#Xqb}~IY(@yLjfB*45{*L zc391?51aC$ZzNnKv!*;Jeh|>ocrH++3KNl%TU@{zvYNVFComn5c&34X#Il>e_BPy| zU+XPa!WCB@gck}*FolsNRlq?QFOcuPp(1L5=@F$w*NEi_Plp0Jh*ObHmA&WzRZfkx xo>Sjmma5P_xjl-t)0G)1bQ~hhr6|&Eu2wzKEXKUBqa?2dutFu~^#A|>001n&<7WT> diff --git a/test/plugin/eventwriter/x64/Release/event_writer.exe b/test/plugin/eventwriter/x64/Release/event_writer.exe index cd0798080feafd5b16795cf44eead5e22143378a..1565c885d5099a9f54976460e6927e10466949fc 100644 GIT binary patch delta 111 zcmZpe!q_l{af1LOlfS`cAx0rBD}RG+=?p-?1jH3U9AN{*dLR)72ACWVkSzkl7l3jX p;Bu4Ww534CRB1nA5=;mQY54VRoA0b|Gn_r<9;sp6oU1ok8UW5Q8!7+* delta 111 zcmZpe!q_l{af1LOld05ZAx0rBD^sa$=?p-?1jH3U9AN{*dLR)72ACWVkSzkl7l3jX p;Bu4Ww534CRB1nA66|O{|M1BvJ*OF;HP3uFcW4&V=3KqW(g3B+8>avO From eba1932d725342f42633faca87b96d1c5fac8e77 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Wed, 19 Feb 2025 11:34:45 -0800 Subject: [PATCH 74/82] Changing install-event-writer WIN Server 22 --- test/e2e/yaml/windows/install-event-writer.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/yaml/windows/install-event-writer.yaml b/test/e2e/yaml/windows/install-event-writer.yaml index 541400023e..de2f8ad87d 100644 --- a/test/e2e/yaml/windows/install-event-writer.yaml +++ b/test/e2e/yaml/windows/install-event-writer.yaml @@ -14,7 +14,7 @@ spec: spec: containers: - name: install-event-writer-container - image: mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0 + image: mcr.microsoft.com/windows/servercore:ltsc2022 command: - powershell.exe - -command From dca3c71bc4b5a2795311f34a698f5b087f2d6d88 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Wed, 19 Feb 2025 12:39:33 -0800 Subject: [PATCH 75/82] Changing install-event-writer WIN Server 23 --- test/e2e/yaml/windows/install-event-writer.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/yaml/windows/install-event-writer.yaml b/test/e2e/yaml/windows/install-event-writer.yaml index de2f8ad87d..42b11c45bd 100644 --- a/test/e2e/yaml/windows/install-event-writer.yaml +++ b/test/e2e/yaml/windows/install-event-writer.yaml @@ -18,7 +18,7 @@ spec: command: - powershell.exe - -command - - 'echo "Installing event-writer..."; Invoke-WebRequest -Uri "https://github.com/vpidatala94/retina/raw/user/vpidatala/POC/8/test/plugin/eventwriter/x64/Release/bpf_event_writer.sys" -OutFile "C:\\bpf_event_writer.sys"; Invoke-WebRequest -Uri "https://github.com/vpidatala94/retina/raw/user/vpidatala/POC/8/test/plugin/eventwriter/x64/Release/event_writer.exe" -OutFile "C:\\event_writer.exe"; & "C:\\event_writer.exe"; New-Item -Path "C:\\install-event-writer-probe-ready" -ItemType File -Force; while ($true) { Start-Sleep -Seconds 300; }' + - 'echo "Installing event-writer..."; Invoke-WebRequest -Uri "https://github.com/vpidatala94/retina/raw/user/vpidatala/POC/8/test/plugin/eventwriter/x64/Release/bpf_event_writer.sys" -OutFile "C:\\bpf_event_writer.sys"; Invoke-WebRequest -Uri "https://github.com/vpidatala94/retina/raw/user/vpidatala/POC/8/test/plugin/eventwriter/x64/Release/event_writer.exe" -OutFile "C:\\event_writer.exe"; .\event_writer.exe; New-Item -Path "C:\\install-event-writer-probe-ready" -ItemType File -Force; while ($true) { Start-Sleep -Seconds 300; }' readinessProbe: exec: command: From 28eb5272b3af7bfa5653363b3184e4dfbfcfb219 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Wed, 19 Feb 2025 12:56:14 -0800 Subject: [PATCH 76/82] Changing install-event-writer WIN Server 24 --- test/e2e/retina_e2e_test.go | 6 +++--- test/e2e/yaml/windows/install-event-writer.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/e2e/retina_e2e_test.go b/test/e2e/retina_e2e_test.go index 4409cba8e4..23a1f08b16 100644 --- a/test/e2e/retina_e2e_test.go +++ b/test/e2e/retina_e2e_test.go @@ -50,8 +50,8 @@ func TestE2ERetina(t *testing.T) { rootDir := filepath.Dir(filepath.Dir(cwd)) chartPath := filepath.Join(rootDir, "deploy", "legacy", "manifests", "controller", "helm", "retina") - hubblechartPath := filepath.Join(rootDir, "deploy", "hubble", "manifests", "controller", "helm", "retina") - profilePath := filepath.Join(rootDir, "test", "profiles", "advanced", "values.yaml") + //hubblechartPath := filepath.Join(rootDir, "deploy", "hubble", "manifests", "controller", "helm", "retina") + //profilePath := filepath.Join(rootDir, "test", "profiles", "advanced", "values.yaml") kubeConfigFilePath := filepath.Join(rootDir, "test", "e2e", "test.pem") // CreateTestInfra @@ -71,7 +71,7 @@ func TestE2ERetina(t *testing.T) { time.Sleep(10 * time.Minute) // Install Ebpf and XDP - installEventWriter := types.NewRunner(t, jobs.installEventWriter(kubeConfigFilePath)) + installEventWriter := types.NewRunner(t, jobs.InstallEventWriter(kubeConfigFilePath)) installEventWriter.Run(ctx) time.Sleep(10 * time.Minute) diff --git a/test/e2e/yaml/windows/install-event-writer.yaml b/test/e2e/yaml/windows/install-event-writer.yaml index 42b11c45bd..15ef4f074b 100644 --- a/test/e2e/yaml/windows/install-event-writer.yaml +++ b/test/e2e/yaml/windows/install-event-writer.yaml @@ -18,7 +18,7 @@ spec: command: - powershell.exe - -command - - 'echo "Installing event-writer..."; Invoke-WebRequest -Uri "https://github.com/vpidatala94/retina/raw/user/vpidatala/POC/8/test/plugin/eventwriter/x64/Release/bpf_event_writer.sys" -OutFile "C:\\bpf_event_writer.sys"; Invoke-WebRequest -Uri "https://github.com/vpidatala94/retina/raw/user/vpidatala/POC/8/test/plugin/eventwriter/x64/Release/event_writer.exe" -OutFile "C:\\event_writer.exe"; .\event_writer.exe; New-Item -Path "C:\\install-event-writer-probe-ready" -ItemType File -Force; while ($true) { Start-Sleep -Seconds 300; }' + - 'echo "Installing event-writer..."; Invoke-WebRequest -Uri "https://github.com/vpidatala94/retina/raw/user/vpidatala/POC/8/test/plugin/eventwriter/x64/Release/bpf_event_writer.sys" -OutFile "C:\\bpf_event_writer.sys"; Invoke-WebRequest -Uri "https://github.com/vpidatala94/retina/raw/user/vpidatala/POC/8/test/plugin/eventwriter/x64/Release/event_writer.exe" -OutFile "C:\\event_writer.exe"; cd C:\\ ; .\event_writer.exe; New-Item -Path "C:\\install-event-writer-probe-ready" -ItemType File -Force; while ($true) { Start-Sleep -Seconds 300; }' readinessProbe: exec: command: From c5c065ddf4025ce050d9e93d42a0cf9503a37939 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Wed, 19 Feb 2025 14:36:43 -0800 Subject: [PATCH 77/82] Changing install-event-writer WIN Server 25 --- scripts/install-ebpf-xdp.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install-ebpf-xdp.ps1 b/scripts/install-ebpf-xdp.ps1 index 2ff5c9bd9f..d5a68d5a6d 100644 --- a/scripts/install-ebpf-xdp.ps1 +++ b/scripts/install-ebpf-xdp.ps1 @@ -406,7 +406,7 @@ Function Install-eBPF # Download eBPF-for-Windows. $packageEbpfUrl = "https://github.com/microsoft/ebpf-for-windows/releases/download/Release-v0.20.0/Build-x64-native-only.NativeOnlyRelease.zip" Invoke-WebRequest -Uri $packageEbpfUrl -OutFile "$LocalPath\\Build-x64-native-only-NativeOnlyRelease.zip" - Expand-Archive -Path "$LocalPath\\Build-x64-native-only-NativeOnlyRelease.zip" -DestinationPath "$LocalPath\\Build-x64-native-only-NativeOnlyRelease\\msi" + Expand-Archive -Path "$LocalPath\\Build-x64-native-only-NativeOnlyRelease.zip" -DestinationPath "$LocalPath\\Build-x64-native-only-NativeOnlyRelease\\msi" -Force Start-Process -FilePath:"$($env:WinDir)\System32\MSIExec.exe" -ArgumentList @("/i $($LocalPath)\ebpf-for-windows.msi", '/qn', "INSTALLFOLDER=`"$($env:ProgramFiles)\ebpf-for-windows`"", 'ADDLOCAL=eBPF_Runtime_Components') -PassThru | Wait-Process If(-Not (Assert-SoftwareInstalled -ServiceName:'eBPFCore' -Silent) -Or From bc89ea495b1a7e187cf0d5ee1ba933825cb1b67c Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Wed, 19 Feb 2025 21:48:03 -0800 Subject: [PATCH 78/82] changed package name --- .../manifests/controller/helm/retina/values.yaml | 2 +- pkg/plugin/ebpfwindows/ebpf_windows.go | 2 +- test/e2e/retina_e2e_test.go | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/deploy/legacy/manifests/controller/helm/retina/values.yaml b/deploy/legacy/manifests/controller/helm/retina/values.yaml index ffd2162dfe..2d34a6615f 100644 --- a/deploy/legacy/manifests/controller/helm/retina/values.yaml +++ b/deploy/legacy/manifests/controller/helm/retina/values.yaml @@ -64,7 +64,7 @@ apiServer: logLevel: debug enabledPlugin_linux: '["dropreason","packetforward","linuxutil","dns"]' -enabledPlugin_win: '["hnsstats", "ebpfwindows", "enabledPlugin_win"]' +enabledPlugin_win: '["hnsstats", "ebpfwindows"]' enableTelemetry: false diff --git a/pkg/plugin/ebpfwindows/ebpf_windows.go b/pkg/plugin/ebpfwindows/ebpf_windows.go index b3798e7ddb..a989c36139 100644 --- a/pkg/plugin/ebpfwindows/ebpf_windows.go +++ b/pkg/plugin/ebpfwindows/ebpf_windows.go @@ -26,7 +26,7 @@ import ( const ( // name of the ebpfwindows plugin - name string = "windowseBPF" + name string = "ebpfwindows" // name of the metrics packetsReceived string = "win_packets_recv_count" packetsSent string = "win_packets_sent_count" diff --git a/test/e2e/retina_e2e_test.go b/test/e2e/retina_e2e_test.go index 23a1f08b16..f4fad84864 100644 --- a/test/e2e/retina_e2e_test.go +++ b/test/e2e/retina_e2e_test.go @@ -50,8 +50,8 @@ func TestE2ERetina(t *testing.T) { rootDir := filepath.Dir(filepath.Dir(cwd)) chartPath := filepath.Join(rootDir, "deploy", "legacy", "manifests", "controller", "helm", "retina") - //hubblechartPath := filepath.Join(rootDir, "deploy", "hubble", "manifests", "controller", "helm", "retina") - //profilePath := filepath.Join(rootDir, "test", "profiles", "advanced", "values.yaml") + hubblechartPath := filepath.Join(rootDir, "deploy", "hubble", "manifests", "controller", "helm", "retina") + profilePath := filepath.Join(rootDir, "test", "profiles", "advanced", "values.yaml") kubeConfigFilePath := filepath.Join(rootDir, "test", "e2e", "test.pem") // CreateTestInfra @@ -81,9 +81,9 @@ func TestE2ERetina(t *testing.T) { basicMetricsE2E.Run(ctx) time.Sleep(10 * time.Minute) - // Upgrade and test Retina with advanced metrics - //advanceMetricsE2E := types.NewRunner(t, jobs.UpgradeAndTestRetinaAdvancedMetrics(kubeConfigFilePath, chartPath, profilePath, common.TestPodNamespace)) - //advanceMetricsE2E.Run(ctx) + Upgrade and test Retina with advanced metrics + advanceMetricsE2E := types.NewRunner(t, jobs.UpgradeAndTestRetinaAdvancedMetrics(kubeConfigFilePath, chartPath, profilePath, common.TestPodNamespace)) + advanceMetricsE2E.Run(ctx) // Install and test Hubble basic metrics //validatehubble := types.NewRunner(t, jobs.ValidateHubble(kubeConfigFilePath, hubblechartPath, common.TestPodNamespace)) From 68e28791cccb0e29663f9586a18bbc6d855d9517 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Wed, 19 Feb 2025 22:16:23 -0800 Subject: [PATCH 79/82] changed package name#2 --- test/e2e/retina_e2e_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/retina_e2e_test.go b/test/e2e/retina_e2e_test.go index f4fad84864..4f1e81b654 100644 --- a/test/e2e/retina_e2e_test.go +++ b/test/e2e/retina_e2e_test.go @@ -81,7 +81,7 @@ func TestE2ERetina(t *testing.T) { basicMetricsE2E.Run(ctx) time.Sleep(10 * time.Minute) - Upgrade and test Retina with advanced metrics + //Upgrade and test Retina with advanced metrics advanceMetricsE2E := types.NewRunner(t, jobs.UpgradeAndTestRetinaAdvancedMetrics(kubeConfigFilePath, chartPath, profilePath, common.TestPodNamespace)) advanceMetricsE2E.Run(ctx) From a6d7eb396b08bbf91762b9f13074758983078ee3 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Wed, 19 Feb 2025 22:43:40 -0800 Subject: [PATCH 80/82] changed package name#3 --- test/e2e/retina_e2e_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/e2e/retina_e2e_test.go b/test/e2e/retina_e2e_test.go index 4f1e81b654..00eef7cef2 100644 --- a/test/e2e/retina_e2e_test.go +++ b/test/e2e/retina_e2e_test.go @@ -86,8 +86,9 @@ func TestE2ERetina(t *testing.T) { advanceMetricsE2E.Run(ctx) // Install and test Hubble basic metrics - //validatehubble := types.NewRunner(t, jobs.ValidateHubble(kubeConfigFilePath, hubblechartPath, common.TestPodNamespace)) - //validatehubble.Run(ctx) + validatehubble := types.NewRunner(t, jobs.ValidateHubble(kubeConfigFilePath, hubblechartPath, common.TestPodNamespace)) + validatehubble.Run(ctx) // Install and test Cilium Windows basics and advanced metrics + time.Sleep(10 * time.Minute) } From 865a332e8128b21b3040ea3862bf80a0898ad455 Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Thu, 20 Feb 2025 09:49:29 -0800 Subject: [PATCH 81/82] go mod changes --- ebpfwindows --- .../manifests/controller/helm/retina/values.yaml | 10 +++++----- go.mod | 2 +- pkg/plugin/include_windows.go | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/deploy/legacy/manifests/controller/helm/retina/values.yaml b/deploy/legacy/manifests/controller/helm/retina/values.yaml index 2d34a6615f..7a0e6e87ba 100644 --- a/deploy/legacy/manifests/controller/helm/retina/values.yaml +++ b/deploy/legacy/manifests/controller/helm/retina/values.yaml @@ -10,8 +10,8 @@ os: operator: name: retina-operator enabled: false - repository: ghcr.io/microsoft/retina/retina-operator - tag: "v0.0.2" + repository: demoebpfregistry.azurecr.io/vpidatala94/retina/retina-operator + tag: "a6d7eb3" installCRDs: true enableRetinaEndpoint: false resources: @@ -29,11 +29,11 @@ operator: - "/retina/operator-config.yaml" image: - repository: ghcr.io/microsoft/retina/retina-agent - initRepository: ghcr.io/microsoft/retina/retina-init + repository: demoebpfregistry.azurecr.io/vpidatala94/retina/retina-agent + initRepository: demoebpfregistry.azurecr.io/vpidatala94/retina/retina-init pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. - tag: "v0.0.2" + tag: "a6d7eb3" enableConntrackMetrics: false enablePodLevel: false diff --git a/go.mod b/go.mod index a47b318b2e..95415dc5c1 100644 --- a/go.mod +++ b/go.mod @@ -346,5 +346,5 @@ require ( ) replace github.com/vishvananda/netns => github.com/inspektor-gadget/netns v0.0.5-0.20230524185006-155d84c555d6 - +replace github.com/vpidatala94/retina/pkg/plugin/ebpfwindows => ./pkg/plugin/ebpfwindows replace k8s.io/perf-tests/network/benchmarks/netperf => github.com/Azure/perf-tests/network/benchmarks/netperf v0.0.0-20241008140716-395a79947d2c diff --git a/pkg/plugin/include_windows.go b/pkg/plugin/include_windows.go index 1cbb240eca..294d6066da 100644 --- a/pkg/plugin/include_windows.go +++ b/pkg/plugin/include_windows.go @@ -5,4 +5,5 @@ package plugin import ( _ "github.com/microsoft/retina/pkg/plugin/hnsstats" _ "github.com/microsoft/retina/pkg/plugin/pktmon" + _ "github.com/vpidatala94/retina/pkg/plugin/ebpfwindows" ) From 9a0d89fb00609e98d533af84429e0768d0e836ac Mon Sep 17 00:00:00 2001 From: Venkata Naga Kartik Pidatala Date: Thu, 20 Feb 2025 11:18:19 -0800 Subject: [PATCH 82/82] go mod changes --- ebpfwindows --- go.mod | 1 - 1 file changed, 1 deletion(-) diff --git a/go.mod b/go.mod index 95415dc5c1..b9c8d1bed5 100644 --- a/go.mod +++ b/go.mod @@ -346,5 +346,4 @@ require ( ) replace github.com/vishvananda/netns => github.com/inspektor-gadget/netns v0.0.5-0.20230524185006-155d84c555d6 -replace github.com/vpidatala94/retina/pkg/plugin/ebpfwindows => ./pkg/plugin/ebpfwindows replace k8s.io/perf-tests/network/benchmarks/netperf => github.com/Azure/perf-tests/network/benchmarks/netperf v0.0.0-20241008140716-395a79947d2c