diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index 710d9a98..4d30f4fc 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -18,177 +18,177 @@ concurrency: cancel-in-progress: true jobs: - clang-format-check: - runs-on: ubuntu-20.04 - name: clang-format-check + # clang-format-check: + # runs-on: ubuntu-20.04 + # name: clang-format-check - steps: - - name: Print github workspace - run: | - echo "github.workspace = ${{ github.workspace }}" - echo "pr.ref = ${{github.event.pull_request.head.ref}}" - echo "github.ref = ${{ github.ref }}" - echo "$GITHUB_CONTEXT" + # steps: + # - name: Print github workspace + # run: | + # echo "github.workspace = ${{ github.workspace }}" + # echo "pr.ref = ${{github.event.pull_request.head.ref}}" + # echo "github.ref = ${{ github.ref }}" + # echo "$GITHUB_CONTEXT" - - name: Check out the codebase - uses: actions/checkout@v3 + # - name: Check out the codebase + # uses: actions/checkout@v3 - - name: Get current date - id: date - run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT + # - name: Get current date + # id: date + # run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT - - name: Runs format checker - run: | - sudo apt update - sudo apt install -y clang-format-11 - cd ${{ github.workspace }} - ./.github/workflows/scripts/check-clang-format.sh - - outputs: - date: ${{ steps.date.outputs.date }} - - build-reducer: - name: build-reducer - runs-on: ubuntu-20.04 - needs: [clang-format-check] - steps: - - name: Check out the codebase - uses: actions/checkout@v3 - with: - fetch-depth: 0 + # - name: Runs format checker + # run: | + # sudo apt update + # sudo apt install -y clang-format-11 + # cd ${{ github.workspace }} + # ./.github/workflows/scripts/check-clang-format.sh - - name: build-reducer - env: - PASS: ${{ secrets.DOCKER_PASSWORD }} - run: | - echo "github.workspace = ${{ github.workspace }}" - docker pull $BENV_IMAGE - git submodule update --init --recursive - docker run -t \ - --rm \ - --mount "type=bind,source=/var/run/docker.sock,destination=/var/run/docker.sock" \ - --mount "type=bind,source=$(git rev-parse --show-toplevel),destination=/root/src,readonly" \ - --env EBPF_NET_SRC_ROOT=/root/src \ - $BENV_IMAGE \ - ./build.sh reducer + # outputs: + # date: ${{ steps.date.outputs.date }} - build-kernel-collector: - name: build-kernel-collector - runs-on: ubuntu-20.04 - needs: [clang-format-check] - steps: - - name: Check out the codebase - uses: actions/checkout@v3 - with: - fetch-depth: 0 + # build-reducer: + # name: build-reducer + # runs-on: ubuntu-20.04 + # needs: [clang-format-check] + # steps: + # - name: Check out the codebase + # uses: actions/checkout@v3 + # with: + # fetch-depth: 0 - - name: build-kernel-collector - env: - PASS: ${{ secrets.DOCKER_PASSWORD }} - run: | - echo "github.workspace = ${{ github.workspace }}" - docker pull $BENV_IMAGE - git submodule update --init --recursive - docker run -t \ - --rm \ - --mount "type=bind,source=/var/run/docker.sock,destination=/var/run/docker.sock" \ - --mount "type=bind,source=$(git rev-parse --show-toplevel),destination=/root/src,readonly" \ - --env EBPF_NET_SRC_ROOT=/root/src \ - $BENV_IMAGE \ - ./build.sh kernel-collector + # - name: build-reducer + # env: + # PASS: ${{ secrets.DOCKER_PASSWORD }} + # run: | + # echo "github.workspace = ${{ github.workspace }}" + # docker pull $BENV_IMAGE + # git submodule update --init --recursive + # docker run -t \ + # --rm \ + # --mount "type=bind,source=/var/run/docker.sock,destination=/var/run/docker.sock" \ + # --mount "type=bind,source=$(git rev-parse --show-toplevel),destination=/root/src,readonly" \ + # --env EBPF_NET_SRC_ROOT=/root/src \ + # $BENV_IMAGE \ + # ./build.sh reducer - build-k8s-relay: - name: build-k8s-relay - runs-on: ubuntu-20.04 - needs: [clang-format-check] - steps: - - name: Check out the codebase - uses: actions/checkout@v3 - with: - fetch-depth: 0 + # build-kernel-collector: + # name: build-kernel-collector + # runs-on: ubuntu-20.04 + # needs: [clang-format-check] + # steps: + # - name: Check out the codebase + # uses: actions/checkout@v3 + # with: + # fetch-depth: 0 - - name: build k8s-relay - run: | - echo "github.workspace = ${{ github.workspace }}" - docker pull $BENV_IMAGE - git submodule update --init --recursive - docker run -t \ - --rm \ - --mount "type=bind,source=/var/run/docker.sock,destination=/var/run/docker.sock" \ - --mount "type=bind,source=$(git rev-parse --show-toplevel),destination=/root/src,readonly" \ - --env EBPF_NET_SRC_ROOT=/root/src \ - $BENV_IMAGE \ - ./build.sh k8s-relay + # - name: build-kernel-collector + # env: + # PASS: ${{ secrets.DOCKER_PASSWORD }} + # run: | + # echo "github.workspace = ${{ github.workspace }}" + # docker pull $BENV_IMAGE + # git submodule update --init --recursive + # docker run -t \ + # --rm \ + # --mount "type=bind,source=/var/run/docker.sock,destination=/var/run/docker.sock" \ + # --mount "type=bind,source=$(git rev-parse --show-toplevel),destination=/root/src,readonly" \ + # --env EBPF_NET_SRC_ROOT=/root/src \ + # $BENV_IMAGE \ + # ./build.sh kernel-collector - build-cloud-collector: - name: build-cloud-collector - runs-on: ubuntu-20.04 - needs: [clang-format-check] - steps: - - name: Check out the codebase - uses: actions/checkout@v3 - with: - fetch-depth: 0 + # build-k8s-relay: + # name: build-k8s-relay + # runs-on: ubuntu-20.04 + # needs: [clang-format-check] + # steps: + # - name: Check out the codebase + # uses: actions/checkout@v3 + # with: + # fetch-depth: 0 - - name: build cloud-collector - run: | - echo "github.workspace = ${{ github.workspace }}" - docker pull $BENV_IMAGE - git submodule update --init --recursive - docker run -t \ - --rm \ - --mount "type=bind,source=/var/run/docker.sock,destination=/var/run/docker.sock" \ - --mount "type=bind,source=$(git rev-parse --show-toplevel),destination=/root/src,readonly" \ - --env EBPF_NET_SRC_ROOT=/root/src \ - $BENV_IMAGE \ - ./build.sh cloud-collector + # - name: build k8s-relay + # run: | + # echo "github.workspace = ${{ github.workspace }}" + # docker pull $BENV_IMAGE + # git submodule update --init --recursive + # docker run -t \ + # --rm \ + # --mount "type=bind,source=/var/run/docker.sock,destination=/var/run/docker.sock" \ + # --mount "type=bind,source=$(git rev-parse --show-toplevel),destination=/root/src,readonly" \ + # --env EBPF_NET_SRC_ROOT=/root/src \ + # $BENV_IMAGE \ + # ./build.sh k8s-relay - build-k8s-watcher: - name: build-k8s-watcher - runs-on: ubuntu-20.04 - needs: [clang-format-check] - steps: - - name: Check out the codebase - uses: actions/checkout@v3 - with: - fetch-depth: 0 + # build-cloud-collector: + # name: build-cloud-collector + # runs-on: ubuntu-20.04 + # needs: [clang-format-check] + # steps: + # - name: Check out the codebase + # uses: actions/checkout@v3 + # with: + # fetch-depth: 0 - - name: build k8s-watcher - run: | - echo "github.workspace = ${{ github.workspace }}" - docker pull $BENV_IMAGE - git submodule update --init --recursive - docker run -t \ - --rm \ - --mount "type=bind,source=/var/run/docker.sock,destination=/var/run/docker.sock" \ - --mount "type=bind,source=$(git rev-parse --show-toplevel),destination=/root/src,readonly" \ - --env EBPF_NET_SRC_ROOT=/root/src \ - $BENV_IMAGE \ - ./build.sh k8s-watcher + # - name: build cloud-collector + # run: | + # echo "github.workspace = ${{ github.workspace }}" + # docker pull $BENV_IMAGE + # git submodule update --init --recursive + # docker run -t \ + # --rm \ + # --mount "type=bind,source=/var/run/docker.sock,destination=/var/run/docker.sock" \ + # --mount "type=bind,source=$(git rev-parse --show-toplevel),destination=/root/src,readonly" \ + # --env EBPF_NET_SRC_ROOT=/root/src \ + # $BENV_IMAGE \ + # ./build.sh cloud-collector - build-run-unit-tests: - name: build-run-unit-tests - runs-on: ubuntu-20.04 - needs: [clang-format-check] - steps: - - name: Check out the codebase - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: run unit tests - run: | - echo "github.workspace = ${{ github.workspace }}" - docker pull $BENV_IMAGE - git submodule update --init --recursive - docker run -t \ - --rm \ - --mount "type=bind,source=/var/run/docker.sock,destination=/var/run/docker.sock" \ - --mount "type=bind,source=$(git rev-parse --show-toplevel),destination=/root/src,readonly" \ - --env EBPF_NET_SRC_ROOT=/root/src \ - --env ARGS="--output-on-failure --repeat until-pass:3" \ - --env SPDLOG_LEVEL="trace" \ - $BENV_IMAGE \ - ./build.sh unit_tests test + # build-k8s-watcher: + # name: build-k8s-watcher + # runs-on: ubuntu-20.04 + # needs: [clang-format-check] + # steps: + # - name: Check out the codebase + # uses: actions/checkout@v3 + # with: + # fetch-depth: 0 + + # - name: build k8s-watcher + # run: | + # echo "github.workspace = ${{ github.workspace }}" + # docker pull $BENV_IMAGE + # git submodule update --init --recursive + # docker run -t \ + # --rm \ + # --mount "type=bind,source=/var/run/docker.sock,destination=/var/run/docker.sock" \ + # --mount "type=bind,source=$(git rev-parse --show-toplevel),destination=/root/src,readonly" \ + # --env EBPF_NET_SRC_ROOT=/root/src \ + # $BENV_IMAGE \ + # ./build.sh k8s-watcher + + # build-run-unit-tests: + # name: build-run-unit-tests + # runs-on: ubuntu-20.04 + # needs: [clang-format-check] + # steps: + # - name: Check out the codebase + # uses: actions/checkout@v3 + # with: + # fetch-depth: 0 + # - name: run unit tests + # run: | + # echo "github.workspace = ${{ github.workspace }}" + # docker pull $BENV_IMAGE + # git submodule update --init --recursive + # docker run -t \ + # --rm \ + # --mount "type=bind,source=/var/run/docker.sock,destination=/var/run/docker.sock" \ + # --mount "type=bind,source=$(git rev-parse --show-toplevel),destination=/root/src,readonly" \ + # --env EBPF_NET_SRC_ROOT=/root/src \ + # --env ARGS="--output-on-failure --repeat until-pass:3" \ + # --env SPDLOG_LEVEL="trace" \ + # $BENV_IMAGE \ + # ./build.sh unit_tests test # build-run-unit-tests-with-asan-and-debug-flags: # name: build-run-unit-tests-with-asan-and-debug-flags @@ -215,7 +215,7 @@ jobs: run-kernel-header-tests: name: run-kernel-header-tests - needs: [clang-format-check] + # needs: [clang-format-check] runs-on: macos-13 env: EBPF_NET_SRC_ROOT: ${{ github.workspace }} @@ -252,16 +252,27 @@ jobs: id: run-kernel-header-tests if: steps.changes.outputs.kernel == 'true' || steps.changes.outputs.github == 'true' run: | - sudo spctl --add /usr/local/bin/brew - # These following 4 lines are added to overcome brew link failures seen while executing brew update. - rm /usr/local/bin/2to3* - rm /usr/local/bin/idle* - rm /usr/local/bin/pydoc* - rm /usr/local/bin/python3* - brew update + # # Install podman + # curl -LO "https://github.com/containers/podman/releases/download/v4.9.4/podman-remote-release-darwin_amd64.zip" + # unzip podman-remote-release-darwin_amd64.zip + # sudo mv podman-4.9.4/usr/bin/podman /usr/local/bin/podman + # sudo chmod +x /usr/local/bin/podman + + # cat <> ~/.config/containers/containers.conf + # [engine] + # helper_binaries_dir = [ + # "{PATH_TO_GPROXY_BIN}", + # "/usr/local/libexec/podman", + # "/usr/local/lib/podman", + # "/usr/libexec/podman", + # "/usr/lib/podman", + # ] + # EOF brew install podman - sudo spctl --add /usr/local/bin/podman - podman machine init --rootful --cpus 3 --disk-size 14 --memory 12384 + + podman --version + + podman machine init --rootful podman machine start podman pull $BENV_IMAGE @@ -289,78 +300,71 @@ jobs: ./test/kernel/run-tests.sh --kernel-header-test - run-kernel-collector-tests: - name: run-kernel-collector-tests - needs: [clang-format-check] - runs-on: macos-13 - env: - EBPF_NET_SRC_ROOT: ${{ github.workspace }} - steps: - - name: Check out the codebase - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - uses: dorny/paths-filter@v2 - id: changes - with: - filters: | - kernel: - - 'channel/**' - - 'cmake/**' - - 'collector/kernel/**' - - 'common/**' - - 'config/**' - - 'ext/**' - - 'geoip/**' - - 'jitbuf/**' - - 'otlp/**' - - 'platform/**' - - 'render/**' - - 'renderc/**' - - 'scheduling/**' - - 'test/kernel/**' - - 'util/**' - github: - - '.github/**' - - - name: Run kernel_collector_test on multiple linux distributions - id: run-kernel-collector-test - if: steps.changes.outputs.kernel == 'true' || steps.changes.outputs.github == 'true' - run: | - sudo spctl --add /usr/local/bin/brew - # These following 4 lines are added to overcome brew link failures seen while executing brew update. - rm /usr/local/bin/2to3* - rm /usr/local/bin/idle* - rm /usr/local/bin/pydoc* - rm /usr/local/bin/python3* - brew update - brew install podman - sudo spctl --add /usr/local/bin/podman - podman machine init --rootful --cpus 3 --disk-size 14 --memory 12348 - podman machine start - podman pull $BENV_IMAGE + # run-kernel-collector-tests: + # name: run-kernel-collector-tests + # needs: [clang-format-check] + # runs-on: ubuntu-latest + # env: + # EBPF_NET_SRC_ROOT: ${{ github.workspace }} + # steps: + # - name: Check out the codebase + # uses: actions/checkout@v3 + # with: + # fetch-depth: 0 - podman machine ssh 'cat > /etc/containers/registries.conf.d/localhost.conf' < /etc/containers/registries.conf.d/localhost.conf' <