conlink 2.5.8 → 2.6.0

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.
@@ -89,20 +89,25 @@ jobs:
89
89
  uses: actions/checkout@v4
90
90
  with: { submodules: 'recursive', fetch-depth: 0 }
91
91
 
92
+ # For multi-platform build
93
+ - name: Set up QEMU
94
+ uses: docker/setup-qemu-action@v3
95
+
96
+ - name: Set up Docker Buildx
97
+ uses: docker/setup-buildx-action@v3
98
+
92
99
  - name: Login to Docker Hub
93
100
  uses: docker/login-action@v3
94
101
  with:
95
102
  username: ${{ secrets.DOCKERHUB_USERNAME }}
96
103
  password: ${{ secrets.DOCKERHUB_TOKEN }}
97
104
 
98
- - name: Build and push
105
+ - name: Build and push (multi-arch)
99
106
  uses: docker/build-push-action@v6
100
107
  with:
101
108
  push: true
102
- tags: lonocloud/conlink:${{ env.RELEASE_VERSION }}
109
+ platforms: linux/amd64,linux/arm64
110
+ tags: |
111
+ lonocloud/conlink:${{ env.RELEASE_VERSION }}
112
+ lonocloud/conlink:latest
103
113
 
104
- - name: Build and push
105
- uses: docker/build-push-action@v6
106
- with:
107
- push: true
108
- tags: lonocloud/conlink:latest
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.0",
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",