Repository navigation
feat(compose): connect entrances to the routed venue lab - #16
Conversation
|
Mateo Rossi · reviewer In lab mode the bridge controls the 实验环境模式下,bridge 控制的是 |
|
Yuki Tanaka · author Yes. The overlay sets 变了。覆盖文件设置了 |
|
Ingrid Larsen · reviewer The first version of the overlay had 覆盖文件最初的版本带着 |
|
Yuki Tanaka · author Removed in this branch. The bridge entrypoint reads the socket's group inside the container, the same as in the standalone entrance. 已经在这个分支里删掉了。bridge 的入口脚本会在容器内读取 socket 的组,和独立入口的做法一样。 |
Why
The standalone entrance has its own flat networks. Venue network testing happens in Gatepost's routed lab, and the simulator should be able to attach its bridge to that lab's gates instead of building its own.
What changed
compose.lab.yaml, an overlay for Gatepost'slab/compose.yaml: the bridge (published on loopback, Docker socket mounted,COMPOSE_PROJECT_NAME=gatepost-venue,GATE_SERVICES=gate1,gate2,VENUE_NETWORK=gatepost-venue_gates) andgate1/gate2pointed at the simulator withGATEPOST_SCANNERandGATEPOST_OUTPUTS, all on adevicesnetwork.LAB_GATE_IMAGEselects the gate image (defaultgatepost-build:local). The overlay relies on the bridge entrypoint for the socket group, so it has nogroup_add.scripts/venue.sh --mode lab: uses the projectgatepost-venue, skips thegatedbuild, and runs Compose with<gatepost>/lab/compose.yamlpluscompose.lab.yamlforup,statusanddown.--ref main, the requirement for a Gatepost revision withlab/compose.yamland simulator backends, andLAB_GATE_IMAGE.How to verify
With Docker and a Gatepost checkout whose
mainhaslab/compose.yaml:The page at http://127.0.0.1:28080 should show Gate 1 and Gate 2.
背景
独立入口用的是自己的扁平网络,而场馆网络测试在 Gatepost 的路由实验环境里进行。模拟器应能把 bridge 接到实验环境里的闸机上,而不是另外搭一套。
改动
compose.lab.yaml,作为 Gatepostlab/compose.yaml的覆盖文件:bridge 只发布到回环地址、挂载 Docker socket,并设置COMPOSE_PROJECT_NAME=gatepost-venue、GATE_SERVICES=gate1,gate2、VENUE_NETWORK=gatepost-venue_gates;gate1、gate2通过GATEPOST_SCANNER和GATEPOST_OUTPUTS指向模拟器;它们都接入devices网络。LAB_GATE_IMAGE指定闸机镜像(默认gatepost-build:local)。socket 所属的组由 bridge 的入口脚本处理,所以覆盖文件里没有group_add。scripts/venue.sh --mode lab:使用项目名gatepost-venue,不构建gated,在up、status、down时以<gatepost>/lab/compose.yaml加compose.lab.yaml运行 Compose。--ref main启动和停止实验环境模式,需要包含lab/compose.yaml和模拟设备后端的 Gatepost 版本,以及LAB_GATE_IMAGE的用法。怎么验证
安装 Docker,并准备
main分支含有lab/compose.yaml的 Gatepost 检出:http://127.0.0.1:28080 的页面上应出现 Gate 1 和 Gate 2。