Skip to content

Commit 33ede97

Browse files
committed
feat(dataplane): accept config from init
This commit makes the dataplane actually accept configuration from the memfd file created by dataplane-init. Signed-off-by: Daniel Noland <daniel@githedgehog.com>
1 parent d29af68 commit 33ede97

File tree

4 files changed

+48
-40
lines changed

4 files changed

+48
-40
lines changed

Cargo.lock

Lines changed: 36 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ ARG BASE
22
FROM $BASE AS dataplane
33
ARG ARTIFACT
44
ARG ARTIFACT_CLI
5-
COPY --link --chown=0:0 "${ARTIFACT}" /dataplane
6-
COPY --link --chown=0:0 "${ARTIFACT_CLI}" /dataplane-cli
5+
ARG ARTIFACT_INIT
6+
COPY --link --chown=0:0 "${ARTIFACT}" /bin/dataplane
7+
COPY --link --chown=0:0 "${ARTIFACT_INIT}" /bin/dataplane-init
8+
COPY --link --chown=0:0 "${ARTIFACT_CLI}" /bin/dataplane-cli
79
WORKDIR /
8-
ENTRYPOINT ["/dataplane"]
10+
ENTRYPOINT ["/bin/dataplane-init"]

dataplane/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ pipeline = { workspace = true }
3535
pkt-meta = { workspace = true }
3636
pyroscope = { workspace = true }
3737
pyroscope_pprofrs = { workspace = true }
38+
rkyv = { workspace = true, features = [] }
3839
routing = { workspace = true }
3940
rtnetlink = { workspace = true, features = ["default", "tokio"] }
4041
serde = { workspace = true, features = ["derive"] }

justfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,12 +403,13 @@ sh *args:
403403

404404
# Build containers in a sterile environment
405405
[script]
406-
build-container: (sterile "_network=none" "cargo" "--locked" "build" ("--profile=" + profile) ("--target=" + target) "--package=dataplane" "--package=dataplane-cli") && version
406+
build-container: (sterile "_network=none" "cargo" "--locked" "build" ("--profile=" + profile) ("--target=" + target) "--package=dataplane" "--package=dataplane-cli" "--package=dataplane-init") && version
407407
{{ _just_debuggable_ }}
408408
{{ _define_truncate128 }}
409409
mkdir -p "artifact/{{ target }}/{{ profile }}"
410410
cp -r "${CARGO_TARGET_DIR:-target}/{{ target }}/{{ profile }}/dataplane" "artifact/{{ target }}/{{ profile }}/dataplane"
411411
cp -r "${CARGO_TARGET_DIR:-target}/{{ target }}/{{ profile }}/cli" "artifact/{{ target }}/{{ profile }}/dataplane-cli"
412+
cp -r "${CARGO_TARGET_DIR:-target}/{{ target }}/{{ profile }}/dataplane-init" "artifact/{{ target }}/{{ profile }}/dataplane-init"
412413
declare build_date
413414
build_date="$(date --utc --iso-8601=date --date="{{ _build_time }}")"
414415
declare -r build_date
@@ -426,6 +427,7 @@ build-container: (sterile "_network=none" "cargo" "--locked" "build" ("--profile
426427
--tag "${TAG}" \
427428
--build-arg ARTIFACT="artifact/{{ target }}/{{ profile }}/dataplane" \
428429
--build-arg ARTIFACT_CLI="artifact/{{ target }}/{{ profile }}/dataplane-cli" \
430+
--build-arg ARTIFACT_INIT="artifact/{{ target }}/{{ profile }}/dataplane-init" \
429431
--build-arg BASE="{{ _dataplane_base_container }}" \
430432
.
431433

@@ -445,12 +447,13 @@ build-container: (sterile "_network=none" "cargo" "--locked" "build" ("--profile
445447

446448
# Build a container for local testing, without cache and extended base
447449
[script]
448-
build-container-quick: (compile-env "cargo" "--locked" "build" ("--target=" + target) "--package=dataplane" "--package=dataplane-cli")
450+
build-container-quick: (compile-env "cargo" "--locked" "build" ("--target=" + target) "--package=dataplane" "--package=dataplane-cli" "--package=dataplane-init")
449451
{{ _just_debuggable_ }}
450452
{{ _define_truncate128 }}
451453
mkdir -p "artifact/{{ target }}/{{ profile }}"
452454
cp -r "${CARGO_TARGET_DIR:-target}/{{ target }}/{{ profile }}/dataplane" "artifact/{{ target }}/{{ profile }}/dataplane"
453455
cp -r "${CARGO_TARGET_DIR:-target}/{{ target }}/{{ profile }}/cli" "artifact/{{ target }}/{{ profile }}/dataplane-cli"
456+
cp -r "${CARGO_TARGET_DIR:-target}/{{ target }}/{{ profile }}/dataplane-init" "artifact/{{ target }}/{{ profile }}/dataplane-init"
454457
declare build_date
455458
build_date="$(date --utc --iso-8601=date --date="{{ _build_time }}")"
456459
declare -r build_date
@@ -464,6 +467,7 @@ build-container-quick: (compile-env "cargo" "--locked" "build" ("--target=" + ta
464467
--tag "${TAG}" \
465468
--build-arg ARTIFACT="artifact/{{ target }}/{{ profile }}/dataplane" \
466469
--build-arg ARTIFACT_CLI="artifact/{{ target }}/{{ profile }}/dataplane-cli" \
470+
--build-arg ARTIFACT_INIT="artifact/{{ target }}/{{ profile }}/dataplane-init" \
467471
--build-arg BASE="{{ _debug_env_container }}" \
468472
.
469473

0 commit comments

Comments
 (0)