@colony2/cortex 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +38 -8
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -17,7 +17,7 @@ npm (Node.js 14 or newer and `tar` required):
17
17
  ```sh
18
18
  npm install -g @colony2/cortex
19
19
  cortex version
20
- cortex --jobdb-url http://127.0.0.1:9047 --working-dir /path/to/cell
20
+ cortex --jobdb http://127.0.0.1:9047/c2 --working-dir /path/to/cell
21
21
  ```
22
22
 
23
23
  The npm installer downloads the matching binary from
@@ -33,15 +33,45 @@ with a c2j cell configuration; see the
33
33
  | Option | Environment variable | Default |
34
34
  | --- | --- | --- |
35
35
  | `--addr` | `CORTEX_ADDR` | `:8080` |
36
- | `--jobdb-url` | `JOBDB_URL` | Required |
36
+ | `--jobdb` | `C2J_JOBDB` | `jobdb` from `.c2j/config.yaml` |
37
37
  | `--working-dir` | `CORTEX_WORKING_DIR` | Current directory |
38
- | `--tenant-id` | `CORTEX_TENANT_ID` | `1` |
39
38
  | `--cors-origins` | `CORTEX_CORS_ORIGINS` | Empty; comma-separated origins |
40
39
 
41
- Use `cortex --help` for command options and `cortex version` or `cortex --version`
42
- to identify the release. Source builds report `dev`.
40
+ Cortex uses Cobra, like c2j: long flags use `--` (`--jobdb`, `--addr`) and
41
+ short flags use `-` (`-h` for help). `cortex serve` explicitly starts the server;
42
+ `cortex` with the same flags is equivalent. Use `cortex version` or
43
+ `cortex --version` to identify the release. Source builds report `dev`.
43
44
 
44
- Select a tenant in the header, use `/?tenantId=42`, or open a tenant route such as
45
+ The JobDB URI includes the tenant, just like c2j:
46
+
47
+ ```sh
48
+ cortex serve --jobdb http://localhost:9047/c2
49
+ # Or share the same environment setting with c2j:
50
+ C2J_JOBDB=http://localhost:9047/c2 cortex
51
+ ```
52
+
53
+ Resolution follows `--jobdb`, then `C2J_JOBDB`, then the nearest ancestor
54
+ `.c2j/config.yaml`. Cortex calls c2j's `pkg/config.LoadProjectConfig` and
55
+ `ProjectConfig.JobDBURI` directly, including support for command-valued settings:
56
+
57
+ ```yaml
58
+ jobdb: http://localhost:9047/c2
59
+ # Alternatively:
60
+ # jobdb:
61
+ # command: your-command-that-prints-a-jobdb-uri
62
+ ```
63
+
64
+ Run `cortex` from that cell or a subdirectory, or select the discovery directory
65
+ with `--working-dir`. Cortex requires a remote HTTP(S) JobDB server; `embed:///`
66
+ is not supported.
67
+
68
+ For migration, `--jobdb-url` remains a deprecated alias accepting either the new
69
+ URI or a server-only URL with `--tenant-id`. Legacy `JOBDB_URL` is used only when
70
+ neither a connection flag nor `C2J_JOBDB` is set, before consulting the config.
71
+ `CORTEX_TENANT_ID` applies only to legacy server-only URLs (default `1`).
72
+
73
+ Opening the UI uses the tenant in your configured JobDB URI. To override it,
74
+ select a tenant in the header, use `/?tenantId=42`, or open a tenant route such as
45
75
  `/project/42/jobs`. The email screen records an identity cookie; it does not
46
76
  provide server-side authentication.
47
77
 
@@ -54,7 +84,7 @@ downloads enabled. The Go wrapper selects the version in [`.go-version`](.go-ver
54
84
  pnpm install --frozen-lockfile
55
85
  bash scripts/go.sh -C server mod download
56
86
  make build
57
- ./build/cortex --jobdb-url http://127.0.0.1:9047 --working-dir /path/to/cell
87
+ ./build/cortex --jobdb http://127.0.0.1:9047/c2 --working-dir /path/to/cell
58
88
  ```
59
89
 
60
90
  `make build` builds the web packages, copies their output into the Go embed
@@ -67,7 +97,7 @@ checkout is required.
67
97
  Start the API and web dev server in separate terminals:
68
98
 
69
99
  ```sh
70
- JOBDB_URL=http://127.0.0.1:9047 CORTEX_WORKING_DIR=/path/to/cell pnpm dev:api
100
+ C2J_JOBDB=http://127.0.0.1:9047/c2 CORTEX_WORKING_DIR=/path/to/cell pnpm dev:api
71
101
  pnpm dev:web
72
102
  ```
73
103
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colony2/cortex",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "Web interface for c2j recipe jobs",
5
5
  "license": "UNLICENSED",
6
6
  "homepage": "https://github.com/colony-2/cortex",