Skip to content

Commit fb0b55d

Browse files
Node Status API: remove sqlite support (#6004)
* ns-api: remove sqlite support ns-api: add env var to skip migrations for local dev ns-api: tidy up imports ns-api: fix deserialisation fo node descriptions update dockerfile update README fix up README and example env ns-api: bump major version to 4 ns-api: add more geoip data and new performance field in dvpn responses * ns-api: polyfill dVPN probe outcomes to make compatible with existing clients * Use explicit transaction for testrun status change (#6046) * Use explicit transaction for testrun status change * Improve run scripts * Skip locked rows * bump version 4.0.2 * Fix build.rs * Fix up .sqlx queries * Bump agent version and change dockerfile to run the agent in a loop * Make time between agents configurable by env var SLEEP_TIME * Update entrypoint.sh * Update Dockerfile with full path * Force bigint to avoid postgres numeric cast * Add override args to agent entry point, bump agent version and NS API version --------- Co-authored-by: Mark Sinclair <mmsinclair@users.noreply.github.com> Co-authored-by: dynco-nym <173912580+dynco-nym@users.noreply.github.com>
1 parent 1bb973e commit fb0b55d

File tree

82 files changed

+1838
-1485
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+1838
-1485
lines changed

.github/workflows/push-node-status-api.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,6 @@ jobs:
6969

7070
- name: BuildAndPushImageOnHarbor
7171
run: |
72-
docker build -f ${{ env.WORKING_DIRECTORY }}/Dockerfile-pg . -t harbor.nymte.ch/nym/${{ env.IMAGE_NAME_AND_TAGS }} -t harbor.nymte.ch/nym/${{ env.CONTAINER_NAME }}:latest
72+
docker build -f ${{ env.WORKING_DIRECTORY }}/Dockerfile . -t harbor.nymte.ch/nym/${{ env.IMAGE_NAME_AND_TAGS }} -t harbor.nymte.ch/nym/${{ env.CONTAINER_NAME }}:latest
7373
docker push harbor.nymte.ch/nym/${{ env.CONTAINER_NAME }} --all-tags
7474

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nym-node-status-api/nym-node-status-agent/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
[package]
55
name = "nym-node-status-agent"
6-
version = "1.0.4"
6+
version = "1.0.6"
77
authors.workspace = true
88
repository.workspace = true
99
homepage.workspace = true

nym-node-status-api/nym-node-status-agent/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ WORKDIR /nym
3636

3737
COPY --from=builder /usr/src/nym/target/release/nym-node-status-agent ./
3838
COPY --from=builder /usr/src/nym-vpn-client/nym-vpn-core/target/release/nym-gateway-probe ./
39+
COPY --from=builder /usr/src/nym/nym-node-status-api/nym-node-status-agent/entrypoint.sh ./
40+
RUN chmod +x /nym/entrypoint.sh
3941

42+
ENV SLEEP_TIME=5
4043
ENV NODE_STATUS_AGENT_PROBE_PATH=/nym/nym-gateway-probe
41-
ENTRYPOINT [ "/nym/nym-node-status-agent", "run-probe" ]
44+
ENTRYPOINT [ "/nym/entrypoint.sh" ]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Node Status Agent
2+
3+
An agent to run tests and report results back to the Node Status API.
4+
5+
Environment variables that can be set individually are:
6+
7+
- `NYM_NODE_MNEMONICS` - mnemonic to get tickets for tests
8+
- `NODE_STATUS_AGENT_SERVER_PORT` - Node Status API port
9+
- `NODE_STATUS_AGENT_SERVER_ADDRESS` - Node Status API address
10+
11+
Or use `NODE_STATUS_AGENT_ARGS` to pass your own arguments:
12+
13+
```
14+
NODE_STATUS_AGENT_ARGS="run-probe --server localhost:8000 --mnemonic foo bar baz"
15+
```
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
3+
echo "Starting agent loop with sleep interval: ${SLEEP_TIME}s"
4+
5+
# Trap SIGTERM to allow graceful shutdown
6+
trap "echo 'Stopping...'; exit 0" SIGTERM
7+
8+
DEFAULT_ARGS="run-probe --server \"${NODE_STATUS_AGENT_SERVER_ADDRESS}|${NODE_STATUS_AGENT_SERVER_PORT}\" --mnemonic \"${NYM_NODE_MNEMONICS}\""
9+
ARGS=${NODE_STATUS_AGENT_ARGS:-${DEFAULT_ARGS}}
10+
COMMAND="/nym/nym-node-status-agent ${ARGS}"
11+
12+
echo "default_args = '${DEFAULT_ARGS}'"
13+
echo "args = '${ARGS}'"
14+
echo "command = '${COMMAND}'"
15+
16+
# Run probe in an infinite loop
17+
while true; do
18+
eval $COMMAND
19+
sleep "$SLEEP_TIME"
20+
done

nym-node-status-api/nym-node-status-api/.env.example

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
# Example environment variables for nym-node-status-api
22

3-
# Database configuration
4-
# For SQLite:
5-
# DATABASE_URL=sqlite://nym-node-status-api.sqlite
6-
7-
# For PostgreSQL:
8-
# DATABASE_URL=postgres://testuser:testpass@localhost:5433/nym_node_status_api_test
3+
# Database configuration for PostgreSQL:
4+
DATABASE_URL=postgres://testuser:testpass@localhost:5433/nym_node_status_api_test
95

106
# Network configuration
117
NETWORK_NAME=sandbox

nym-node-status-api/nym-node-status-api/.sqlx/query-117f96b2d0cec62858d065e700589f87d7d469fd301e831a1952641ec9375580.json

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nym-node-status-api/nym-node-status-api/.sqlx/query-1327b5118f9144dddbcf8edb11f7dc549cf503409fd6dfedcdc02dbcd61d5454.json

Lines changed: 32 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nym-node-status-api/nym-node-status-api/.sqlx/query-13c7178d57f28e11b47bc96d43ad14acd3c400ed9452db7095fac2a44ece8576.json

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)