Skip to content

Commit 50994bf

Browse files
committed
add worker manager start script for matrix
1 parent e0a83a9 commit 50994bf

6 files changed

+28
-5
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ Instead of running `pnpm start:base`, you can alternatively use `pnpm start:all`
8585
| :4210 | Development Worker Manager (spins up 1 worker by default) || 🚫 |
8686
| :4211 | Test Worker Manager (spins up 1 worker by default) || 🚫 |
8787
| :4212 | Test Worker Manager for matrix client tests (playwright controlled - 1 worker) || 🚫 |
88+
| :4213 | Test Worker Manager for matrix client tests - base realm server (playwright controlled - 1 worker) || 🚫 |
8889
| :5001 | Mail user interface for viewing emails sent to local SMTP || 🚫 |
8990
| :5435 | Postgres DB || 🚫 |
9091
| :8008 | Matrix synapse server || 🚫 |

packages/realm-server/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,15 @@
8686
"setup:seed-in-deployment": "mkdir -p /persistent/seed && rsync --dry-run --itemize-changes --size-only --recursive --delete ../seed-realm/. /persistent/seed/ && rsync --size-only --recursive --delete ../seed-realm/. /persistent/seed/",
8787
"setup:catalog-in-deployment": "mkdir -p /persistent/catalog && rsync --dry-run --itemize-changes --size-only --recursive --delete ../catalog-realm/. /persistent/catalog/ && rsync --size-only --recursive --delete ../catalog-realm/. /persistent/catalog/",
8888
"start": "PGPORT=5435 NODE_NO_WARNINGS=1 ts-node --transpileOnly main",
89-
"start:base": "./scripts/start-base.sh",
89+
"start:base": "./scripts/start-base.sh --workerManagerPort=4213",
9090
"start:test-realms": "./scripts/start-test-realms.sh --workerManagerPort=4211",
9191
"start:all": "./scripts/start-all.sh",
9292
"start:without-matrix": "./scripts/start-without-matrix.sh",
9393
"start:staging": "./scripts/start-staging.sh",
9494
"start:development": "./scripts/start-development.sh --workerManagerPort=4210",
9595
"start:production": "./scripts/start-production.sh",
9696
"start:worker-development": "./scripts/start-worker-development.sh",
97+
"start:worker-base": "./scripts/start-worker-base.sh",
9798
"start:worker-test": "./scripts/start-worker-test.sh",
9899
"start:worker-staging": "./scripts/start-worker-staging.sh",
99100
"start:worker-production": "./scripts/start-worker-production.sh",

packages/realm-server/scripts/start-base.sh

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ NODE_ENV=development \
2222
--matrixURL='http://localhost:8008' \
2323
--realmsRootPath='./realms/localhost_4201' \
2424
--migrateDB \
25+
$1 \
2526
\
2627
--path='../base' \
2728
--username='base_realm' \
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#! /bin/sh
22
NODE_NO_WARNINGS=1 start-server-and-test \
3-
'run-p start:pg start:base' \
3+
'run-p start:pg start:worker-base start:base' \
44
'http-get://localhost:4201/base/_readiness-check?acceptHeader=application%2Fvnd.api%2Bjson' \
5-
'run-p start:test-realms' \
5+
'run-p start:worker-test start:test-realms' \
66
'http-get://localhost:4202/test/_readiness-check?acceptHeader=application%2Fvnd.api%2Bjson|http-get://localhost:4202/node-test/_readiness-check?acceptHeader=application%2Fvnd.api%2Bjson' \
77
'wait'
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#! /bin/sh
22
NODE_NO_WARNINGS=1 start-server-and-test \
3-
'run-p start:pg start:development' \
3+
'run-p start:pg start:worker-development start:development' \
44
'http-get://localhost:4201/base/_readiness-check?acceptHeader=application%2Fvnd.api%2Bjson|http-get://localhost:4201/experiments/_readiness-check?acceptHeader=application%2Fvnd.api%2Bjson' \
5-
'run-p start:test-realms' \
5+
'run-p start:worker-test start:test-realms' \
66
'http-get://localhost:4202/node-test/_readiness-check?acceptHeader=application%2Fvnd.api%2Bjson' \
77
'wait'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#! /bin/sh
2+
SCRIPTS_DIR="$(cd "$(dirname "$0")" && pwd)"
3+
. "$SCRIPTS_DIR/wait-for-pg.sh"
4+
5+
wait_for_postgres
6+
7+
NODE_ENV=development \
8+
NODE_NO_WARNINGS=1 \
9+
PGPORT=5435 \
10+
PGDATABASE=boxel_base \
11+
REALM_SECRET_SEED="shhh! it's a secret" \
12+
ts-node \
13+
--transpileOnly worker-manager \
14+
--count="${WORKER_COUNT:-1}" \
15+
--port=4213 \
16+
--matrixURL='http://localhost:8008' \
17+
--distURL="${HOST_URL:-http://localhost:4200}" \
18+
\
19+
--fromUrl='https://cardstack.com/base/' \
20+
--toUrl='http://localhost:4201/base/'

0 commit comments

Comments
 (0)