Skip to content

Commit fd8a819

Browse files
committed
Merging upstream main
2 parents 51aed73 + 27ef095 commit fd8a819

409 files changed

Lines changed: 45699 additions & 10037 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.

.devcontainer/devcontainer.json

Lines changed: 90 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,102 @@
11
{
22
"name": "retina",
3-
"image": "mcr.microsoft.com/devcontainers/base:jammy",
3+
"image": "mcr.microsoft.com/devcontainers/base:noble",
44
"features": {
5-
"ghcr.io/devcontainers/features/common-utils:2": {},
6-
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
7-
"ghcr.io/devcontainers/features/github-cli:1": {},
8-
"ghcr.io/devcontainers/features/go:1": {},
9-
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {},
10-
"ghcr.io/devcontainers-contrib/features/kind:1": {},
11-
"ghcr.io/devcontainers/features/azure-cli:1": {}
5+
"ghcr.io/devcontainers/features/docker-in-docker:2.16.1": {},
6+
"ghcr.io/devcontainers/features/github-cli:1.1.0": {},
7+
"ghcr.io/devcontainers/features/go:1.3.4": {
8+
"version": "1.24.11"
9+
},
10+
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1.3.1": {},
11+
"ghcr.io/devcontainers-extra/features/kind:1.0.15": {},
12+
"ghcr.io/devcontainers/features/azure-cli:1.2.9": {},
13+
// LLVM 17 is the minimum version available for Ubuntu Noble on apt.llvm.org.
14+
// Provides clang and llvm-strip needed for eBPF compilation.
15+
"ghcr.io/devcontainers-community/features/llvm:3.2.0": {
16+
"version": "17"
17+
}
18+
},
19+
"hostRequirements": {
20+
"cpus": 4,
21+
"memory": "8gb",
22+
"storage": "32gb"
23+
},
24+
// Persist Go module and build caches across container rebuilds.
25+
"mounts": [
26+
{
27+
"type": "volume",
28+
"source": "retina-gomodcache",
29+
"target": "/go/pkg/mod"
30+
},
31+
{
32+
"type": "volume",
33+
"source": "retina-gobuildcache",
34+
"target": "/home/vscode/.cache/go-build"
35+
}
36+
],
37+
// These commands run in parallel during container creation.
38+
"onCreateCommand": {
39+
// The LLVM feature installs versioned binaries (clang-17, llvm-strip-17).
40+
// Create unversioned symlinks so the build system can find them.
41+
"symlinks": "sudo ln -sf /usr/bin/clang-17 /usr/bin/clang && sudo ln -sf /usr/bin/llvm-strip-17 /usr/bin/llvm-strip",
42+
// Fix ownership of volume mounts (created as root) and cache dirs,
43+
// then download Go modules.
44+
"go-setup": "sudo chown -R vscode:vscode /go /home/vscode/.cache && go mod download",
45+
// Install jq (needed by some Makefile targets and scripts).
46+
"apt-deps": "sudo apt-get update && sudo apt-get install -y --no-install-recommends jq && sudo rm -rf /var/lib/apt/lists/*"
47+
},
48+
// Wait for Docker-in-Docker to be ready, then create a Kind cluster for local testing.
49+
"postStartCommand": {
50+
"kind": "while ! docker info >/dev/null 2>&1; do sleep 1; done && kind create cluster 2>/dev/null || true"
51+
},
52+
"waitFor": "onCreateCommand",
53+
"forwardPorts": [
54+
9965,
55+
4244,
56+
10093
57+
],
58+
"portsAttributes": {
59+
"9965": {
60+
"label": "Hubble Metrics",
61+
"onAutoForward": "silent"
62+
},
63+
"4244": {
64+
"label": "Hubble Relay",
65+
"onAutoForward": "silent"
66+
},
67+
"10093": {
68+
"label": "Retina Metrics",
69+
"onAutoForward": "silent"
70+
}
1271
},
13-
"postCreateCommand": "bash .devcontainer/installMoreTools.sh && kind create cluster",
1472
"customizations": {
1573
"vscode": {
1674
"extensions": [
17-
"esbenp.prettier-vscode",
1875
"golang.go",
19-
"mutantdino.resourcemonitor",
2076
"ms-vscode.makefile-tools",
21-
"ms-kubernetes-tools.vscode-kubernetes-tools"
22-
]
77+
"ms-kubernetes-tools.vscode-kubernetes-tools",
78+
"ms-azuretools.vscode-docker",
79+
"redhat.vscode-yaml",
80+
"mutantdino.resourcemonitor",
81+
"DavidAnson.vscode-markdownlint"
82+
],
83+
"settings": {
84+
"go.lintTool": "golangci-lint",
85+
"go.lintFlags": [
86+
"--config=.golangci.yaml",
87+
"--timeout=10m"
88+
],
89+
"go.formatTool": "gofumpt",
90+
"files.insertFinalNewline": true,
91+
"markdownlint.config": {
92+
"extends": ".github/.markdownlint.json"
93+
},
94+
"[markdown]": {
95+
"editor.codeActionsOnSave": {
96+
"source.fixAll.markdownlint": "explicit"
97+
}
98+
}
99+
}
23100
}
24101
}
25102
}

