Skip to content

Commit df3ff48

Browse files
authored
DLPX-96702 Update delphix/bcc to be current with upstream iovisor/bcc
PR URL: https://www.github.com/delphix/bcc/pull/20
2 parents 6090e9c + 57c6aed commit df3ff48

743 files changed

Lines changed: 927299 additions & 300511 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
Dockerfile*
22
build
33
.*.swp
4+
docker/Dockerfile*
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: "Build/Push container"
2+
description: "Build a BCC CI container and push it when not a pull-request."
3+
4+
inputs:
5+
os_distro:
6+
description: "OS Disctribution. Ex: ubuntu"
7+
required: true
8+
os_version:
9+
description: "Version of the OS. Ex: 24.04"
10+
required: true
11+
os_nick:
12+
description: "Nickname of the OS. Ex: noble"
13+
required: true
14+
llvm_versions:
15+
description: "Space separated list of llvm versions to install in the container. Only supported for Ubuntu containers."
16+
type: string
17+
default: "15"
18+
registry:
19+
description: "Registry where to push images"
20+
default: ghcr.io
21+
password:
22+
description: "Password used to log into the docker registry."
23+
push:
24+
description: "Whether or not to push the build image"
25+
type: boolean
26+
default: false
27+
28+
runs:
29+
using: "composite"
30+
steps:
31+
# Login against registry except on PR
32+
# https://github.com/docker/login-action
33+
- name: Log into registry ${{ inputs.registry }}
34+
if: ${{ inputs.push == 'true' && github.event_name != 'pull_request' }}
35+
36+
uses: docker/login-action@v2
37+
with:
38+
registry: ${{ inputs.registry }}
39+
username: ${{ github.actor }}
40+
password: ${{ inputs.password }}
41+
42+
- name: Build and push
43+
uses: docker/build-push-action@v3
44+
with:
45+
push: ${{ inputs.push == 'true' && github.event_name != 'pull_request' }}
46+
build-args: |
47+
VERSION=${{ inputs.os_version }}
48+
SHORTNAME=${{ inputs.os_nick }}
49+
LLVM_VERSION=${{ inputs.llvm_versions }}
50+
file: docker/build/Dockerfile.${{ inputs.os_distro }}
51+
tags: ${{ inputs.registry }}/${{ github.repository }}:${{ inputs.os_distro }}-${{ inputs.os_version }}
52+

.github/disabled-workflows/publish.yml

Lines changed: 9 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,15 @@
11
name: Publish Build Artifacts
22

3-
on: push
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
48

5-
jobs:
6-
publish_images:
7-
# Optionally publish container images, guarded by the GitHub secret
8-
# QUAY_PUBLISH.
9-
# To set this up, sign up for quay.io (you can connect it to your github)
10-
# then create a robot user with write access user called "bcc_buildbot",
11-
# and add the secret token for it to GitHub secrets as:
12-
# - QUAY_TOKEN = <token from quay.io>
13-
name: Publish to quay.io
14-
runs-on: ubuntu-latest
15-
strategy:
16-
matrix:
17-
env:
18-
- NAME: bionic-release
19-
OS_RELEASE: 18.04
20-
- NAME: focal-release
21-
OS_RELEASE: 20.04
22-
steps:
23-
24-
- uses: actions/checkout@v1
25-
26-
- name: Initialize workflow variables
27-
id: vars
28-
shell: bash
29-
run: |
30-
if [ -n "${QUAY_TOKEN}" ];then
31-
echo "Quay token is set, will push an image"
32-
echo ::set-output name=QUAY_PUBLISH::true
33-
else
34-
echo "Quay token not set, skipping"
35-
fi
36-
37-
env:
38-
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}
39-
40-
- name: Authenticate with quay.io docker registry
41-
if: >
42-
steps.vars.outputs.QUAY_PUBLISH
43-
env:
44-
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}
45-
run: ./scripts/docker/auth.sh ${{ github.repository }}
46-
47-
- name: Package docker image and push to quay.io
48-
if: >
49-
steps.vars.outputs.QUAY_PUBLISH
50-
run: >
51-
./scripts/docker/push.sh
52-
${{ github.repository }}
53-
${{ github.ref }}
54-
${{ github.sha }}
55-
${{ matrix.env['NAME'] }}
56-
${{ matrix.env['OS_RELEASE'] }}
57-
58-
# Uploads the packages built in docker to the github build as an artifact for convenience
59-
- uses: actions/upload-artifact@v1
60-
if: >
61-
steps.vars.outputs.QUAY_PUBLISH
62-
with:
63-
name: ${{ matrix.env['NAME'] }}
64-
path: output
9+
permissions:
10+
contents: read # to fetch code (actions/checkout)
6511

12+
jobs:
6613
# Optionally publish container images to custom docker repository,
6714
# guarded by presence of all required github secrets.
6815
# GitHub secrets can be configured as follows:
@@ -95,7 +42,7 @@ jobs:
9542

9643
- name: Build container image and publish to registry
9744
id: publish-registry
98-
uses: elgohr/Publish-Docker-Github-Action@2.8
45+
uses: elgohr/Publish-Docker-Github-Action@v5
9946
if: ${{ steps.vars.outputs.DOCKER_PUBLISH }}
10047
with:
10148
name: ${{ secrets.DOCKER_IMAGE }}

.github/scripts/check_links.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#! /usr/bin/env python3
2+
3+
import re
4+
import requests
5+
import os
6+
from pathlib import Path
7+
8+
headers = {
9+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
10+
}
11+
timeout = 10
12+
13+
links_file = Path('LINKS.md')
14+
content = links_file.read_text(encoding='utf-8')
15+
16+
link_pattern = re.compile(r'\[([^\]]+)\]\(([^)]+)\)')
17+
links = link_pattern.findall(content)
18+
19+
broken_links = []
20+
for text, url in links:
21+
try:
22+
print(f"Checking: {url}")
23+
response = requests.head(url, headers=headers, timeout=timeout, allow_redirects=True)
24+
25+
if response.status_code >= 400:
26+
response = requests.get(url, headers=headers, timeout=timeout, allow_redirects=True)
27+
28+
if response.status_code >= 400:
29+
broken_links.append((text, url, response.status_code))
30+
except Exception as e:
31+
broken_links.append((text, url, str(e)))
32+
33+
if broken_links:
34+
report = "# Broken Links Report\n\n"
35+
report += "The following links in LINKS.md are broken:\n\n"
36+
report += "| Link Text | URL | Error |\n"
37+
report += "|-----------|-----|-------|\n"
38+
39+
for text, url, error in broken_links:
40+
report += f"| {text} | {url} | {error} |\n"
41+
42+
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
43+
delimiter = "_REPORT_DELIMITER_"
44+
f.write(f"broken_links=true\n")
45+
f.write(f"report<<{delimiter}\n{report}\n{delimiter}\n")
46+
else:
47+
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
48+
f.write("broken_links=false\n")

0 commit comments

Comments
 (0)