@bizone-ai/cli 0.1.4 → 0.1.6
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.
- package/README.md +7 -1
- package/bin/bizone.js +1 -1
- package/package.json +1 -1
- package/src/cli.js +90 -57
- package/src/colors.js +4 -4
- package/src/commands/configuration.js +16 -14
- package/src/commands/database.js +23 -13
- package/src/commands/environment.js +31 -19
- package/src/commands/images.js +22 -14
- package/src/commands/resources.js +16 -14
- package/src/commands/start.js +48 -34
- package/src/commands/stop.js +15 -9
- package/src/config.js +13 -13
- package/src/containers/_commons.js +15 -15
- package/src/containers/cloud-tools.js +22 -22
- package/src/containers/mysql.js +17 -17
- package/src/containers/orchestrator.js +28 -28
- package/src/containers/resource-manager.js +20 -20
- package/src/containers/resources-job.js +7 -7
- package/src/containers/state-store.js +22 -22
- package/src/containers/ui.js +14 -14
- package/src/defaults.js +32 -24
- package/src/docker.js +112 -53
- package/src/http.js +21 -11
- package/src/resources-loader.js +6 -6
|
@@ -1,36 +1,38 @@
|
|
|
1
1
|
// `bizone resources|res|r get|set|remove`
|
|
2
2
|
|
|
3
|
-
import { existsSync } from
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
4
|
|
|
5
|
-
import { loadConfig, saveConfig } from
|
|
6
|
-
import { resolveResourcePath } from
|
|
7
|
-
import { color, log } from
|
|
5
|
+
import { loadConfig, saveConfig } from "../config.js";
|
|
6
|
+
import { resolveResourcePath } from "../resources-loader.js";
|
|
7
|
+
import { color, log } from "../colors.js";
|
|
8
8
|
|
|
9
9
|
export function resources(args) {
|
|
10
10
|
const [sub, namespace, ...rest] = args;
|
|
11
11
|
const cfg = loadConfig();
|
|
12
12
|
|
|
13
13
|
switch (sub) {
|
|
14
|
-
case
|
|
15
|
-
log.plain(color.bold(
|
|
14
|
+
case "get": {
|
|
15
|
+
log.plain(color.bold("Resource sources:"));
|
|
16
16
|
const entries = Object.entries(cfg.resources);
|
|
17
17
|
if (entries.length === 0) {
|
|
18
|
-
log.plain(color.dim(
|
|
18
|
+
log.plain(color.dim(" (none set)"));
|
|
19
19
|
return 0;
|
|
20
20
|
}
|
|
21
21
|
for (const [ns, p] of entries) {
|
|
22
22
|
const exists = existsSync(resolveResourcePath(p));
|
|
23
|
-
const tag = exists ?
|
|
23
|
+
const tag = exists ? "" : color.red(" (path not found)");
|
|
24
24
|
log.plain(` ${color.cyan(ns)} -> ${p}${tag}`);
|
|
25
25
|
}
|
|
26
26
|
return 0;
|
|
27
27
|
}
|
|
28
|
-
case
|
|
28
|
+
case "set": {
|
|
29
29
|
if (!namespace || rest.length === 0) {
|
|
30
|
-
log.err(
|
|
30
|
+
log.err(
|
|
31
|
+
"Usage: bizone resources set {namespace} {folder_or_file_path}",
|
|
32
|
+
);
|
|
31
33
|
return 1;
|
|
32
34
|
}
|
|
33
|
-
const path = rest.join(
|
|
35
|
+
const path = rest.join(" ");
|
|
34
36
|
if (!existsSync(resolveResourcePath(path))) {
|
|
35
37
|
log.warn(`Path "${path}" does not currently exist; storing anyway.`);
|
|
36
38
|
}
|
|
@@ -39,9 +41,9 @@ export function resources(args) {
|
|
|
39
41
|
log.ok(`Set resource namespace ${color.cyan(namespace)} -> ${path}`);
|
|
40
42
|
return 0;
|
|
41
43
|
}
|
|
42
|
-
case
|
|
44
|
+
case "remove": {
|
|
43
45
|
if (!namespace) {
|
|
44
|
-
log.err(
|
|
46
|
+
log.err("Usage: bizone resources remove {namespace}");
|
|
45
47
|
return 1;
|
|
46
48
|
}
|
|
47
49
|
if (Object.prototype.hasOwnProperty.call(cfg.resources, namespace)) {
|
|
@@ -54,7 +56,7 @@ export function resources(args) {
|
|
|
54
56
|
return 0;
|
|
55
57
|
}
|
|
56
58
|
default:
|
|
57
|
-
log.err(
|
|
59
|
+
log.err("Usage: bizone resources <get|set|remove> ...");
|
|
58
60
|
return 1;
|
|
59
61
|
}
|
|
60
62
|
}
|
package/src/commands/start.js
CHANGED
|
@@ -8,12 +8,8 @@ import {
|
|
|
8
8
|
getNumber,
|
|
9
9
|
loadContainers,
|
|
10
10
|
saveContainers,
|
|
11
|
-
} from
|
|
12
|
-
import {
|
|
13
|
-
CONTAINERS,
|
|
14
|
-
AWS_ENV_VARS,
|
|
15
|
-
defaultEnvFor,
|
|
16
|
-
} from '../defaults.js';
|
|
11
|
+
} from "../config.js";
|
|
12
|
+
import { CONTAINERS, AWS_ENV_VARS, defaultEnvFor } from "../defaults.js";
|
|
17
13
|
import {
|
|
18
14
|
dockerAvailable,
|
|
19
15
|
ensureNetwork,
|
|
@@ -23,10 +19,10 @@ import {
|
|
|
23
19
|
removeIfExists,
|
|
24
20
|
mysqlReady,
|
|
25
21
|
isContainerRunning,
|
|
26
|
-
} from
|
|
27
|
-
import { waitForReady, importNamespace } from
|
|
28
|
-
import { loadItems } from
|
|
29
|
-
import { color, log } from
|
|
22
|
+
} from "../docker.js";
|
|
23
|
+
import { waitForReady, importNamespace } from "../http.js";
|
|
24
|
+
import { loadItems } from "../resources-loader.js";
|
|
25
|
+
import { color, log } from "../colors.js";
|
|
30
26
|
|
|
31
27
|
function imageFor(cfg, type) {
|
|
32
28
|
return cfg.images[type] || CONTAINERS[type].image;
|
|
@@ -50,26 +46,36 @@ function isEnabled(cfg, service) {
|
|
|
50
46
|
|
|
51
47
|
export async function start() {
|
|
52
48
|
const cfg = loadConfig();
|
|
53
|
-
const timeoutSec = getNumber(cfg,
|
|
49
|
+
const timeoutSec = getNumber(cfg, "timeout_sec");
|
|
54
50
|
|
|
55
51
|
if (!dockerAvailable()) {
|
|
56
|
-
log.err(
|
|
52
|
+
log.err(
|
|
53
|
+
"Docker does not appear to be running or installed. Start Docker and retry.",
|
|
54
|
+
);
|
|
57
55
|
return 1;
|
|
58
56
|
}
|
|
59
57
|
|
|
60
|
-
log.plain(color.bold(
|
|
58
|
+
log.plain(color.bold("Starting Bizone platform..."));
|
|
61
59
|
|
|
62
60
|
// 1. Shared network.
|
|
63
|
-
const network = getConfigValue(cfg,
|
|
64
|
-
log.step(
|
|
61
|
+
const network = getConfigValue(cfg, "network_name");
|
|
62
|
+
log.step("Ensuring docker network");
|
|
65
63
|
const created = ensureNetwork(network);
|
|
66
64
|
log.ok(created ? `Created network ${network}` : `Network ${network} ready`);
|
|
67
65
|
|
|
68
66
|
const containers = loadContainers();
|
|
69
67
|
|
|
68
|
+
const awsProfile = getConfigValue(cfg, "aws_profile");
|
|
70
69
|
const imageHooks = {
|
|
71
|
-
onBeforePull: (image) =>
|
|
72
|
-
|
|
70
|
+
onBeforePull: (image) =>
|
|
71
|
+
log.step(`Pulling image ${image} (this may take a while)...`),
|
|
72
|
+
onBeforeLogin: (registry) =>
|
|
73
|
+
log.step(
|
|
74
|
+
`Authenticating to AWS ECR for ${registry}` +
|
|
75
|
+
(awsProfile ? ` (profile ${awsProfile})` : "") +
|
|
76
|
+
"...",
|
|
77
|
+
),
|
|
78
|
+
awsProfile,
|
|
73
79
|
};
|
|
74
80
|
|
|
75
81
|
// Helper to start one service detached and record its id.
|
|
@@ -105,7 +111,9 @@ export async function start() {
|
|
|
105
111
|
if (mysqlReady(containerName)) return true;
|
|
106
112
|
await sleep(1500);
|
|
107
113
|
}
|
|
108
|
-
throw new Error(
|
|
114
|
+
throw new Error(
|
|
115
|
+
`Timed out waiting for ${containerName} (MySQL) to be ready (${timeoutSec}s)`,
|
|
116
|
+
);
|
|
109
117
|
};
|
|
110
118
|
|
|
111
119
|
try {
|
|
@@ -115,24 +123,26 @@ export async function start() {
|
|
|
115
123
|
if (isContainerRunning(mysql.containerName)) {
|
|
116
124
|
log.ok(`${mysql.containerName} already running`);
|
|
117
125
|
} else {
|
|
118
|
-
log.step(
|
|
126
|
+
log.step(
|
|
127
|
+
`Starting ${mysql.containerName} (port ${hostPort(cfg, mysql)})`,
|
|
128
|
+
);
|
|
119
129
|
startService(mysql);
|
|
120
130
|
}
|
|
121
|
-
log.step(
|
|
131
|
+
log.step("Waiting for MySQL to be ready...");
|
|
122
132
|
await waitForMysql(mysql.containerName);
|
|
123
|
-
log.ok(
|
|
133
|
+
log.ok("mysql ready");
|
|
124
134
|
|
|
125
135
|
// 2. Resource manager.
|
|
126
|
-
const rm = CONTAINERS[
|
|
136
|
+
const rm = CONTAINERS["resource-manager"];
|
|
127
137
|
log.step(`Starting ${rm.containerName} (port ${hostPort(cfg, rm)})`);
|
|
128
138
|
startService(rm);
|
|
129
|
-
log.step(
|
|
139
|
+
log.step("Waiting for resource-manager to be ready...");
|
|
130
140
|
await waitService(rm);
|
|
131
|
-
log.ok(
|
|
141
|
+
log.ok("resource-manager ready");
|
|
132
142
|
|
|
133
143
|
// 3. Resources init job (blocking).
|
|
134
144
|
const resources = CONTAINERS.resources;
|
|
135
|
-
log.step(
|
|
145
|
+
log.step("Running resources initialization job (bizone-resources)...");
|
|
136
146
|
removeIfExists(resources.containerName);
|
|
137
147
|
ensureImage(imageFor(cfg, resources.type), imageHooks);
|
|
138
148
|
await runBlocking({
|
|
@@ -141,7 +151,7 @@ export async function start() {
|
|
|
141
151
|
env: envFor(cfg, resources.type),
|
|
142
152
|
network,
|
|
143
153
|
});
|
|
144
|
-
log.ok(
|
|
154
|
+
log.ok("Resources initialization job complete");
|
|
145
155
|
|
|
146
156
|
// 4. Import user-configured resources.
|
|
147
157
|
const namespaces = Object.entries(cfg.resources || {});
|
|
@@ -156,7 +166,7 @@ export async function start() {
|
|
|
156
166
|
}
|
|
157
167
|
|
|
158
168
|
// 5. Start remaining services in parallel (non-blocking).
|
|
159
|
-
const remaining = [
|
|
169
|
+
const remaining = ["orchestrator", "state-store", "cloud-tools", "ui"]
|
|
160
170
|
.map((t) => CONTAINERS[t])
|
|
161
171
|
.filter((s) => {
|
|
162
172
|
if (!isEnabled(cfg, s)) {
|
|
@@ -168,34 +178,38 @@ export async function start() {
|
|
|
168
178
|
|
|
169
179
|
for (const service of remaining) {
|
|
170
180
|
const extraEnv = {};
|
|
171
|
-
if (service.type ===
|
|
181
|
+
if (service.type === "orchestrator" && getBool(cfg, "forward_aws_env")) {
|
|
172
182
|
for (const v of AWS_ENV_VARS) {
|
|
173
183
|
if (process.env[v]) extraEnv[v] = process.env[v];
|
|
174
184
|
}
|
|
175
185
|
}
|
|
176
|
-
log.step(
|
|
186
|
+
log.step(
|
|
187
|
+
`Starting ${service.containerName} (port ${hostPort(cfg, service)})`,
|
|
188
|
+
);
|
|
177
189
|
startService(service, extraEnv);
|
|
178
190
|
}
|
|
179
191
|
|
|
180
192
|
// 6. Wait for all remaining services to become ready (in parallel).
|
|
181
|
-
log.step(
|
|
193
|
+
log.step("Waiting for services to be ready...");
|
|
182
194
|
await Promise.all(
|
|
183
195
|
remaining.map((s) =>
|
|
184
196
|
waitService(s).then(() => log.ok(`${s.containerName} ready`)),
|
|
185
197
|
),
|
|
186
198
|
);
|
|
187
199
|
|
|
188
|
-
log.plain(
|
|
189
|
-
log.plain(color.green(color.bold(
|
|
200
|
+
log.plain("");
|
|
201
|
+
log.plain(color.green(color.bold("✓ Platform is running")));
|
|
190
202
|
const ui = CONTAINERS.ui;
|
|
191
203
|
if (isEnabled(cfg, ui)) {
|
|
192
204
|
log.plain(` UI: ${color.cyan(`http://localhost:${hostPort(cfg, ui)}`)}`);
|
|
193
205
|
}
|
|
194
|
-
log.plain(` Run ${color.cyan(
|
|
206
|
+
log.plain(` Run ${color.cyan("bizone stop")} to stop the platform.`);
|
|
195
207
|
return 0;
|
|
196
208
|
} catch (err) {
|
|
197
209
|
log.err(err.message);
|
|
198
|
-
log.warn(
|
|
210
|
+
log.warn(
|
|
211
|
+
"Startup failed. Containers that did start are still running; run `bizone stop` to clean up.",
|
|
212
|
+
);
|
|
199
213
|
return 1;
|
|
200
214
|
}
|
|
201
215
|
}
|
package/src/commands/stop.js
CHANGED
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
// `bizone stop` — stop running platform containers recorded in containers.json,
|
|
2
2
|
// validating against `docker ps`, then update the local file.
|
|
3
3
|
|
|
4
|
-
import { loadContainers, saveContainers } from
|
|
5
|
-
import { CONTAINERS } from
|
|
6
|
-
import {
|
|
7
|
-
|
|
4
|
+
import { loadContainers, saveContainers } from "../config.js";
|
|
5
|
+
import { CONTAINERS } from "../defaults.js";
|
|
6
|
+
import {
|
|
7
|
+
dockerAvailable,
|
|
8
|
+
runningContainerIds,
|
|
9
|
+
stopContainer,
|
|
10
|
+
} from "../docker.js";
|
|
11
|
+
import { color, log } from "../colors.js";
|
|
8
12
|
|
|
9
13
|
const DB_CONTAINER = CONTAINERS.mysql.containerName;
|
|
10
14
|
|
|
11
15
|
export function stop() {
|
|
12
16
|
if (!dockerAvailable()) {
|
|
13
|
-
log.err(
|
|
17
|
+
log.err("Docker does not appear to be running or installed.");
|
|
14
18
|
return 1;
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
const containers = loadContainers();
|
|
18
22
|
const entries = Object.entries(containers);
|
|
19
23
|
if (entries.length === 0) {
|
|
20
|
-
log.warn(
|
|
24
|
+
log.warn("No recorded containers to stop (containers.json is empty).");
|
|
21
25
|
return 0;
|
|
22
26
|
}
|
|
23
27
|
|
|
@@ -28,10 +32,12 @@ export function stop() {
|
|
|
28
32
|
// Never stop or remove the database; it keeps running so data persists and
|
|
29
33
|
// the next `bizone start` reuses it. Use `bizone db destroy` to remove it.
|
|
30
34
|
if (name === DB_CONTAINER) {
|
|
31
|
-
log.info(`${color.dim(
|
|
35
|
+
log.info(`${color.dim("•")} Keeping ${name} running (database)`);
|
|
32
36
|
continue;
|
|
33
37
|
}
|
|
34
|
-
const isRunning =
|
|
38
|
+
const isRunning =
|
|
39
|
+
running.has(id) ||
|
|
40
|
+
[...running].some((r) => r.startsWith(id) || id.startsWith(r));
|
|
35
41
|
if (isRunning) {
|
|
36
42
|
log.step(`Stopping ${name}...`);
|
|
37
43
|
if (stopContainer(id)) {
|
|
@@ -47,7 +53,7 @@ export function stop() {
|
|
|
47
53
|
}
|
|
48
54
|
|
|
49
55
|
saveContainers(containers);
|
|
50
|
-
log.plain(
|
|
56
|
+
log.plain("");
|
|
51
57
|
log.plain(color.green(color.bold(`✓ Stopped ${stopped} container(s)`)));
|
|
52
58
|
return 0;
|
|
53
59
|
}
|
package/src/config.js
CHANGED
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
// MacOS/Linux: ~/.bizone/config.json
|
|
5
5
|
// Windows: %USERPROFILE%\.bizone\config.json
|
|
6
6
|
|
|
7
|
-
import { homedir } from
|
|
8
|
-
import { join } from
|
|
9
|
-
import { mkdirSync, readFileSync, writeFileSync, existsSync } from
|
|
7
|
+
import { homedir } from "node:os";
|
|
8
|
+
import { join } from "node:path";
|
|
9
|
+
import { mkdirSync, readFileSync, writeFileSync, existsSync } from "node:fs";
|
|
10
10
|
|
|
11
|
-
import { DEFAULT_CONFIG } from
|
|
11
|
+
import { DEFAULT_CONFIG } from "./defaults.js";
|
|
12
12
|
|
|
13
|
-
export const BIZONE_DIR = join(homedir(),
|
|
14
|
-
export const CONFIG_PATH = join(BIZONE_DIR,
|
|
15
|
-
export const CONTAINERS_PATH = join(BIZONE_DIR,
|
|
13
|
+
export const BIZONE_DIR = join(homedir(), ".bizone");
|
|
14
|
+
export const CONFIG_PATH = join(BIZONE_DIR, "config.json");
|
|
15
|
+
export const CONTAINERS_PATH = join(BIZONE_DIR, "containers.json");
|
|
16
16
|
|
|
17
17
|
function ensureDir() {
|
|
18
18
|
if (!existsSync(BIZONE_DIR)) {
|
|
@@ -27,8 +27,8 @@ export function loadConfig() {
|
|
|
27
27
|
return structuredClone(EMPTY);
|
|
28
28
|
}
|
|
29
29
|
try {
|
|
30
|
-
const raw = readFileSync(CONFIG_PATH,
|
|
31
|
-
const parsed = JSON.parse(raw ||
|
|
30
|
+
const raw = readFileSync(CONFIG_PATH, "utf8");
|
|
31
|
+
const parsed = JSON.parse(raw || "{}");
|
|
32
32
|
return {
|
|
33
33
|
config: parsed.config || {},
|
|
34
34
|
images: parsed.images || {},
|
|
@@ -42,7 +42,7 @@ export function loadConfig() {
|
|
|
42
42
|
|
|
43
43
|
export function saveConfig(cfg) {
|
|
44
44
|
ensureDir();
|
|
45
|
-
writeFileSync(CONFIG_PATH, JSON.stringify(cfg, null, 2) +
|
|
45
|
+
writeFileSync(CONFIG_PATH, JSON.stringify(cfg, null, 2) + "\n", "utf8");
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
// Resolve a general config value, falling back to the documented default.
|
|
@@ -54,7 +54,7 @@ export function getConfigValue(cfg, key) {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
export function getBool(cfg, key) {
|
|
57
|
-
return String(getConfigValue(cfg, key)).toLowerCase() ===
|
|
57
|
+
return String(getConfigValue(cfg, key)).toLowerCase() === "true";
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
export function getNumber(cfg, key) {
|
|
@@ -66,7 +66,7 @@ export function getNumber(cfg, key) {
|
|
|
66
66
|
export function loadContainers() {
|
|
67
67
|
if (!existsSync(CONTAINERS_PATH)) return {};
|
|
68
68
|
try {
|
|
69
|
-
return JSON.parse(readFileSync(CONTAINERS_PATH,
|
|
69
|
+
return JSON.parse(readFileSync(CONTAINERS_PATH, "utf8") || "{}");
|
|
70
70
|
} catch {
|
|
71
71
|
return {};
|
|
72
72
|
}
|
|
@@ -74,5 +74,5 @@ export function loadContainers() {
|
|
|
74
74
|
|
|
75
75
|
export function saveContainers(map) {
|
|
76
76
|
ensureDir();
|
|
77
|
-
writeFileSync(CONTAINERS_PATH, JSON.stringify(map, null, 2) +
|
|
77
|
+
writeFileSync(CONTAINERS_PATH, JSON.stringify(map, null, 2) + "\n", "utf8");
|
|
78
78
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export const BIZONE_SERVICE_ENV = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
2
|
+
// kafka
|
|
3
|
+
"transport.kafka.disable": "true",
|
|
4
|
+
"handler.kafka.disable": "true",
|
|
5
|
+
// amqp
|
|
6
|
+
"transport.amqp.disable": "true",
|
|
7
|
+
"handler.amqp.disable": "true",
|
|
8
|
+
// aws-sns
|
|
9
|
+
"transport.aws-sns.disable": "true",
|
|
10
|
+
// aws-sqs
|
|
11
|
+
"transport.aws-sqs.disable": "true",
|
|
12
|
+
"handler.aws-sqs.disable": "true",
|
|
13
|
+
// azure-queue
|
|
14
|
+
"transport.azure-queue.disable": "true",
|
|
15
|
+
"handler.azure-queue.disable": "true",
|
|
16
|
+
};
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import {BIZONE_SERVICE_ENV} from "./_commons.js";
|
|
1
|
+
import { BIZONE_SERVICE_ENV } from "./_commons.js";
|
|
2
2
|
|
|
3
3
|
export const CLOUD_TOOLS_SERVICE = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
type: "cloud-tools",
|
|
5
|
+
image: "699453144787.dkr.ecr.us-east-1.amazonaws.com/bizone-cloud-tools:latest",
|
|
6
|
+
containerName: "bizone-cloud-tools",
|
|
7
|
+
containerPort: 80,
|
|
8
|
+
portKey: "cloud_tools_port",
|
|
9
|
+
defaultPort: "8086",
|
|
10
|
+
enableKey: "cloud_tools_enable",
|
|
11
|
+
readyPath: "/.system/status",
|
|
12
|
+
readyCheck: "systemStatusOk",
|
|
13
|
+
defaultEnv: {
|
|
14
|
+
"http.port": "80",
|
|
15
|
+
"transport.config.endpoint": "http://bizone-res-manager/",
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
"storage.type": "mysql",
|
|
18
|
+
"storage.supported": "memory,mysql",
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
"mysql.storage": "jdbc:mysql://bizone-mysql:3306",
|
|
21
|
+
"mysql.storage.user": "root",
|
|
22
|
+
"mysql.storage.password.secret": "mysql/password",
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
"secret.mysql.password": "root",
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
26
|
+
...BIZONE_SERVICE_ENV,
|
|
27
|
+
},
|
|
28
|
+
};
|
package/src/containers/mysql.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
export const MYSQL_SERVICE = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
2
|
+
type: "mysql",
|
|
3
|
+
image: "mysql:8.4.4-oracle",
|
|
4
|
+
containerName: "bizone-mysql",
|
|
5
|
+
containerPort: 3306,
|
|
6
|
+
portKey: "mysql_port",
|
|
7
|
+
defaultPort: "33306",
|
|
8
|
+
enableKey: null,
|
|
9
|
+
readyCheck: "mysqlPing", // not an HTTP service; readiness via mysqladmin
|
|
10
|
+
// Named docker volume so DB data survives container restarts.
|
|
11
|
+
volume: {
|
|
12
|
+
name: "bizone-mysql-data",
|
|
13
|
+
mount: "/var/lib/mysql",
|
|
14
|
+
},
|
|
15
|
+
defaultEnv: {
|
|
16
|
+
MYSQL_ROOT_PASSWORD: "root",
|
|
17
|
+
},
|
|
18
|
+
};
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import {BIZONE_SERVICE_ENV} from "./_commons.js";
|
|
1
|
+
import { BIZONE_SERVICE_ENV } from "./_commons.js";
|
|
2
2
|
|
|
3
3
|
export const ORCHESTRATOR_SERVICE = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
type: "orchestrator",
|
|
5
|
+
image: "699453144787.dkr.ecr.us-east-1.amazonaws.com/bizone-orchestrator:latest",
|
|
6
|
+
containerName: "bizone-orchestrator",
|
|
7
|
+
containerPort: 80,
|
|
8
|
+
portKey: "orchestrator_port",
|
|
9
|
+
defaultPort: "8001",
|
|
10
|
+
enableKey: null,
|
|
11
|
+
readyPath: "/.system/status",
|
|
12
|
+
readyCheck: "systemStatusOk",
|
|
13
|
+
defaultEnv: {
|
|
14
|
+
"http.port": "80",
|
|
15
|
+
"transport.config.endpoint": "http://bizone-res-manager/",
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
"storage.type": "mysql",
|
|
18
|
+
"storage.supported": "memory,mysql",
|
|
19
|
+
"journal.type": "mysql",
|
|
20
|
+
"journal.supported": "memory,mysql,none",
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
"mysql.storage": "jdbc:mysql://bizone-mysql:3306",
|
|
23
|
+
"mysql.storage.user": "root",
|
|
24
|
+
"mysql.storage.password.secret": "mysql/password",
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
"mysql.journal": "jdbc:mysql://bizone-mysql:3306",
|
|
27
|
+
"mysql.journal.user": "root",
|
|
28
|
+
"mysql.journal.password.secret": "mysql/password",
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
"secret.mysql.password": "root",
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
"expired.flow.check.delay": "10000",
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
};
|
|
34
|
+
...BIZONE_SERVICE_ENV,
|
|
35
|
+
},
|
|
36
|
+
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import {BIZONE_SERVICE_ENV} from "./_commons.js";
|
|
1
|
+
import { BIZONE_SERVICE_ENV } from "./_commons.js";
|
|
2
2
|
|
|
3
3
|
export const RESOURCE_MANAGER_SERVICE = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
type: "resource-manager",
|
|
5
|
+
image: "699453144787.dkr.ecr.us-east-1.amazonaws.com/bizone-res-manager:latest",
|
|
6
|
+
containerName: "bizone-res-manager",
|
|
7
|
+
containerPort: 80,
|
|
8
|
+
portKey: "resource_manager_port",
|
|
9
|
+
defaultPort: "7070",
|
|
10
|
+
enableKey: null,
|
|
11
|
+
readyPath: "/.system/status",
|
|
12
|
+
readyCheck: "systemStatusOk",
|
|
13
|
+
defaultEnv: {
|
|
14
|
+
"http.port": "80",
|
|
15
|
+
"storage.type": "mysql",
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
"mysql.storage": "jdbc:mysql://bizone-mysql:3306",
|
|
18
|
+
"mysql.storage.user": "root",
|
|
19
|
+
"mysql.storage.password.secret": "mysql/password",
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
"secret.mysql.password": "root",
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
};
|
|
23
|
+
...BIZONE_SERVICE_ENV,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export const RESOURCES_JOB = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
2
|
+
type: "resources",
|
|
3
|
+
image: "699453144787.dkr.ecr.us-east-1.amazonaws.com/bizone-resources:latest",
|
|
4
|
+
containerName: "bizone-resources",
|
|
5
|
+
defaultEnv: {
|
|
6
|
+
RESOURCE_MANAGER_URL: "http://bizone-res-manager",
|
|
7
|
+
},
|
|
8
|
+
};
|