Skip to content

Commit 4584fe1

Browse files
author
User
committed
fix(setup): download vramhub-nautilus from VRAM-HUB releases; FROM scratch Dockerfile; SLCL_ env prefix
1 parent 317fbff commit 4584fe1

1 file changed

Lines changed: 22 additions & 22 deletions

File tree

setup.sh

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ ENCLAVE_CID="${ENCLAVE_CID:-16}"
3636
ENCLAVE_DEBUG="${ENCLAVE_DEBUG:-false}"
3737
SKIP_REGISTER="${SKIP_REGISTER:-false}"
3838
VRAM_REPO="${VRAM_REPO:-VRAM-AI/vram-validator}"
39+
VRAMHUB_REPO="VRAM-AI/VRAM-HUB"
3940
INSTALL_DIR=/opt/vram
4041
BUILD_DIR=/tmp/vram-setup
4142
RELEASE_URL="https://github.com/${VRAM_REPO}/releases/latest/download"
43+
VRAMHUB_RELEASE_URL="https://github.com/${VRAMHUB_REPO}/releases/latest/download"
4244
RAW_URL="https://raw.githubusercontent.com/${VRAM_REPO}/main"
4345

4446
# ─── Output helpers ──────────────────────────────────────────────────────────
@@ -340,20 +342,18 @@ else
340342
warn "Pre-built EIF not available in release — building from binary"
341343
rm -f "$EIF_PATH" 2>/dev/null || true
342344

343-
# Download the nautilus binary
344-
curl -fsSL --retry 3 -o "$BUILD_DIR/slcl-nautilus" \
345-
"${RELEASE_URL}/slcl-nautilus-linux-x86_64" || \
346-
fatal "Could not download slcl-nautilus binary from ${RELEASE_URL}"
347-
chmod +x "$BUILD_DIR/slcl-nautilus"
348-
ok "Downloaded slcl-nautilus binary"
345+
# Download the nautilus binary (static musl — from VRAM-HUB releases)
346+
curl -fsSL --retry 3 -o "$BUILD_DIR/vramhub-nautilus" \
347+
"${VRAMHUB_RELEASE_URL}/vramhub-nautilus-linux-x86_64" || \
348+
fatal "Could not download vramhub-nautilus binary from ${VRAMHUB_RELEASE_URL}"
349+
chmod +x "$BUILD_DIR/vramhub-nautilus"
350+
ok "Downloaded vramhub-nautilus binary"
349351

350-
# Dockerfile: FROM alpine keeps EIF small; ttyS0 ensures console output
352+
# Dockerfile: FROM scratch — binary is static musl, no libc needed
351353
cat > "$BUILD_DIR/Dockerfile" <<'DEOF'
352-
FROM alpine:3.19
353-
RUN apk add --no-cache ca-certificates
354-
COPY slcl-nautilus /app/slcl-nautilus
355-
ENV PORT=3000
356-
ENTRYPOINT ["/bin/sh", "-c", "exec /app/slcl-nautilus 2>/dev/ttyS0"]
354+
FROM scratch
355+
COPY vramhub-nautilus /vramhub-nautilus
356+
CMD ["/vramhub-nautilus"]
357357
DEOF
358358

359359
# Check nitro-cli blobs
@@ -375,11 +375,11 @@ DEOF
375375
[[ -f /etc/nitro_enclaves/nitro_enclaves.conf ]] || \
376376
echo "blobs_path=${BLOBS_DIR}" > /etc/nitro_enclaves/nitro_enclaves.conf
377377

378-
docker build -t slcl-nautilus:latest "$BUILD_DIR/" 2>&1 | grep -v '^#' | tail -5
378+
docker build -t vramhub-nautilus:latest "$BUILD_DIR/" 2>&1 | grep -v '^#' | tail -5
379379
ok "Docker image built"
380380

381381
nitro-cli build-enclave \
382-
--docker-uri slcl-nautilus:latest \
382+
--docker-uri vramhub-nautilus:latest \
383383
--output-file "$EIF_PATH" > "$BUILD_OUT" 2>&1 || {
384384
cat "$BUILD_OUT" >&2
385385
fatal "EIF build failed — see above"
@@ -580,14 +580,14 @@ if [[ ! -f "$ENV_FILE" ]]; then
580580
ok "Downloaded .env.example → ${ENV_FILE}"
581581
fi
582582

583-
# Flip to production mode
584-
sed -i 's/^VRAMHUB_TEST_MODE=true/VRAMHUB_TEST_MODE=false/' "$ENV_FILE"
585-
sed -i 's/^VRAMHUB_NITRO_ENCLAVE=false/VRAMHUB_NITRO_ENCLAVE=true/' "$ENV_FILE"
586-
grep -q 'VRAMHUB_ENCLAVE_URL' "$ENV_FILE" || \
587-
echo 'VRAMHUB_ENCLAVE_URL=http://localhost:3000' >> "$ENV_FILE"
588-
grep -q 'VRAMHUB_NAUTILUS_URL' "$ENV_FILE" && \
589-
sed -i 's|^VRAMHUB_NAUTILUS_URL=.*|VRAMHUB_NAUTILUS_URL=http://localhost:3000|' "$ENV_FILE" || \
590-
echo 'VRAMHUB_NAUTILUS_URL=http://localhost:3000' >> "$ENV_FILE"
583+
# Flip to production mode (binary reads SLCL_ prefix)
584+
sed -i 's/^SLCL_TEST_MODE=true/SLCL_TEST_MODE=false/' "$ENV_FILE"
585+
sed -i 's/^SLCL_NITRO_ENCLAVE=false/SLCL_NITRO_ENCLAVE=true/' "$ENV_FILE"
586+
grep -q 'SLCL_ENCLAVE_URL' "$ENV_FILE" || \
587+
echo 'SLCL_ENCLAVE_URL=http://localhost:3000' >> "$ENV_FILE"
588+
grep -q 'SLCL_NAUTILUS_URL' "$ENV_FILE" && \
589+
sed -i 's|^SLCL_NAUTILUS_URL=.*|SLCL_NAUTILUS_URL=http://localhost:3000|' "$ENV_FILE" || \
590+
echo 'SLCL_NAUTILUS_URL=http://localhost:3000' >> "$ENV_FILE"
591591

592592
# Check for wallet mnemonic
593593
_MNEMONIC=$(grep -E '^VRAMHUB_WALLET_MNEMONIC=' "$ENV_FILE" | \

0 commit comments

Comments
 (0)