Skip to content

Commit

Permalink
Merge branch 'iovisor:master' into lsan
Browse files Browse the repository at this point in the history
  • Loading branch information
Bojun-Seo authored Oct 13, 2022
2 parents 54c4e7d + 304692d commit 4181eb4
Show file tree
Hide file tree
Showing 226 changed files with 5,254 additions and 1,389 deletions.
47 changes: 47 additions & 0 deletions .github/actions/build-container/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: "Build/Push container"
description: "Build a BCC CI container and push it when not a pull-request."

inputs:
os_distro:
description: "OS Disctribution. Ex: ubuntu"
required: true
os_version:
description: "Version of the OS. Ex: 20.04"
required: true
os_nick:
description: "Nickname of the OS. Ex: focal"
required: true
registry:
description: "Registry where to push images"
default: ghcr.io
password:
description: "Password used to log into the docker registry."
push:
description: "Whether or not to push the build image"
type: boolean
default: false

runs:
using: "composite"
steps:
# Login against registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ inputs.registry }}
if: ${{ inputs.push == 'true' && github.event_name != 'pull_request' }}

uses: docker/login-action@v2
with:
registry: ${{ inputs.registry }}
username: ${{ github.actor }}
password: ${{ inputs.password }}

- name: Build and push
uses: docker/build-push-action@v3
with:
push: ${{ inputs.push == 'true' && github.event_name != 'pull_request' }}
build-args: |
VERSION=${{ inputs.os_version }}
SHORTNAME=${{ inputs.os_nick }}
file: docker/build/Dockerfile.${{ inputs.os_distro }}
tags: ${{ inputs.registry }}/${{ github.repository }}:${{ inputs.os_distro }}-${{ inputs.os_version }}

59 changes: 50 additions & 9 deletions .github/workflows/bcc-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,22 @@ on:
- master
pull_request:

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}

permissions:
contents: read # to fetch code (actions/checkout)
pull-requests: read # to read pull requests (dorny/paths-filter)

jobs:
test_bcc:
runs-on: ubuntu-20.04
strategy:
matrix:
os: [{version: "18.04", nick: bionic}, {version: "20.04", nick: focal}]
os: [{distro: "ubuntu", version: "18.04", nick: bionic}, {distro: "ubuntu", version: "20.04", nick: focal}]
env:
- TYPE: Debug
PYTHON_TEST_LOGFILE: critical.log
Expand All @@ -24,16 +34,30 @@ jobs:
RW_ENGINE_ENABLED: ON
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
docker:
- 'docker/build/**'
- name: System info
run: |
uname -a
ip addr
- name: Build docker container with all deps
- name: Pull docker container
if: steps.changes.outputs.docker == 'false'
run: |
docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.os.distro }}-${{ matrix.os.version }}
- name: Build docker container
if: steps.changes.outputs.docker == 'true'
uses: ./.github/actions/build-container
with:
os_distro: ${{ matrix.os.distro }}
os_version: ${{ matrix.os.version }}
os_nick: ${{ matrix.os.nick }}
- name: Tag docker container
run: |
docker build \
--build-arg UBUNTU_VERSION=${{ matrix.os.version }} \
--build-arg UBUNTU_SHORTNAME=${{ matrix.os.nick }} \
-t bcc-docker -f docker/Dockerfile.tests .
docker tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.os.distro }}-${{ matrix.os.version }} bcc-docker
- name: Run bcc build
env: ${{ matrix.env }}
run: |
Expand Down Expand Up @@ -103,21 +127,38 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
os: [{distro: "fedora", version: "34", nick: "f34"}, {distro: "fedora", version: "36", nick: "f36"}]
env:
- TYPE: Debug
PYTHON_TEST_LOGFILE: critical.log
- TYPE: Release
PYTHON_TEST_LOGFILE: critical.log
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
docker:
- 'docker/build/**'
- name: System info
run: |
uname -a
ip addr
- name: Build docker container with all deps
- name: Pull docker container
if: steps.changes.outputs.docker == 'false'
run: |
docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.os.distro }}-${{ matrix.os.version }}
- name: Build docker container
if: steps.changes.outputs.docker == 'true'
uses: ./.github/actions/build-container
with:
os_distro: ${{ matrix.os.distro }}
os_version: ${{ matrix.os.version }}
os_nick: ${{ matrix.os.nick }}
- name: Tag docker container
run: |
docker build \
-t bcc-docker -f docker/Dockerfile.fedora .
docker tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.os.distro }}-${{ matrix.os.version }} bcc-docker
- name: Run bcc build
env: ${{ matrix.env }}
run: |
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/publish-build-containers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish Build Containers

