Skip to content

Commit

Permalink
clean up control services
Browse files Browse the repository at this point in the history
  • Loading branch information
egasimus committed Nov 22, 2024
1 parent e071222 commit 4f6d6d9
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 172 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ RUN sed -i.bak "s#^laddr = \"tcp://127.0.0.1:26657\"#laddr = \"tcp://0.0.0.0:266
# Install control script
ADD deno.json deno.lock deps.js /
RUN deno cache --import-map=/deno.json --lock=/deno.lock deps.js
ADD lib.js services.js control.js control_status.js control_in.js control_node.js control_out.js control_out_proxy.js /
ADD lib.js services.js status.js rpc_proxy.js control_node.js sync_proxy.js /
ENTRYPOINT [ "/bin/bash" ]
CMD [ "-c", "/control.js" ]
2 changes: 1 addition & 1 deletion Dockerfile.parameterized
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ RUN sed -i.bak "s#^persistent_peers *=.*#persistent_peers = \"$PEERS\"#" $CONFIG
# Install control script
ADD deno.json deno.lock deps.js /
RUN deno cache --import-map=/deno.json --lock=/deno.lock deps.js
ADD lib.js services.js control.js control_status.js control_in.js control_node.js control_out.js control_out_proxy.js /
ADD lib.js services.js status.js rpc_proxy.js control_node.js sync_proxy.js /
ENTRYPOINT [ "/bin/bash" ]
CMD [ "-c", "/control.js" ]
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,37 @@ available during sync (see [`anoma/namada#3810`](https://github.com/anoma/namada
<td><code>control_node.js</code></td>
<td>⚠️ <b>Internal only</b></td>
<td>No</td>
<td>Manages the Namada node. <b>MUST run in isolated network (no Internet access except through <code>node-in</code> and <code>node-out</code>).</b>
Parses node log; when epoch increments, <code>node</code> messages <code>node-out</code>
<td>Manages the Namada node. <b>MUST run in isolated network (no Internet access except through <code>rpc-proxy</code> and <code>sync-proxy</code>).</b>
Parses node log; when epoch increments, <code>node</code> messages <code>sync-proxy</code>
to pause the sync.</td>
</tr>
<tr>
<td><code>node-in</code></td>
<td><code>control_in.js</code></td>
<td><code>rpc-proxy</code></td>
<td><code>rpc_proxy.js</code></td>
<td>Internal, External</td>
<td>⚠️ <b>Yes</b></td>
<td>Allows connections from indexer to node.</td>
</tr>
<tr>
<td><code>node-out</code></td>
<td><code>control_out.js</code></td>
<td><code>sync-proxy</code></td>
<td><code>sync_proxy.js</code></td>
<td>Internal, External</td>
<td>⚠️ <b>Yes</b></td>
<td>Allows connections from node to peers. By pausing the contained proxy,
node sync is paused, so that the indexer can catch up.</td>
</tr>
<tr>
<td><code>node-status</code></td>
<td><code>control_status.js</code></td>
<td><code>status.js</code></td>
<td>Internal, External</td>
<td>No</td>
<td>Manages the other three. When indexing has caught up, Undexer tells <code>node-status</code>
to resume sync, and <code>node-status</code> tells <code>node-out</code> to restart the proxy.</td>
to resume sync, and <code>node-status</code> tells <code>sync-proxy</code> to restart the proxy.</td>
</tr>
</tbody>
</table>

Note that `node-in` and `node-out` require an init process in the container
Note that `rpc-proxy` and `sync-proxy` require an init process in the container
(`docker run --init`, or `init: true` in `docker-compose.yml`) so that Docker
is able to reap the zombie processes that are created when the internal
`simpleproxy` is killed by the managing script.
Expand Down Expand Up @@ -91,9 +91,9 @@ services:
image: ghcr.io/hackbg/undexer:v4
restart: unless-stopped
depends_on: { postgres: { condition: service_healthy } }
environment: { RPC_URL: "http://node-in:26657" }
node-in:
entrypoint: /control_in.js
environment: { RPC_URL: "http://rpc-proxy:26657" }
rpc-proxy:
entrypoint: /rpc_proxy.js
networks: [ external, internal ]
image: ghcr.io/hackbg/namada-for-undexer:main
init: true
Expand All @@ -103,8 +103,8 @@ services:
networks: [ internal ]
image: ghcr.io/hackbg/namada-for-undexer:main
restart: unless-stopped
node-out:
entrypoint: /control_out.js
sync-proxy:
entrypoint: /sync_proxy.js
networks: [ external, internal ]
image: ghcr.io/hackbg/namada-for-undexer:main
init: true
Expand Down
92 changes: 0 additions & 92 deletions control.js

This file was deleted.

28 changes: 0 additions & 28 deletions control_out.js

This file was deleted.

36 changes: 0 additions & 36 deletions control_out_multi.js

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 4f6d6d9

Please sign in to comment.