conlink 2.5.8 → 2.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -80,8 +80,18 @@ jobs:
80
80
 
81
81
  release-docker-hub:
82
82
  needs: [ check-release ]
83
- name: Release Docker Hub
84
- runs-on: ubuntu-latest
83
+ name: Release Docker Hub (native multi-arch)
84
+ strategy:
85
+ fail-fast: false
86
+ matrix:
87
+ include:
88
+ - runner: ubuntu-latest
89
+ platform: linux/amd64
90
+ suffix: amd64
91
+ - runner: ubuntu-24.04-arm
92
+ platform: linux/arm64
93
+ suffix: arm64
94
+ runs-on: ${{ matrix.runner }}
85
95
  env:
86
96
  RELEASE_VERSION: ${{ needs.check-release.outputs.RELEASE_VERSION }}
87
97
  steps:
@@ -89,20 +99,49 @@ jobs:
89
99
  uses: actions/checkout@v4
90
100
  with: { submodules: 'recursive', fetch-depth: 0 }
91
101
 
102
+ - name: Set up Docker Buildx
103
+ uses: docker/setup-buildx-action@v3
104
+
92
105
  - name: Login to Docker Hub
93
106
  uses: docker/login-action@v3
94
107
  with:
95
108
  username: ${{ secrets.DOCKERHUB_USERNAME }}
96
109
  password: ${{ secrets.DOCKERHUB_TOKEN }}
97
110
 
98
- - name: Build and push
111
+ - name: Build and push (native ${{ matrix.suffix }})
99
112
  uses: docker/build-push-action@v6
100
113
  with:
101
114
  push: true
102
- tags: lonocloud/conlink:${{ env.RELEASE_VERSION }}
103
-
104
- - name: Build and push
105
- uses: docker/build-push-action@v6
115
+ platforms: ${{ matrix.platform }}
116
+ tags: |
117
+ lonocloud/conlink:${{ env.RELEASE_VERSION }}-${{ matrix.suffix }}
118
+ lonocloud/conlink:latest-${{ matrix.suffix }}
119
+
120
+ release-docker-hub-manifest:
121
+ needs: [ check-release, release-docker-hub ]
122
+ name: Release Docker Hub (publish multi-arch tags)
123
+ runs-on: ubuntu-latest
124
+ env:
125
+ RELEASE_VERSION: ${{ needs.check-release.outputs.RELEASE_VERSION }}
126
+ steps:
127
+ - name: Login to Docker Hub
128
+ uses: docker/login-action@v3
106
129
  with:
107
- push: true
108
- tags: lonocloud/conlink:latest
130
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
131
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
132
+
133
+ - name: Set up Docker Buildx
134
+ uses: docker/setup-buildx-action@v3
135
+
136
+ - name: Create and push multi-arch manifests
137
+ run: |
138
+ docker buildx imagetools create \
139
+ -t lonocloud/conlink:${RELEASE_VERSION}-test \
140
+ lonocloud/conlink:${RELEASE_VERSION}-amd64 \
141
+ lonocloud/conlink:${RELEASE_VERSION}-arm64
142
+
143
+ docker buildx imagetools create \
144
+ -t lonocloud/conlink:latest \
145
+ lonocloud/conlink:latest-amd64 \
146
+ lonocloud/conlink:latest-arm64
147
+
package/Dockerfile CHANGED
@@ -27,26 +27,36 @@ RUN cd /app && \
27
27
  ###
28
28
  FROM rust:latest AS rust-build
29
29
 
30
- RUN rustup target add x86_64-unknown-linux-musl
30
+ # Buildx sets this automatically
31
+ ARG TARGETARCH
31
32
 
32
33
  # musl-tools for static linking
33
34
  RUN apt-get update && apt-get install -y musl-tools
34
35
 
36
+ # Pick the musl target based on the target arch
37
+ # amd64 -> x86_64-unknown-linux-musl
38
+ # arm64 -> aarch64-unknown-linux-musl
39
+ RUN case "${TARGETARCH}" in \
40
+ amd64) echo x86_64-unknown-linux-musl ;; \
41
+ arm64) echo aarch64-unknown-linux-musl ;; \
42
+ *) echo "unsupported TARGETARCH=${TARGETARCH}" >&2; exit 1 ;; \
43
+ esac > /tmp/target_triple
44
+
45
+ RUN rustup target add "$(cat /tmp/target_triple)"
46
+
35
47
  WORKDIR /app/
