Skip to content

Commit 46a87de

Browse files
committed
Merge branch 'main' into docs-publish
2 parents 86ef505 + a0f75d8 commit 46a87de

File tree

501 files changed

+30139
-10799
lines changed

Some content is hidden

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

501 files changed

+30139
-10799
lines changed

.deepsource.toml

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

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ templates/** -linguist-detectable
33
docs/** -linguist-detectable
44
lab-examples/** -linguist-detectable
55
# nextui is vendored
6-
clab/graph_templates/nextui/** linguist-vendored
6+
core/graph_templates/nextui/** linguist-vendored

.github/copilot-instructions.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
This is a Go based repository that contains a cli tool for deploying network os containers to simulate networking topologies. Please follow these guidelines when contributing:
2+
3+
## Code Standards
4+
5+
### Required Before Each Commit
6+
7+
- The code should be formatted with `make format` command.
8+
9+
- The repository uses golangci-lint for linting Go code. Make sure linting passes with `make lint` command when golangci is locally installed or `make clint` when using docker container.
10+
11+
- Testing is done with `make test` command.
12+
13+
## Repository Structure
14+
- The CLI tool source code is located in the `cmd/` directory.
15+
- The core library code is located in the `core/` directory.
16+
- The documentation files are located in the `docs/` directory.
17+
- The constants files are located in the `constants/` directory.
18+
- The files responsible to define nodes of the topology are located in the `nodes/` directory.
19+
- The files responsible to define links of the topology are located in the `links/` directory.
20+
- The files responsible to container runtime operations are located in the `runtime/` directory.
21+
- The JSON schema files are located in the `schema/` directory.
22+
23+
## Key Guidelines
24+
25+
1. Follow Go best practices and idiomatic patterns
26+
2. Maintain existing code structure and organization
27+
3. Use table-driven tests for functions with multiple scenarios
28+
4. Use cmp.Diff when writing tests to show differences between expected and actual values.
29+
5. Write unit tests for new functionality.
30+
6. Document public APIs and complex logic. Suggest changes to the `docs/` folder when appropriate

.github/workflows/build-containerlab.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ jobs:
1111
build-clab:
1212
runs-on: ubuntu-24.04
1313
steps:
14-
- uses: actions/checkout@v4
15-
- uses: WillAbides/setup-go[email protected]
14+
- uses: actions/checkout@v6
15+
- uses: actions/setup-go@v6
1616
with:
1717
go-version: ${{ inputs.go_ver }}
1818

@@ -33,7 +33,7 @@ jobs:
3333
run: make build-with-podman-debug BINARY=containerlab
3434
# store clab binary as artifact
3535
- name: Upload containerlab binary
36-
uses: actions/upload-artifact@v4
36+
uses: actions/upload-artifact@v5
3737
with:
3838
name: containerlab
3939
path: containerlab

.github/workflows/build-devcontainer.yml

Lines changed: 104 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -28,37 +28,64 @@ env:
2828
REGISTRY: ghcr.io
2929

3030
jobs:
31-
devcontainer:
32-
runs-on: ubuntu-24.04
31+
build:
32+
runs-on: ${{ matrix.runner }}
3333
strategy:
3434
matrix:
35-
variant:
36-
- "dind"
37-
- "dind-slim"
38-
- "dood"
39-
- "dood-slim"
4035
include:
41-
- variant: dind
36+
# AMD64 builds
37+
- platform: "linux/amd64"
38+
runner: "ubuntu-24.04"
39+
arch-suffix: "amd64"
40+
variant: "dind"
41+
devContFile: .devcontainer/docker-in-docker/devcontainer.json
42+
image-suffix: "-dind"
43+
- platform: "linux/amd64"
44+
runner: "ubuntu-24.04"
45+
arch-suffix: "amd64"
46+
variant: "dind-slim"
47+
devContFile: .devcontainer/docker-in-docker_slim/devcontainer.json
48+
image-suffix: "-dind-slim"
49+
- platform: "linux/amd64"
50+
runner: "ubuntu-24.04"
51+
arch-suffix: "amd64"
52+
variant: "dood"
53+
devContFile: .devcontainer/docker-outside-of-docker/devcontainer.json
54+
image-suffix: "-dood"
55+
- platform: "linux/amd64"
56+
runner: "ubuntu-24.04"
57+
arch-suffix: "amd64"
58+
variant: "dood-slim"
59+
devContFile: .devcontainer/docker-outside-of-docker_slim/devcontainer.json
60+
image-suffix: "-dood-slim"
61+
# ARM64 builds
62+
- platform: "linux/arm64"
63+
runner: "ubuntu-24.04-arm"
64+
arch-suffix: "arm64"
65+
variant: "dind"
4266
devContFile: .devcontainer/docker-in-docker/devcontainer.json
4367
image-suffix: "-dind"
44-
- variant: dind-slim
68+
- platform: "linux/arm64"
69+
runner: "ubuntu-24.04-arm"
70+
arch-suffix: "arm64"
71+
variant: "dind-slim"
4572
devContFile: .devcontainer/docker-in-docker_slim/devcontainer.json
4673
image-suffix: "-dind-slim"
47-
- variant: dood
74+
- platform: "linux/arm64"
75+
runner: "ubuntu-24.04-arm"
76+
arch-suffix: "arm64"
77+
variant: "dood"
4878
devContFile: .devcontainer/docker-outside-of-docker/devcontainer.json
4979
image-suffix: "-dood"
50-
- variant: dood-slim
80+
- platform: "linux/arm64"
81+
runner: "ubuntu-24.04-arm"
82+
arch-suffix: "arm64"
83+
variant: "dood-slim"
5184
devContFile: .devcontainer/docker-outside-of-docker_slim/devcontainer.json
5285
image-suffix: "-dood-slim"
5386
steps:
5487
- name: Checkout repository
55-
uses: actions/checkout@v4
56-
57-
- name: Setup QEMU
58-
uses: docker/setup-qemu-action@v3
59-
with:
60-
# workaround for https://github.com/tonistiigi/binfmt/issues/240
61-
image: tonistiigi/binfmt:qemu-v7.0.0-28
88+
uses: actions/checkout@v6
6289

6390
- name: Set up Docker Buildx
6491
uses: docker/setup-buildx-action@v3
@@ -70,21 +97,6 @@ jobs:
7097
username: ${{ github.actor }}
7198
password: ${{ secrets.GITHUB_TOKEN }}
7299

73-
# https://github.com/devcontainers/ci/issues/268#issuecomment-1976014578
74-
- name: remove existing skopeo
75-
run: |
76-
sudo rm -rf $(which skopeo)
77-
78-
- name: Update skopeo
79-
run: |
80-
REPO_URL="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_22.04"
81-
sudo sh -c "echo 'deb ${REPO_URL}/ /' > /etc/apt/sources.list.d/skopeo.list"
82-
curl -fsSL ${REPO_URL}/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/skopeo.gpg > /dev/null
83-
84-
sudo apt update
85-
sudo apt install skopeo
86-
skopeo --version
87-
88100
- name: Extract Docker metadata
89101
id: meta
90102
uses: docker/metadata-action@v5
@@ -102,7 +114,7 @@ jobs:
102114
- name: Extract tags
103115
id: extract-tags
104116
run: |
105-
TAGS=$(echo '${{ steps.meta.outputs.tags }}' | awk -F: '{print $2}' | paste -sd "," -)
117+
TAGS=$(echo '${{ steps.meta.outputs.tags }}' | awk -F: '{print $2}' | sed "s/$/\-${{ matrix.arch-suffix }}/" | paste -sd "," -)
106118
echo "TAGS=$TAGS" >> $GITHUB_OUTPUT
107119
shell: bash
108120

@@ -114,5 +126,62 @@ jobs:
114126
imageName: ghcr.io/${{ github.repository }}/devcontainer${{ matrix.image-suffix }}
115127
imageTag: ${{ steps.extract-tags.outputs.tags }}
116128
push: always
117-
platform: linux/amd64,linux/arm64
129+
platform: ${{ matrix.platform }}
118130
configFile: ${{ matrix.devContFile }}
131+
132+
create-manifest:
133+
needs: build
134+
runs-on: ubuntu-24.04
135+
strategy:
136+
matrix:
137+
variant:
138+
- name: "dind"
139+
image-suffix: "-dind"
140+
- name: "dind-slim"
141+
image-suffix: "-dind-slim"
142+
- name: "dood"
143+
image-suffix: "-dood"
144+
- name: "dood-slim"
145+
image-suffix: "-dood-slim"
146+
steps:
147+
- name: Log into registry ${{ env.REGISTRY }}
148+
uses: docker/login-action@v3
149+
with:
150+
registry: ${{ env.REGISTRY }}
151+
username: ${{ github.actor }}
152+
password: ${{ secrets.GITHUB_TOKEN }}
153+
154+
- name: Extract Docker metadata
155+
id: meta
156+
uses: docker/metadata-action@v5
157+
with:
158+
images: ${{ env.REGISTRY }}/${{ github.repository }}
159+
tags: |
160+
type=semver,pattern={{version}}
161+
type=ref,event=branch
162+
type=ref,event=pr
163+
# git short commit
164+
type=sha
165+
# manually set tag
166+
type=raw,value=${{ inputs.tag }}
167+
168+
- name: Extract base tags (without arch suffix)
169+
id: extract-tags
170+
run: |
171+
TAGS=$(echo '${{ steps.meta.outputs.tags }}' | awk -F: '{print $2}' | paste -sd "," -)
172+
echo "TAGS=$TAGS" >> $GITHUB_OUTPUT
173+
shell: bash
174+
175+
- name: Create and push manifest
176+
run: |
177+
for tag in $(echo "${{ steps.extract-tags.outputs.tags }}" | tr ',' '\n'); do
178+
IMAGE_BASE="ghcr.io/${{ github.repository }}/devcontainer${{ matrix.variant.image-suffix }}"
179+
180+
# Create manifest
181+
docker manifest create "${IMAGE_BASE}:${tag}" \
182+
--amend "${IMAGE_BASE}:${tag}-amd64" \
183+
--amend "${IMAGE_BASE}:${tag}-arm64"
184+
185+
# Push manifest
186+
docker manifest push "${IMAGE_BASE}:${tag}"
187+
done

0 commit comments

Comments
 (0)