diff --git a/compose.yaml b/compose.yaml index d15b6ec3..1ffd5e30 100644 --- a/compose.yaml +++ b/compose.yaml @@ -36,6 +36,7 @@ services: networks: omics_portal_omics_network: aliases: ["thothii-core"] + localllm_default: {} frontend: build: @@ -53,3 +54,5 @@ services: networks: omics_portal_omics_network: external: true + localllm_default: + external: true diff --git a/scripts/test-qwen-network-config.sh b/scripts/test-qwen-network-config.sh new file mode 100755 index 00000000..1c42339d --- /dev/null +++ b/scripts/test-qwen-network-config.sh @@ -0,0 +1,24 @@ +#!/bin/sh +set -eu + +cd "$(dirname "$0")/.." +tmp=$(mktemp -d) +trap 'rm -rf "$tmp"' EXIT HUP INT TERM +mkdir -p "$tmp/deploy" +cp compose.yaml "$tmp/compose.yaml" +: >"$tmp/deploy/thothii.env" + +docker compose --project-directory "$tmp" config --format json >"$tmp/config.json" +node - "$tmp/config.json" <<'NODE' +const fs = require("fs"); +const config = JSON.parse(fs.readFileSync(process.argv[2], "utf8")); +if (!config.networks?.localllm_default?.external) { + throw new Error("localllm_default must be an external network"); +} +if (!config.services?.core?.networks?.localllm_default) { + throw new Error("core must join localllm_default"); +} +if (config.services?.frontend?.networks?.localllm_default) { + throw new Error("frontend must not join the model network"); +} +NODE