.devcontainer/installMoreTools.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

.github/.markdownlint.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
"MD013": false,
33
"MD010": false,
44
"MD033": false,
5+
"MD058": false,
6+
"MD059": false,
7+
"MD060": false,
58
"MD024": {
69
"siblings_only": true
710
}

.github/dependabot.yaml

Lines changed: 79 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,36 @@
11
version: 2
22
updates:
3+
# Docker base images across all Dockerfiles
34
- package-ecosystem: "docker"
4-
directory: "/"
5+
directories:
6+
- "/controller"
7+
- "/shell"
8+
- "/cli"
9+
- "/operator"
10+
- "/test/image"
11+
- "/hack/tools/kapinger"
12+
- "/hack/tools/toolbox"
513
schedule:
6-
interval: "daily"
14+
interval: "weekly"
715
reviewers:
816
- "microsoft/retina"
917
commit-message:
1018
prefix: "deps"
1119
labels: ["area/infra", "area/dependencies"]
1220
open-pull-requests-limit: 10
21+
cooldown:
22+
default-days: 7
23+
groups:
24+
golang-base:
25+
patterns: ["*golang*"]
26+
azurelinux-base:
27+
patterns: ["*azurelinux*"]
28+
windows-base:
29+
patterns: ["*windows*", "*nanoserver*", "*servercore*"]
30+
ubuntu-base:
31+
patterns: ["*ubuntu*"]
32+
33+
# GitHub Actions
1334
- package-ecosystem: "github-actions"
1435
directory: "/"
1536
schedule:
@@ -20,6 +41,34 @@ updates:
2041
prefix: "deps"
2142
labels: ["area/infra", "area/dependencies"]
2243
open-pull-requests-limit: 10
44+
cooldown:
45+
default-days: 3
46+
groups:
47+
actions-patch:
48+
update-types: ["patch"]
49+
50+
# npm (Docusaurus site)
51+
- package-ecosystem: "npm"
52+
directory: "/site"
53+
schedule:
54+
interval: "weekly"
55+
reviewers:
56+
- "microsoft/retina"
57+
commit-message:
58+
prefix: "deps"
59+
labels: ["area/docs", "area/dependencies"]
60+
open-pull-requests-limit: 5
61+
cooldown:
62+
default-days: 7
63+
semver-major-days: 30
64+
groups:
65+
docusaurus:
66+
patterns:
67+
- "@docusaurus/*"
68+
- "@mdx-js/*"
69+
update-types: ["patch"]
70+
71+
# Go modules
2372
- package-ecosystem: "gomod"
2473
directory: "/"
2574
schedule:
@@ -29,6 +78,32 @@ updates:
2978
commit-message:
3079
prefix: "deps"
3180
labels: ["lang/go", "area/dependencies"]
32-
ignore:
33-
- dependency-name: "github.com/inspektor-gadget/inspektor-gadget"
3481
open-pull-requests-limit: 10
82+
cooldown:
83+
default-days: 7
84+
semver-major-days: 30
85+
groups:
86+
k8s:
87+
patterns:
88+
- "k8s.io/*"
89+
- "sigs.k8s.io/*"
90+
exclude-patterns:
91+
- "sigs.k8s.io/cloud-provider-azure/*"
92+
update-types: ["patch"]
93+
cilium:
94+
patterns:
95+
- "github.com/cilium/*"
96+
update-types: ["patch"]
97+
aws-sdk:
98+
patterns:
99+
- "github.com/aws/aws-sdk-go-v2/*"
100+
update-types: ["patch"]
101+
azure-sdk:
102+
patterns:
103+
- "github.com/Azure/*"
104+
- "sigs.k8s.io/cloud-provider-azure/*"
105+
update-types: ["patch"]
106+
otel:
107+
patterns:
108+
- "go.opentelemetry.io/*"
109+
update-types: ["patch"]

