-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(ci): make libbpf as the default attacher #1077
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this file is renamed |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ on: | |
|
||
env: | ||
OUTPUT_DIR: "_output/" | ||
FILE_NAME: "kepler.tar.gz" | ||
FILE_NAME: "kepler_libbpf.tar.gz" | ||
ARTIFACT_DIR: "/tmp/artifacts" | ||
|
||
jobs: | ||
|
@@ -24,29 +24,29 @@ jobs: | |
- name: install libbpf | ||
uses: sustainable-computing-io/[email protected] | ||
with: | ||
ebpfprovider: bcc | ||
ebpfprovider: libbpf | ||
# build kepler image | ||
- name: build and export Kepler image | ||
run: | | ||
make build_containerized | ||
sthaha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
make save-image | ||
env: | ||
IMAGE_REPO: "localhost:5001" | ||
IMAGE_TAG: "devel" | ||
IMAGE_NAME: "kepler" | ||
IMAGE_TAG: "devel" | ||
CTR_CMD: docker | ||
IMAGE_OUTPUT_PATH: ${{env.OUTPUT_DIR}}${{env.FILE_NAME}} | ||
# save kepler image | ||
- name: save Kepler image as artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: kepler | ||
name: keplerlibbpf | ||
sthaha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
path: ${{env.OUTPUT_DIR}}${{env.FILE_NAME}} | ||
retention-days: 1 | ||
# ref https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts | ||
# as PR or Push event, we don't keep artifact in 90 days hence use 1 day here to save resources. | ||
|
||
integration_test: | ||
integration_test_with_libbpf: | ||
needs: [build-kepler] | ||
runs-on: ubuntu-latest | ||
strategy: | ||
|
@@ -59,7 +59,7 @@ jobs: | |
- name: download Kepler image artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: kepler | ||
name: keplerlibbpf | ||
sthaha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: build manifest | ||
run: make build-manifest OPTS="CI_DEPLOY" | ||
sthaha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
@@ -81,7 +81,7 @@ jobs: | |
- name: use Kepler action to deploy cluster | ||
uses: sustainable-computing-io/[email protected] | ||
with: | ||
ebpfprovider: bcc | ||
ebpfprovider: libbpf | ||
cluster_provider: ${{matrix.cluster_provider}} | ||
local_dev_cluster_version: v0.0.3 | ||
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this file is renamed |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
name: Integration test with libbpf | ||
name: Integration test with bcc | ||
|
||
on: | ||
workflow_call: | ||
|
||
env: | ||
OUTPUT_DIR: "_output/" | ||
FILE_NAME: "kepler_libbpf.tar.gz" | ||
FILE_NAME: "kepler-bcc.tar.gz" | ||
ARTIFACT_DIR: "/tmp/artifacts" | ||
|
||
jobs: | ||
build-kepler_with_libbpf: | ||
build-kepler-with-bcc: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# checkout source code | ||
|
@@ -21,33 +21,33 @@ jobs: | |
with: | ||
go-version-file: go.mod | ||
# set up ebpf | ||
- name: install libbpf | ||
- name: install bcc | ||
uses: sustainable-computing-io/[email protected] | ||
with: | ||
ebpfprovider: libbpf | ||
ebpfprovider: bcc | ||
# build kepler image | ||
- name: build and export Kepler image | ||
run: | | ||
make build_containerized | ||
make save-image | ||
env: | ||
IMAGE_REPO: "localhost:5001" | ||
IMAGE_NAME: "kepler" | ||
IMAGE_TAG: "devel" | ||
IMAGE_NAME: "kepler" | ||
CTR_CMD: docker | ||
IMAGE_OUTPUT_PATH: ${{env.OUTPUT_DIR}}${{env.FILE_NAME}} | ||
# save kepler image | ||
- name: save Kepler image as artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: keplerlibbpf | ||
name: kepler | ||
sthaha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
path: ${{env.OUTPUT_DIR}}${{env.FILE_NAME}} | ||
retention-days: 1 | ||
# ref https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts | ||
# as PR or Push event, we don't keep artifact in 90 days hence use 1 day here to save resources. | ||
|
||
integration_test_with_libbpf: | ||
needs: [build-kepler_with_libbpf] | ||
integration_test: | ||
needs: [build-kepler-with-bcc] | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
|
@@ -59,7 +59,7 @@ jobs: | |
- name: download Kepler image artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: keplerlibbpf | ||
name: kepler | ||
|
||
- name: build manifest | ||
run: make build-manifest OPTS="CI_DEPLOY" | ||
|
@@ -81,7 +81,7 @@ jobs: | |
- name: use Kepler action to deploy cluster | ||
uses: sustainable-computing-io/[email protected] | ||
with: | ||
ebpfprovider: libbpf | ||
ebpfprovider: bcc | ||
cluster_provider: ${{matrix.cluster_provider}} | ||
local_dev_cluster_version: v0.0.3 | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,17 +130,17 @@ jobs: | |
context: . | ||
platforms: linux/amd64 | ||
push: true | ||
tags: quay.io/sustainable_computing_io/kepler:latest, quay.io/sustainable_computing_io/kepler:${{ github.event.inputs.release }} | ||
tags: quay.io/sustainable_computing_io/kepler:latest, quay.io/sustainable_computing_io/kepler:${{ github.event.inputs.release }}-bcc | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we have the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lets take this question in some other PR There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reason I ask is because I am assuming that the previous release tagged There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
labels: latest, ${{ github.event.inputs.release }}, bcc | ||
file: build/Dockerfile | ||
|
||
- name: Build and push kepler libbpf latest image | ||
- name: Build and push kepler latest libbpf image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
platforms: linux/amd64 | ||
push: true | ||
tags: quay.io/sustainable_computing_io/kepler:latest, quay.io/sustainable_computing_io/kepler:${{ github.event.inputs.release }}-libbpf | ||
tags: quay.io/sustainable_computing_io/kepler:latest, quay.io/sustainable_computing_io/kepler:${{ github.event.inputs.release }} | ||
labels: latest, ${{ github.event.inputs.release }}, libbpf | ||
file: build/Dockerfile.libbpf.kepler | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,18 +27,27 @@ jobs: | |
env: | ||
GOPATH: /home/runner/go | ||
GOBIN: /home/runner/go/bin | ||
- name: install bcc | ||
- name: install libbpf | ||
uses: sustainable-computing-io/[email protected] | ||
with: | ||
ebpfprovider: bcc | ||
ebpfprovider: libbpf | ||
- name: Prepare environment | ||
run: | | ||
sudo apt-get install -y cpuid | ||
cd doc/ && sudo ./dev/prepare_dev_env.sh && cd - | ||
git config --global --add safe.directory /kepler | ||
- name: Run | ||
run: | | ||
make test-verbose | ||
sudo apt remove libbpf-dev | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sustainable-computing-io/kepler-action#87 created accordingly. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rootfs / @vimalk78 / @sthaha could you please help double confirm if we need sustainable-computing-io/kepler-action#87 ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. new issue related to this PR as #1086 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
yes @SamYuan1990, opening a PR for the same. in this PR i wanted to test what works. will update kepler-action, and then we dont needs this setup in CI There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @vimalk78 I am going to sleep, please take a look at #1086 briefly, the libbpf-dev ubuntu distribution has the static link file but it seems the version for ubuntu distribution is too old. or mismatch with the golang code. hence I am worry about if libbpf is ready for use? as if we build it from source each time.... dependence maintain as OpenSSF or SBOM sounds like disaster for us. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @SamYuan1990 pls check this PR sustainable-computing-io/kepler-action#90 |
||
mkdir temp-libbpf | ||
cd temp-libbpf | ||
git clone https://github.com/libbpf/libbpf | ||
cd libbpf/src | ||
sudo make install_headers | ||
sudo make install_uapi_headers | ||
sudo prefix=/usr BUILD_STATIC_ONLY=y make install | ||
cd ../../../ | ||
ATTACHER_TAG=libbpf make test-verbose | ||
go tool cover -func=coverage.out -o=coverage.out | ||
- name: Go Coverage Badge # Pass the `coverage.out` output to this action | ||
uses: tj-actions/coverage-badge-go@v2 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,7 +49,7 @@ ifdef ATTACHER_TAG | |
ifeq ($(ATTACHER_TAG),libbpf) | ||
LIBBPF_HEADERS := /usr/include/bpf | ||
KEPLER_OBJ_SRC := $(SRC_ROOT)/bpfassets/libbpf/bpf.o/$(GOARCH)_kepler.bpf.o | ||
LIBBPF_OBJ := /usr/lib64/libbpf.a | ||
LIBBPF_OBJ ?= /usr/lib64/libbpf.a | ||
endif | ||
else | ||
# auto determine | ||
|
@@ -277,6 +277,7 @@ test: ginkgo-set tidy-vendor | |
|
||
test-verbose: ginkgo-set tidy-vendor | ||
@echo TAGS=$(GO_BUILD_TAGS) | ||
@echo GOENV=$(GOENV) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need echo this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the information echoed in this line is helpful in checking errors we get from |
||
@$(GOENV) go test -tags $(GO_BUILD_TAGS) -covermode=atomic -coverprofile=coverage.out -v $$(go list ./... | grep pkg | grep -v bpfassets) --race --bench=. -cover --count=1 --vet=all | ||
|
||
test-mac-verbose: ginkgo-set | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be changed to
Build and push kepler latest (bcc)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated