Skip to content

Commit 1cc0187

Browse files
committed
bob-l2: more fixes
1 parent d7c2c43 commit 1cc0187

File tree

5 files changed

+18
-14
lines changed

5 files changed

+18
-14
lines changed

bob-common/mkosi.extra/usr/bin/init-container.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,12 @@ su -s /bin/sh searcher -c "cd ~ && podman run -d \
2121
--name $NAME --replace \
2222
--init \
2323
-p ${SEARCHER_SSH_PORT}:22 \
24-
-p ${ENGINE_API_PORT}:${ENGINE_API_PORT} \
2524
-p ${EL_P2P_PORT}:${EL_P2P_PORT} \
2625
-p ${EL_P2P_PORT}:${EL_P2P_PORT}/udp \
2726
-p ${SEARCHER_INPUT_CHANNEL}:${SEARCHER_INPUT_CHANNEL}/udp \
2827
-v /persistent/searcher:/persistent:rw \
2928
-v /etc/searcher/ssh_hostkey:/etc/searcher/ssh_hostkey:rw \
3029
-v /persistent/searcher_logs:/var/log/searcher:rw \
31-
-v /persistent/lighthouse_logs:/var/log/lighthouse:ro \
32-
-v /tmp/jwt.hex:/secrets/jwt.hex:ro \
3330
-v /etc/searcher-logrotate.conf:/tmp/searcher.conf:ro \
3431
$BOB_SEARCHER_EXTRA_PODMAN_FLAGS \
3532
docker.io/library/ubuntu:24.04 \

bob-l1/mkosi.extra/etc/bob/searcher-container-before-init

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
ENGINE_API_PORT=8551
55

6-
BOB_SEARCHER_EXTRA_PODMAN_FLAGS="
6+
BOB_SEARCHER_EXTRA_PODMAN_FLAGS="\
77
-p ${ENGINE_API_PORT}:${ENGINE_API_PORT} \
88
-v /persistent/lighthouse_logs:/var/log/lighthouse:ro \
9-
-v /tmp/jwt.hex:/secrets/jwt.hex:ro
9+
-v /tmp/jwt.hex:/secrets/jwt.hex:ro \
1010
"

bob-l2/mkosi.extra/etc/bob/searcher-container-after-init

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,3 @@ exec_in_container "
66
$METADATA_BOB_L2_TX_STREAM_IP tx-stream.internal
77
$METADATA_BOB_L2_BACKRUNS_IP backruns.internal
88
EOF"
9-
10-
# Copy metadata into the container for transparency
11-
#
12-
# This might be implemented as bind read-only mount in the future,
13-
# but customizing container startup per bob-l2 is too complex for now
14-
cat /etc/metadata.env | exec_in_container "cat > /etc/metadata.env"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# This script is sourced from init-container.sh and contains image-specific stuff
2+
# See also: bob-common/mkosi.extra/usr/bin/init-container.sh
3+
4+
ENGINE_API_PORT=8651
5+
6+
BOB_SEARCHER_EXTRA_PODMAN_FLAGS="\
7+
-p ${ENGINE_API_PORT}:${ENGINE_API_PORT} \
8+
-v /etc/metadata.env:/etc/metadata.env:ro \
9+
"

bob-l2/mkosi.extra/usr/bin/fetch-metadata.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@ if dmidecode -s system-manufacturer 2>/dev/null | grep -q "QEMU"; then
1212
echo "Running in local QEMU, using hardcoded metadata values"
1313

1414
cat <<EOF >> /etc/metadata.env
15-
BOB_L2_BACKRUNS_IP='1.1.1.1'
16-
BOB_L2_TX_STREAM_IP='1.0.0.1'
17-
BOB_L2_OP_NODE_CIDR='10.0.0.0/8'
15+
METADATA_BOB_L2_BACKRUNS_IP='1.1.1.1'
16+
METADATA_BOB_L2_TX_STREAM_IP='1.0.0.1'
17+
METADATA_BOB_L2_OP_NODE_CIDR='10.0.0.0/8'
1818
EOF
1919

20+
# Ideally, this logic should be somewhere else, but it's fine for now
21+
chattr -i /etc/resolv.conf || true
22+
echo "nameserver 1.1.1.1" > /etc/resolv.conf
23+
2024
exit 0
2125
fi
2226

0 commit comments

Comments
 (0)