amsd-pipeline-shared 0.5.24 → 0.5.25
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.
|
@@ -20,6 +20,13 @@ const PKG = JSON.parse(fs.readFileSync(path.join(ROOT, 'package.json'), 'utf8'))
|
|
|
20
20
|
const FILES = fs.readFileSync(path.join(ROOT, 'docs', 'gateway-files.txt'), 'utf8').trim().split('\n').filter(Boolean);
|
|
21
21
|
const BASE = Object.fromEntries(fs.readFileSync(path.join(ROOT, 'docs', 'gateway-baseline-2.0.80.md5'), 'utf8').trim().split('\n')
|
|
22
22
|
.map((l) => l.trim().split(/\s+/)).map(([sum, f]) => [f, sum]));
|
|
23
|
+
// KNOWN PREDECESSOR COPIES (docs/gateway-predecessors.md5): a copy an install may hold that is neither the release nor this package's — a bash
|
|
24
|
+
// repo change made after 2.0.80 — named with its source; replaceable like the released copy, restored by revert
|
|
25
|
+
const PRED = {};
|
|
26
|
+
for (const l of fs.readFileSync(path.join(ROOT, 'docs', 'gateway-predecessors.md5'), 'utf8').split('\n')) {
|
|
27
|
+
const m = l.match(/^([0-9a-f]{32})\s+(\S+)/); if (m) (PRED[m[2]] = PRED[m[2]] || []).push(m[1]);
|
|
28
|
+
}
|
|
29
|
+
const known = (f, sum) => sum === BASE[f] || (PRED[f] || []).includes(sum);
|
|
23
30
|
const md5 = (f) => (fs.existsSync(f) ? crypto.createHash('md5').update(fs.readFileSync(f)).digest('hex') : null);
|
|
24
31
|
const fail = (m, code = 1) => { process.stderr.write(`amsd-pipeline-shared: ${m}\n`); process.exit(code); };
|
|
25
32
|
|
|
@@ -62,7 +69,7 @@ if (cmd === 'revert') {
|
|
|
62
69
|
if (fs.existsSync(b)) fs.copyFileSync(b, path.join(ORCH, f));
|
|
63
70
|
else if (!BASE[f]) fs.rmSync(path.join(ORCH, f), { force: true }); // this package's own file: the release has none
|
|
64
71
|
}
|
|
65
|
-
const back = FILES.filter((f) => (BASE[f] ? md5(path.join(ORCH, f))
|
|
72
|
+
const back = FILES.filter((f) => (BASE[f] ? !known(f, md5(path.join(ORCH, f))) : fs.existsSync(path.join(ORCH, f))));
|
|
66
73
|
if (back.length) fail(`revert incomplete — not the released copy:\n ${back.join('\n ')}`);
|
|
67
74
|
fs.rmSync(STATE, { recursive: true, force: true });
|
|
68
75
|
process.stdout.write(`amsd-pipeline-shared: reverted ${FILES.length} file(s) to the released copies\n`);
|
|
@@ -77,7 +84,7 @@ const plan = FILES.map((f) => {
|
|
|
77
84
|
if (now && now !== ours && PREV[f] === now) return { f, now, ours, state: 'previous' };
|
|
78
85
|
// a file the release never had (this package's own, e.g. lib/agent-messages.js): installed where absent
|
|
79
86
|
if (!BASE[f]) return { f, now, ours, state: now === ours ? 'current' : (now === null ? 'new' : 'other') };
|
|
80
|
-
return { f, now, ours, state: now === ours ? 'current' : (now
|
|
87
|
+
return { f, now, ours, state: now === ours ? 'current' : (known(f, now) ? 'released' : 'other') };
|
|
81
88
|
});
|
|
82
89
|
const other = plan.filter((p) => p.state === 'other');
|
|
83
90
|
if (other.length) {
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
# Copies a pipeline install may hold that are neither the 2.0.80 release nor this package's, each with where it came from.
|
|
2
|
+
# The installer backs one up and replaces it as it does the released copy; revert puts it back. Any other copy is refused.
|
|
3
|
+
a4e6e7d7071dfc30dc4ae11eff9050db scripts/pre-run-reset.sh epam-cli a306218f7 (unreleased): ClickHouse removed from the agent-monitor recreate (operator: "CLICKHOUSE OUT")
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
# override mounting the run's PRD directory at /prd-dir and its LOG_DIR at /logs-dir, nginx's alias, and agent-monitor recreated.
|
|
6
6
|
# point_dashboards_at_run <prd_file> <log_dir>
|
|
7
7
|
# What pre-run-reset.sh sets before its Step 1 is taken from the caller when set, else derived from this install as pre-run-reset.sh derives it.
|
|
8
|
+
# CLICKHOUSE OUT (operator; epam-cli a306218f7): the recreate passes no ClickHouse port — the one change from the released step.
|
|
8
9
|
point_dashboards_at_run() {
|
|
9
10
|
local PRD_FILE="${1:?prd file}" LOG_DIR="${2:?log dir}"
|
|
10
11
|
local _here; _here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
@@ -179,7 +180,6 @@ _obs_compose() {
|
|
|
179
180
|
# docker, where it is meaningful and cheap.
|
|
180
181
|
_obs_replace_agent_monitor() {
|
|
181
182
|
EPAM_OBS_SUBNET="${OBS_SUBNET:-}" \
|
|
182
|
-
EPAM_OBS_CLICKHOUSE_PORT="${OBS_CLICKHOUSE_PORT:-}" \
|
|
183
183
|
EPAM_OBS_LANGFUSE_PORT="${OBS_LANGFUSE_PORT:-}" \
|
|
184
184
|
EPAM_OBS_DASHBOARD_PORT="${OBS_DASHBOARD_PORT:-}" \
|
|
185
185
|
EPAM_OBS_GRAFANA_PORT="${OBS_GRAFANA_PORT:-}" \
|
|
@@ -187,7 +187,6 @@ _obs_replace_agent_monitor() {
|
|
|
187
187
|
_obs_compose -f "$COMPOSE_BASE" -f "$COMPOSE_OVERRIDE" -p "$OBS_PROJECT" \
|
|
188
188
|
rm -sf agent-monitor >/dev/null 2>&1 || true
|
|
189
189
|
EPAM_OBS_SUBNET="${OBS_SUBNET:-}" \
|
|
190
|
-
EPAM_OBS_CLICKHOUSE_PORT="${OBS_CLICKHOUSE_PORT:-}" \
|
|
191
190
|
EPAM_OBS_LANGFUSE_PORT="${OBS_LANGFUSE_PORT:-}" \
|
|
192
191
|
EPAM_OBS_DASHBOARD_PORT="${OBS_DASHBOARD_PORT:-}" \
|
|
193
192
|
EPAM_OBS_GRAFANA_PORT="${OBS_GRAFANA_PORT:-}" \
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "amsd-pipeline-shared",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.25",
|
|
4
4
|
"description": "The AMSD pipeline's shared components, one source for the bash pipeline and its Claude workflows: the model-call gateway (llm-handler.sh — retry, ladder, self-heal, cost) and the libraries it runs.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"bin": {
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"orchestrations/",
|
|
12
12
|
"docs/gateway-files.txt",
|
|
13
13
|
"docs/gateway-baseline-2.0.80.md5",
|
|
14
|
+
"docs/gateway-predecessors.md5",
|
|
14
15
|
"docs/CONSUMER-REVIEW-B56.md",
|
|
15
16
|
"README.md"
|
|
16
17
|
],
|