.github/workflows/codeql.yaml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ on:
66
branches: [main]
77
pull_request:
88
branches: [main]
9+
10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
917
jobs:
1018
analyze:
1119
name: Analyze
@@ -17,7 +25,6 @@ jobs:
1725
language: [go]
1826
runs-on: ubuntu-latest
1927
env:
20-
IS_NOT_MERGE_GROUP: ${{ github.event_name != 'merge_group' }}
2128
GOOS: ${{ matrix.goos }}
2229
GOARCH: ${{ matrix.goarch }}
2330
timeout-minutes: 90
@@ -27,23 +34,18 @@ jobs:
2734
security-events: write
2835
steps:
2936
- name: Checkout repository
30-
if: env.IS_NOT_MERGE_GROUP
31-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
37+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3238
- name: Setup go
33-
if: env.IS_NOT_MERGE_GROUP
34-
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
39+
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
3540
with:
3641
go-version-file: go.mod
3742
- name: Initialize CodeQL
38-
if: env.IS_NOT_MERGE_GROUP
39-
uses: github/codeql-action/init@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
43+
uses: github/codeql-action/init@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0
4044
with:
4145
languages: ${{ matrix.language }}
4246
- name: Autobuild
43-
if: env.IS_NOT_MERGE_GROUP
44-
uses: github/codeql-action/autobuild@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
47+
uses: github/codeql-action/autobuild@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0
4548
- name: Perform CodeQL Analysis
46-
if: env.IS_NOT_MERGE_GROUP
47-
uses: github/codeql-action/analyze@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
49+
uses: github/codeql-action/analyze@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0
4850
with:
4951
category: "/language:${{matrix.language}}"

.github/workflows/commit-message.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@ on:
88
- synchronize
99
- edited
1010
- reopened
11+
12+
permissions:
13+
contents: read
14+
1115
jobs:
1216
commit-message:
1317
if: ${{ github.event_name != 'merge_group' }}
1418
runs-on: ubuntu-24.04
19+
timeout-minutes: 5
1520
steps:
1621
- name: verify_commit_message
1722
env:
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: DevContainer
2+
on:
3+
merge_group:
4+
push:
5+
branches: [main]
6+
paths:
7+
- ".devcontainer/**"
8+
- "go.mod"
9+
pull_request:
10+
branches: [main]
11+
paths:
12+
- ".devcontainer/**"
13+
- "go.mod"
14+
15+
permissions:
16+
contents: read
17+
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.ref }}
20+
cancel-in-progress: true
21+
22+
jobs:
23+
build:
24+
name: Build DevContainer
25+
runs-on: ubuntu-latest
26+
timeout-minutes: 30
27+
steps:
28+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
29+
30+
- name: Build and validate devcontainer
31+
uses: devcontainers/ci@b63b30de439b47a52267f241112c5b453b673db5 # v0.3.1900000449
32+
with:
33+
runCmd: |
34+
clang --version
35+
llvm-strip --version
36+
go version
37+
EXPECTED_GO=$(grep '^go ' go.mod | awk '{print $2}')
38+
ACTUAL_GO=$(go version | grep -oP '\d+\.\d+\.\d+')
39+
if [ "$EXPECTED_GO" != "$ACTUAL_GO" ]; then
40+
echo "::error::Go version mismatch: devcontainer has $ACTUAL_GO but go.mod requires $EXPECTED_GO"
41+
exit 1
42+
fi
43+
kubectl version --client
44+
helm version
45+
kind version
46+
grep -rl 'go:generate.*bpf2go' pkg/plugin/ | xargs -I{} go generate {}

0 commit comments

Comments
 (0)