36
48
  RUN mkdir -p src
37
49
 
38
50
  # Download and compile deps for rebuild efficiency
39
- #COPY Cargo.toml Cargo.lock ./
40
51
  COPY rust/Cargo.toml ./
41
52
  RUN echo "fn main() {}" > src/echo.rs
42
- RUN cargo build --release --target x86_64-unknown-linux-musl --bin echo
43
- RUN rm src/echo.rs # 1
53
+ RUN cargo build --release --target "$(cat /tmp/target_triple)" --bin echo
54
+ RUN rm src/echo.rs
44
55
 
45
56
  # Build the main program
46
57
  COPY rust/src/* src/
47
- RUN cargo build --release --target x86_64-unknown-linux-musl
48
- RUN cd /app/target/x86_64-unknown-linux-musl/release/ && cp -v wait copy echo /app/
49
- # Located at: ./target/x86_64-unknown-linux-musl/release/
58
+ RUN cargo build --release --target "$(cat /tmp/target_triple)"
59
+ RUN cd "/app/target/$(cat /tmp/target_triple)/release/" && cp -v wait copy echo /app/
50
60
 
51
61
  ###
52
62
  ### conlink runtime stage
@@ -10,10 +10,10 @@ ln -sfn /var/lib/rancher/k3s/agent/etc/cni/net.d /etc/cni/net.d
10
10
 
11
11
  mkdir -p /var/lib/rancher/k3s/agent/etc/containerd/
12
12
  cat > /var/lib/rancher/k3s/agent/etc/containerd/config.toml.tmpl <<EOF
13
- [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
13
+ [plugins."io.containerd.cri.v1.runtime".containerd.runtimes.runc.options]
14
14
  SystemdCgroup = false
15
15
 
16
- [plugins."io.containerd.grpc.v1.cri".cni]
16
+ [plugins."io.containerd.cri.v1.runtime".cni]
17
17
  bin_dir = "/var/lib/rancher/k3s/data/cni"
18
18
  conf_dir = "/var/lib/rancher/k3s/agent/etc/cni/net.d"
19
19
  EOF
@@ -28,6 +28,12 @@ K3S_ARGS="${K3S_ARGS} --kubelet-arg=cgroup-root=/"
28
28
  K3S_ARGS="${K3S_ARGS} --kubelet-arg=runtime-cgroups=/systemd/system.slice"
29
29
  K3S_ARGS="${K3S_ARGS} --kubelet-arg=kubelet-cgroups=/systemd/system.slice"
30
30
 
31
+ if [ "${ROLE}" = "server" ]; then
32
+ # Use non-default k8s range in case our host is a k8s pod itself
33
+ # TODO: dynamically check and host ranges
34
+ K3S_ARGS="${K3S_ARGS} --cluster-cidr=10.128.0.0/16 --service-cidr=10.129.0.0/16"
35
+ fi
36
+
31
37
  echo exec k3s "${ROLE}" ${K3S_ARGS} "$@"
32
38
  exec k3s "${ROLE}" ${K3S_ARGS} "$@"
33
39
 
@@ -6,9 +6,9 @@ x-network:
6
6
  - { service: k3s-agent-1, bridge: k0, dev: eth1, ip: 10.200.0.2/24 }
7
7
  - { service: k3s-agent-2, bridge: k0, dev: eth1, ip: 10.200.0.3/24 }
8
8
  - { service: test-client, bridge: k0, dev: eth1, ip: 10.200.0.10/24,
9
- route: ["10.42.0.0/15 via 10.200.0.2 dev eth1"] }
9
+ route: ["10.128.0.0/15 via 10.200.0.2 dev eth1"] }
10
10
  - { service: test-server, bridge: k0, dev: eth1, ip: 10.200.0.11/24,
11
- route: ["10.42.0.0/15 via 10.200.0.2 dev eth1"] }
11
+ route: ["10.128.0.0/15 via 10.200.0.2 dev eth1"] }
12
12
 
13
13
  x-k3s-base: &k3s-base
14
14
  depends_on: {extract-utils: {condition: service_completed_successfully}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conlink",
3
- "version": "2.5.8",
3
+ "version": "2.6.1",
4
4
  "description": "conlink - Declarative Low-Level Networking for Containers",
5
5
  "repository": "https://github.com/Viasat/conlink",
6
6
  "license": "SEE LICENSE IN LICENSE",