@bizone-ai/cli 0.1.0

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.
@@ -0,0 +1,104 @@
1
+ // `bizone environment|env get|set|remove`
2
+
3
+ import { loadConfig, saveConfig } from '../config.js';
4
+ import { IMAGE_TYPES, SECRET_ENV_KEYS, SECRET_KEY_SUBSTRINGS, defaultEnvFor } from '../defaults.js';
5
+ import { color, log } from '../colors.js';
6
+
7
+ function isValidType(type) {
8
+ return IMAGE_TYPES.includes(type);
9
+ }
10
+
11
+ function typesHint() {
12
+ log.plain(` Valid types: ${IMAGE_TYPES.map((t) => color.cyan(t)).join(', ')}`);
13
+ }
14
+
15
+ function isSecret(name) {
16
+ const lower = name.toLowerCase();
17
+ if (SECRET_ENV_KEYS.some((k) => k.toLowerCase() === lower)) return true;
18
+ return SECRET_KEY_SUBSTRINGS.some((s) => lower.includes(s));
19
+ }
20
+
21
+ // Mask a value showing only first 4 and last 4 characters.
22
+ function mask(value) {
23
+ const v = String(value);
24
+ if (v.length <= 8) return '*'.repeat(v.length);
25
+ return `${v.slice(0, 4)}${'*'.repeat(Math.max(3, v.length - 8))}${v.slice(-4)}`;
26
+ }
27
+
28
+ export function environment(args) {
29
+ const [sub, type, name, ...rest] = args;
30
+ const cfg = loadConfig();
31
+
32
+ switch (sub) {
33
+ case 'get': {
34
+ if (!type) {
35
+ log.err('Usage: bizone env get {type}');
36
+ typesHint();
37
+ return 1;
38
+ }
39
+ if (!isValidType(type)) {
40
+ log.err(`Unknown type "${type}".`);
41
+ typesHint();
42
+ return 1;
43
+ }
44
+ const defaults = defaultEnvFor(type);
45
+ const userVars = cfg.env[type] || {};
46
+ // Effective view: defaults first, then user overrides.
47
+ const effective = { ...defaults, ...userVars };
48
+ const keys = Object.keys(effective);
49
+ log.plain(color.bold(`Environment for ${color.cyan(type)}:`));
50
+ if (keys.length === 0) {
51
+ log.plain(color.dim(' (none set)'));
52
+ return 0;
53
+ }
54
+ for (const k of keys) {
55
+ const val = effective[k];
56
+ const display = isSecret(k) ? color.dim(mask(val)) : val;
57
+ const isUser = Object.prototype.hasOwnProperty.call(userVars, k);
58
+ const isDefault = Object.prototype.hasOwnProperty.call(defaults, k);
59
+ let tag = '';
60
+ if (isUser && isDefault) tag = color.yellow(' (override)');
61
+ else if (isDefault) tag = color.dim(' (default)');
62
+ log.plain(` ${color.cyan(k)} = ${display}${tag}`);
63
+ }
64
+ return 0;
65
+ }
66
+ case 'set': {
67
+ if (!type || !name || rest.length === 0) {
68
+ log.err('Usage: bizone env set {type} {name} {value}');
69
+ typesHint();
70
+ return 1;
71
+ }
72
+ if (!isValidType(type)) {
73
+ log.err(`Unknown type "${type}".`);
74
+ typesHint();
75
+ return 1;
76
+ }
77
+ if (!cfg.env[type]) cfg.env[type] = {};
78
+ cfg.env[type][name] = rest.join(' ');
79
+ saveConfig(cfg);
80
+ log.ok(`Set env ${color.cyan(type)}.${color.cyan(name)}`);
81
+ return 0;
82
+ }
83
+ case 'remove': {
84
+ if (!type || !name) {
85
+ log.err('Usage: bizone env remove {type} {name}');
86
+ typesHint();
87
+ return 1;
88
+ }
89
+ if (cfg.env[type] && Object.prototype.hasOwnProperty.call(cfg.env[type], name)) {
90
+ delete cfg.env[type][name];
91
+ if (Object.keys(cfg.env[type]).length === 0) delete cfg.env[type];
92
+ saveConfig(cfg);
93
+ log.ok(`Removed env ${color.cyan(type)}.${color.cyan(name)}`);
94
+ } else {
95
+ log.warn(`No env var ${color.cyan(name)} set for ${color.cyan(type)}.`);
96
+ }
97
+ return 0;
98
+ }
99
+ default:
100
+ log.err('Usage: bizone env <get|set|remove> ...');
101
+ typesHint();
102
+ return 1;
103
+ }
104
+ }
@@ -0,0 +1,66 @@
1
+ // `bizone images|img get|set|remove`
2
+
3
+ import { loadConfig, saveConfig } from '../config.js';
4
+ import { CONTAINERS, IMAGE_TYPES } from '../defaults.js';
5
+ import { color, log } from '../colors.js';
6
+
7
+ function isValidType(type) {
8
+ return Object.prototype.hasOwnProperty.call(CONTAINERS, type);
9
+ }
10
+
11
+ function typesHint() {
12
+ log.plain(` Valid types: ${IMAGE_TYPES.map((t) => color.cyan(t)).join(', ')}`);
13
+ }
14
+
15
+ export function images(args) {
16
+ const [sub, type, ...rest] = args;
17
+ const cfg = loadConfig();
18
+
19
+ switch (sub) {
20
+ case 'get': {
21
+ log.plain(color.bold('Images:'));
22
+ for (const t in CONTAINERS) {
23
+ const override = cfg.images[t];
24
+ const val = override || CONTAINERS[t].image;
25
+ const tag = override ? color.yellow(' (override)') : color.dim(' (default)');
26
+ log.plain(` ${color.cyan(t)} -> ${val}${tag}`);
27
+ }
28
+ return 0;
29
+ }
30
+ case 'set': {
31
+ if (!type || rest.length === 0) {
32
+ log.err('Usage: bizone images set {type} {url}');
33
+ typesHint();
34
+ return 1;
35
+ }
36
+ if (!isValidType(type)) {
37
+ log.err(`Unknown image type "${type}".`);
38
+ typesHint();
39
+ return 1;
40
+ }
41
+ cfg.images[type] = rest.join(' ');
42
+ saveConfig(cfg);
43
+ log.ok(`Set image ${color.cyan(type)} -> ${cfg.images[type]}`);
44
+ return 0;
45
+ }
46
+ case 'remove': {
47
+ if (!type) {
48
+ log.err('Usage: bizone images remove {type}');
49
+ typesHint();
50
+ return 1;
51
+ }
52
+ if (Object.prototype.hasOwnProperty.call(cfg.images, type)) {
53
+ delete cfg.images[type];
54
+ saveConfig(cfg);
55
+ log.ok(`Removed override for ${color.cyan(type)} (now: ${CONTAINERS[type].image})`);
56
+ } else {
57
+ log.warn(`No override set for ${color.cyan(type)}.`);
58
+ }
59
+ return 0;
60
+ }
61
+ default:
62
+ log.err('Usage: bizone images <get|set|remove> ...');
63
+ typesHint();
64
+ return 1;
65
+ }
66
+ }
@@ -0,0 +1,60 @@
1
+ // `bizone resources|res|r get|set|remove`
2
+
3
+ import { existsSync } from 'node:fs';
4
+
5
+ import { loadConfig, saveConfig } from '../config.js';
6
+ import { resolveResourcePath } from '../resources-loader.js';
7
+ import { color, log } from '../colors.js';
8
+
9
+ export function resources(args) {
10
+ const [sub, namespace, ...rest] = args;
11
+ const cfg = loadConfig();
12
+
13
+ switch (sub) {
14
+ case 'get': {
15
+ log.plain(color.bold('Resource sources:'));
16
+ const entries = Object.entries(cfg.resources);
17
+ if (entries.length === 0) {
18
+ log.plain(color.dim(' (none set)'));
19
+ return 0;
20
+ }
21
+ for (const [ns, p] of entries) {
22
+ const exists = existsSync(resolveResourcePath(p));
23
+ const tag = exists ? '' : color.red(' (path not found)');
24
+ log.plain(` ${color.cyan(ns)} -> ${p}${tag}`);
25
+ }
26
+ return 0;
27
+ }
28
+ case 'set': {
29
+ if (!namespace || rest.length === 0) {
30
+ log.err('Usage: bizone resources set {namespace} {folder_or_file_path}');
31
+ return 1;
32
+ }
33
+ const path = rest.join(' ');
34
+ if (!existsSync(resolveResourcePath(path))) {
35
+ log.warn(`Path "${path}" does not currently exist; storing anyway.`);
36
+ }
37
+ cfg.resources[namespace] = path;
38
+ saveConfig(cfg);
39
+ log.ok(`Set resource namespace ${color.cyan(namespace)} -> ${path}`);
40
+ return 0;
41
+ }
42
+ case 'remove': {
43
+ if (!namespace) {
44
+ log.err('Usage: bizone resources remove {namespace}');
45
+ return 1;
46
+ }
47
+ if (Object.prototype.hasOwnProperty.call(cfg.resources, namespace)) {
48
+ delete cfg.resources[namespace];
49
+ saveConfig(cfg);
50
+ log.ok(`Removed resource namespace ${color.cyan(namespace)}`);
51
+ } else {
52
+ log.warn(`No resource set for namespace ${color.cyan(namespace)}.`);
53
+ }
54
+ return 0;
55
+ }
56
+ default:
57
+ log.err('Usage: bizone resources <get|set|remove> ...');
58
+ return 1;
59
+ }
60
+ }
@@ -0,0 +1,201 @@
1
+ // `bizone start` — start the platform via the startup sequence (non-blocking:
2
+ // returns control to the shell once everything is ready).
3
+
4
+ import {
5
+ loadConfig,
6
+ getConfigValue,
7
+ getBool,
8
+ getNumber,
9
+ loadContainers,
10
+ saveContainers,
11
+ } from '../config.js';
12
+ import {
13
+ CONTAINERS,
14
+ AWS_ENV_VARS,
15
+ defaultEnvFor,
16
+ } from '../defaults.js';
17
+ import {
18
+ dockerAvailable,
19
+ ensureNetwork,
20
+ ensureImage,
21
+ runDetached,
22
+ runBlocking,
23
+ removeIfExists,
24
+ mysqlReady,
25
+ isContainerRunning,
26
+ } from '../docker.js';
27
+ import { waitForReady, importNamespace } from '../http.js';
28
+ import { loadItems } from '../resources-loader.js';
29
+ import { color, log } from '../colors.js';
30
+
31
+ function imageFor(cfg, type) {
32
+ return cfg.images[type] || CONTAINERS[type].image;
33
+ }
34
+
35
+ function hostPort(cfg, service) {
36
+ return getConfigValue(cfg, service.portKey);
37
+ }
38
+
39
+ // Effective env for a container type: baked-in defaults, overridden by any
40
+ // user-set values (`bizone env set`).
41
+ function envFor(cfg, type) {
42
+ return { ...defaultEnvFor(type), ...(cfg.env[type] || {}) };
43
+ }
44
+
45
+ // A service runs if it has no enableKey (always-on) or its enableKey is true.
46
+ // state-store and cloud-tools are opt-in (disabled by default).
47
+ function isEnabled(cfg, service) {
48
+ return service.enableKey ? getBool(cfg, service.enableKey) : true;
49
+ }
50
+
51
+ export async function start() {
52
+ const cfg = loadConfig();
53
+ const timeoutSec = getNumber(cfg, 'timeout_sec');
54
+
55
+ if (!dockerAvailable()) {
56
+ log.err('Docker does not appear to be running or installed. Start Docker and retry.');
57
+ return 1;
58
+ }
59
+
60
+ log.plain(color.bold('Starting Bizone platform...'));
61
+
62
+ // 1. Shared network.
63
+ const network = getConfigValue(cfg, 'network_name');
64
+ log.step('Ensuring docker network');
65
+ const created = ensureNetwork(network);
66
+ log.ok(created ? `Created network ${network}` : `Network ${network} ready`);
67
+
68
+ const containers = loadContainers();
69
+
70
+ const imageHooks = {
71
+ onBeforePull: (image) => log.step(`Pulling image ${image} (this may take a while)...`),
72
+ onBeforeLogin: (registry) => log.step(`Authenticating to AWS ECR for ${registry}...`),
73
+ };
74
+
75
+ // Helper to start one service detached and record its id.
76
+ const startService = (service, extraEnv = {}) => {
77
+ removeIfExists(service.containerName); // avoid name conflicts from stale runs
78
+ ensureImage(imageFor(cfg, service.type), imageHooks); // pull + ECR login if needed
79
+ const id = runDetached({
80
+ name: service.containerName,
81
+ hostPort: hostPort(cfg, service),
82
+ containerPort: service.containerPort,
83
+ image: imageFor(cfg, service.type),
84
+ env: { ...envFor(cfg, service.type), ...extraEnv },
85
+ volume: service.volume || null,
86
+ network,
87
+ });
88
+ containers[service.containerName] = id;
89
+ saveContainers(containers);
90
+ return id;
91
+ };
92
+
93
+ const waitService = (service) =>
94
+ waitForReady({
95
+ url: `http://localhost:${hostPort(cfg, service)}${service.readyPath}`,
96
+ checkName: service.readyCheck,
97
+ timeoutSec,
98
+ label: service.containerName,
99
+ });
100
+
101
+ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
102
+ const waitForMysql = async (containerName) => {
103
+ const deadline = Date.now() + timeoutSec * 1000;
104
+ while (Date.now() < deadline) {
105
+ if (mysqlReady(containerName)) return true;
106
+ await sleep(1500);
107
+ }
108
+ throw new Error(`Timed out waiting for ${containerName} (MySQL) to be ready (${timeoutSec}s)`);
109
+ };
110
+
111
+ try {
112
+ // 1b. MySQL — must be up before the resource-manager (which stores into it).
113
+ // Reuse an already-running DB container; data lives in a persistent volume.
114
+ const mysql = CONTAINERS.mysql;
115
+ if (isContainerRunning(mysql.containerName)) {
116
+ log.ok(`${mysql.containerName} already running`);
117
+ } else {
118
+ log.step(`Starting ${mysql.containerName} (port ${hostPort(cfg, mysql)})`);
119
+ startService(mysql);
120
+ }
121
+ log.step('Waiting for MySQL to be ready...');
122
+ await waitForMysql(mysql.containerName);
123
+ log.ok('mysql ready');
124
+
125
+ // 2. Resource manager.
126
+ const rm = CONTAINERS['resource-manager'];
127
+ log.step(`Starting ${rm.containerName} (port ${hostPort(cfg, rm)})`);
128
+ startService(rm);
129
+ log.step('Waiting for resource-manager to be ready...');
130
+ await waitService(rm);
131
+ log.ok('resource-manager ready');
132
+
133
+ // 3. Resources init job (blocking).
134
+ const resources = CONTAINERS.resources;
135
+ log.step('Running resources initialization job (bizone-resources)...');
136
+ removeIfExists(resources.containerName);
137
+ ensureImage(imageFor(cfg, resources.type), imageHooks);
138
+ await runBlocking({
139
+ name: resources.containerName,
140
+ image: imageFor(cfg, resources.type),
141
+ env: envFor(cfg, resources.type),
142
+ network,
143
+ });
144
+ log.ok('Resources initialization job complete');
145
+
146
+ // 4. Import user-configured resources.
147
+ const namespaces = Object.entries(cfg.resources || {});
148
+ if (namespaces.length > 0) {
149
+ const rmPort = hostPort(cfg, rm);
150
+ log.step(`Importing ${namespaces.length} resource namespace(s)...`);
151
+ for (const [namespace, path] of namespaces) {
152
+ const items = loadItems(path);
153
+ await importNamespace({ port: rmPort, namespace, items });
154
+ log.ok(`Imported "${namespace}" (${items.length} item(s))`);
155
+ }
156
+ }
157
+
158
+ // 5. Start remaining services in parallel (non-blocking).
159
+ const remaining = ['orchestrator', 'state-store', 'cloud-tools', 'ui']
160
+ .map((t) => CONTAINERS[t])
161
+ .filter((s) => {
162
+ if (!isEnabled(cfg, s)) {
163
+ //log.warn(`Skipping ${s.containerName} (not enabled; set ${s.enableKey}=true to run)`);
164
+ return false;
165
+ }
166
+ return true;
167
+ });
168
+
169
+ for (const service of remaining) {
170
+ const extraEnv = {};
171
+ if (service.type === 'orchestrator' && getBool(cfg, 'forward_aws_env')) {
172
+ for (const v of AWS_ENV_VARS) {
173
+ if (process.env[v]) extraEnv[v] = process.env[v];
174
+ }
175
+ }
176
+ log.step(`Starting ${service.containerName} (port ${hostPort(cfg, service)})`);
177
+ startService(service, extraEnv);
178
+ }
179
+
180
+ // 6. Wait for all remaining services to become ready (in parallel).
181
+ log.step('Waiting for services to be ready...');
182
+ await Promise.all(
183
+ remaining.map((s) =>
184
+ waitService(s).then(() => log.ok(`${s.containerName} ready`)),
185
+ ),
186
+ );
187
+
188
+ log.plain('');
189
+ log.plain(color.green(color.bold('✓ Platform is running')));
190
+ const ui = CONTAINERS.ui;
191
+ if (isEnabled(cfg, ui)) {
192
+ log.plain(` UI: ${color.cyan(`http://localhost:${hostPort(cfg, ui)}`)}`);
193
+ }
194
+ log.plain(` Run ${color.cyan('bizone stop')} to stop the platform.`);
195
+ return 0;
196
+ } catch (err) {
197
+ log.err(err.message);
198
+ log.warn('Startup failed. Containers that did start are still running; run `bizone stop` to clean up.');
199
+ return 1;
200
+ }
201
+ }
@@ -0,0 +1,53 @@
1
+ // `bizone stop` — stop running platform containers recorded in containers.json,
2
+ // validating against `docker ps`, then update the local file.
3
+
4
+ import { loadContainers, saveContainers } from '../config.js';
5
+ import { CONTAINERS } from '../defaults.js';
6
+ import { dockerAvailable, runningContainerIds, stopContainer } from '../docker.js';
7
+ import { color, log } from '../colors.js';
8
+
9
+ const DB_CONTAINER = CONTAINERS.mysql.containerName;
10
+
11
+ export function stop() {
12
+ if (!dockerAvailable()) {
13
+ log.err('Docker does not appear to be running or installed.');
14
+ return 1;
15
+ }
16
+
17
+ const containers = loadContainers();
18
+ const entries = Object.entries(containers);
19
+ if (entries.length === 0) {
20
+ log.warn('No recorded containers to stop (containers.json is empty).');
21
+ return 0;
22
+ }
23
+
24
+ const running = runningContainerIds();
25
+ let stopped = 0;
26
+
27
+ for (const [name, id] of entries) {
28
+ // Never stop or remove the database; it keeps running so data persists and
29
+ // the next `bizone start` reuses it. Use `bizone db destroy` to remove it.
30
+ if (name === DB_CONTAINER) {
31
+ log.info(`${color.dim('•')} Keeping ${name} running (database)`);
32
+ continue;
33
+ }
34
+ const isRunning = running.has(id) || [...running].some((r) => r.startsWith(id) || id.startsWith(r));
35
+ if (isRunning) {
36
+ log.step(`Stopping ${name}...`);
37
+ if (stopContainer(id)) {
38
+ log.ok(`Stopped ${name}`);
39
+ stopped += 1;
40
+ } else {
41
+ log.warn(`Could not stop ${name}; removing from record anyway`);
42
+ }
43
+ } else {
44
+ log.warn(`${name} not running (skipping)`);
45
+ }
46
+ delete containers[name];
47
+ }
48
+
49
+ saveContainers(containers);
50
+ log.plain('');
51
+ log.plain(color.green(color.bold(`✓ Stopped ${stopped} container(s)`)));
52
+ return 0;
53
+ }
package/src/config.js ADDED
@@ -0,0 +1,78 @@
1
+ // Configuration file handling. Cross-platform: stores config under the user's
2
+ // home directory in a `.bizone` folder.
3
+ //
4
+ // MacOS/Linux: ~/.bizone/config.json
5
+ // Windows: %USERPROFILE%\.bizone\config.json
6
+
7
+ import { homedir } from 'node:os';
8
+ import { join } from 'node:path';
9
+ import { mkdirSync, readFileSync, writeFileSync, existsSync } from 'node:fs';
10
+
11
+ import { DEFAULT_CONFIG } from './defaults.js';
12
+
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
+
17
+ function ensureDir() {
18
+ if (!existsSync(BIZONE_DIR)) {
19
+ mkdirSync(BIZONE_DIR, { recursive: true });
20
+ }
21
+ }
22
+
23
+ const EMPTY = { config: {}, images: {}, env: {}, resources: {} };
24
+
25
+ export function loadConfig() {
26
+ if (!existsSync(CONFIG_PATH)) {
27
+ return structuredClone(EMPTY);
28
+ }
29
+ try {
30
+ const raw = readFileSync(CONFIG_PATH, 'utf8');
31
+ const parsed = JSON.parse(raw || '{}');
32
+ return {
33
+ config: parsed.config || {},
34
+ images: parsed.images || {},
35
+ env: parsed.env || {},
36
+ resources: parsed.resources || {},
37
+ };
38
+ } catch (err) {
39
+ throw new Error(`Failed to read config at ${CONFIG_PATH}: ${err.message}`);
40
+ }
41
+ }
42
+
43
+ export function saveConfig(cfg) {
44
+ ensureDir();
45
+ writeFileSync(CONFIG_PATH, JSON.stringify(cfg, null, 2) + '\n', 'utf8');
46
+ }
47
+
48
+ // Resolve a general config value, falling back to the documented default.
49
+ export function getConfigValue(cfg, key) {
50
+ if (cfg.config && Object.prototype.hasOwnProperty.call(cfg.config, key)) {
51
+ return cfg.config[key];
52
+ }
53
+ return DEFAULT_CONFIG[key];
54
+ }
55
+
56
+ export function getBool(cfg, key) {
57
+ return String(getConfigValue(cfg, key)).toLowerCase() === 'true';
58
+ }
59
+
60
+ export function getNumber(cfg, key) {
61
+ return Number(getConfigValue(cfg, key));
62
+ }
63
+
64
+ // --- containers.json (running container ids) ---
65
+
66
+ export function loadContainers() {
67
+ if (!existsSync(CONTAINERS_PATH)) return {};
68
+ try {
69
+ return JSON.parse(readFileSync(CONTAINERS_PATH, 'utf8') || '{}');
70
+ } catch {
71
+ return {};
72
+ }
73
+ }
74
+
75
+ export function saveContainers(map) {
76
+ ensureDir();
77
+ writeFileSync(CONTAINERS_PATH, JSON.stringify(map, null, 2) + '\n', 'utf8');
78
+ }
@@ -0,0 +1,16 @@
1
+ export const BIZONE_SERVICE_ENV = {
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
+ }
@@ -0,0 +1,28 @@
1
+ import {BIZONE_SERVICE_ENV} from "./_commons.js";
2
+
3
+ export const CLOUD_TOOLS_SERVICE = {
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
+
17
+ 'storage.type': 'mysql',
18
+ "storage.supported": "memory,mysql",
19
+
20
+ 'mysql.storage': 'jdbc:mysql://bizone-mysql:3306',
21
+ 'mysql.storage.user': 'root',
22
+ 'mysql.storage.password.secret': 'mysql/password',
23
+
24
+ 'secret.mysql.password': 'root',
25
+
26
+ ...BIZONE_SERVICE_ENV
27
+ }
28
+ }
@@ -0,0 +1,18 @@
1
+ export const MYSQL_SERVICE = {
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
+ }
@@ -0,0 +1,36 @@
1
+ import {BIZONE_SERVICE_ENV} from "./_commons.js";
2
+
3
+ export const ORCHESTRATOR_SERVICE = {
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
+
17
+ 'storage.type': 'mysql',
18
+ "storage.supported": "memory,mysql",
19
+ "journal.type": "mysql",
20
+ "journal.supported": "memory,mysql,none",
21
+
22
+ 'mysql.storage': 'jdbc:mysql://bizone-mysql:3306',
23
+ 'mysql.storage.user': 'root',
24
+ 'mysql.storage.password.secret': 'mysql/password',
25
+
26
+ 'mysql.journal': 'jdbc:mysql://bizone-mysql:3306',
27
+ 'mysql.journal.user': 'root',
28
+ 'mysql.journal.password.secret': 'mysql/password',
29
+
30
+ 'secret.mysql.password': 'root',
31
+
32
+ "expired.flow.check.delay": '10000',
33
+
34
+ ...BIZONE_SERVICE_ENV
35
+ }
36
+ };
@@ -0,0 +1,25 @@
1
+ import {BIZONE_SERVICE_ENV} from "./_commons.js";
2
+
3
+ export const RESOURCE_MANAGER_SERVICE = {
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
+
17
+ 'mysql.storage': 'jdbc:mysql://bizone-mysql:3306',
18
+ 'mysql.storage.user': 'root',
19
+ 'mysql.storage.password.secret': 'mysql/password',
20
+
21
+ 'secret.mysql.password': 'root',
22
+
23
+ ...BIZONE_SERVICE_ENV
24
+ }
25
+ };