on:
# We want to update this image regularly and when updating master
schedule:
- cron: '00 18 * * *'
push:
branches:
- master
pull_request:
paths:
- 'docker/build/**'

permissions: {}

jobs:

publish_ghcr:
permissions:
contents: read # to fetch code (actions/checkout)
packages: write # to push container
name: Publish To GitHub Container Registry
runs-on: ubuntu-latest
strategy:
matrix:
os: [
{distro: "ubuntu", version: "18.04", nick: bionic},
{distro: "ubuntu", version: "20.04", nick: focal},
{distro: "fedora", version: "34", nick: "f34"},
{distro: "fedora", version: "36", nick: "f36"}
]

steps:

- uses: actions/checkout@v2

- name: Build and push
uses: ./.github/actions/build-container
with:
os_distro: ${{ matrix.os.distro }}
os_version: ${{ matrix.os.version }}
os_nick: ${{ matrix.os.nick }}
password: ${{ secrets.GITHUB_TOKEN }}
push: true
63 changes: 3 additions & 60 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,67 +6,10 @@ on:
- master
pull_request:

jobs:
publish_images:
# Optionally publish container images, guarded by the GitHub secret
# QUAY_PUBLISH.
# To set this up, sign up for quay.io (you can connect it to your github)
# then create a robot user with write access user called "bcc_buildbot",
# and add the secret token for it to GitHub secrets as:
# - QUAY_TOKEN = <token from quay.io>
name: Publish to quay.io
runs-on: ubuntu-latest
strategy:
matrix:
env:
- NAME: bionic-release
OS_RELEASE: 18.04
- NAME: focal-release
OS_RELEASE: 20.04
steps:

- uses: actions/checkout@v1

- name: Initialize workflow variables
id: vars
shell: bash
run: |
if [ -n "${QUAY_TOKEN}" ];then
echo "Quay token is set, will push an image"
echo ::set-output name=QUAY_PUBLISH::true
else
echo "Quay token not set, skipping"
fi
env:
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}

- name: Authenticate with quay.io docker registry
if: >
steps.vars.outputs.QUAY_PUBLISH
env:
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}
run: ./scripts/docker/auth.sh ${{ github.repository }}

- name: Package docker image and push to quay.io
if: >
steps.vars.outputs.QUAY_PUBLISH
run: >
./scripts/docker/push.sh
${{ github.repository }}
${{ github.ref }}
${{ github.sha }}
${{ matrix.env['NAME'] }}
${{ matrix.env['OS_RELEASE'] }}
# Uploads the packages built in docker to the github build as an artifact for convenience
- uses: actions/upload-artifact@v1
if: >
steps.vars.outputs.QUAY_PUBLISH
with:
name: ${{ matrix.env['NAME'] }}
path: output
permissions:
contents: read # to fetch code (actions/checkout)

jobs:
# Optionally publish container images to custom docker repository,
# guarded by presence of all required github secrets.
# GitHub secrets can be configured as follows:
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "libbpf-tools/bpftool"]
path = libbpf-tools/bpftool
url = https://github.com/libbpf/bpftool
[submodule "libbpf-tools/blazesym"]
path = libbpf-tools/blazesym
url = https://github.com/libbpf/blazesym
Loading

0 comments on commit 4181eb4

Please sign in to comment.