postgresai 0.14.0-dev.65 → 0.14.0-dev.66
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/bin/postgres-ai.ts +3 -41
- package/dist/bin/postgres-ai.js +4 -32
- package/lib/metrics-embedded.ts +1 -1
- package/package.json +1 -1
package/bin/postgres-ai.ts
CHANGED
|
@@ -1155,14 +1155,8 @@ async function runCompose(args: string[], grafanaPassword?: string): Promise<num
|
|
|
1155
1155
|
}
|
|
1156
1156
|
}
|
|
1157
1157
|
|
|
1158
|
-
// On macOS, node-exporter can't mount host root filesystem - skip it
|
|
1159
|
-
const finalArgs = [...args];
|
|
1160
|
-
if (process.platform === "darwin" && args.includes("up")) {
|
|
1161
|
-
finalArgs.push("--scale", "node-exporter=0");
|
|
1162
|
-
}
|
|
1163
|
-
|
|
1164
1158
|
return new Promise<number>((resolve) => {
|
|
1165
|
-
const child = spawn(cmd[0], [...cmd.slice(1), "-f", composeFile, ...
|
|
1159
|
+
const child = spawn(cmd[0], [...cmd.slice(1), "-f", composeFile, ...args], {
|
|
1166
1160
|
stdio: "inherit",
|
|
1167
1161
|
env: env,
|
|
1168
1162
|
cwd: projectDir
|
|
@@ -1221,8 +1215,8 @@ mon
|
|
|
1221
1215
|
if (pwdMatch) existingPassword = pwdMatch[1].trim();
|
|
1222
1216
|
}
|
|
1223
1217
|
|
|
1224
|
-
// Priority: CLI --tag flag >
|
|
1225
|
-
const imageTag = opts.tag ||
|
|
1218
|
+
// Priority: CLI --tag flag > existing .env > package version
|
|
1219
|
+
const imageTag = opts.tag || existingTag || pkg.version;
|
|
1226
1220
|
|
|
1227
1221
|
const envLines: string[] = [`PGAI_TAG=${imageTag}`];
|
|
1228
1222
|
if (existingRegistry) {
|
|
@@ -1533,34 +1527,6 @@ mon
|
|
|
1533
1527
|
if (code !== 0) process.exitCode = code;
|
|
1534
1528
|
});
|
|
1535
1529
|
|
|
1536
|
-
// Known container names for cleanup
|
|
1537
|
-
const MONITORING_CONTAINERS = [
|
|
1538
|
-
"postgres-ai-config-init",
|
|
1539
|
-
"node-exporter",
|
|
1540
|
-
"cadvisor",
|
|
1541
|
-
"grafana-with-datasources",
|
|
1542
|
-
"sink-postgres",
|
|
1543
|
-
"sink-prometheus",
|
|
1544
|
-
"target-db",
|
|
1545
|
-
"pgwatch-postgres",
|
|
1546
|
-
"pgwatch-prometheus",
|
|
1547
|
-
"postgres-exporter-sink",
|
|
1548
|
-
"flask-pgss-api",
|
|
1549
|
-
"sources-generator",
|
|
1550
|
-
"postgres-reports",
|
|
1551
|
-
];
|
|
1552
|
-
|
|
1553
|
-
/** Remove orphaned containers that docker compose down might miss */
|
|
1554
|
-
async function removeOrphanedContainers(): Promise<void> {
|
|
1555
|
-
for (const container of MONITORING_CONTAINERS) {
|
|
1556
|
-
try {
|
|
1557
|
-
await execFilePromise("docker", ["rm", "-f", container]);
|
|
1558
|
-
} catch {
|
|
1559
|
-
// Container doesn't exist, ignore
|
|
1560
|
-
}
|
|
1561
|
-
}
|
|
1562
|
-
}
|
|
1563
|
-
|
|
1564
1530
|
mon
|
|
1565
1531
|
.command("stop")
|
|
1566
1532
|
.description("stop monitoring services")
|
|
@@ -1818,10 +1784,6 @@ mon
|
|
|
1818
1784
|
console.log("⚠ Could not stop services (may not be running)");
|
|
1819
1785
|
}
|
|
1820
1786
|
|
|
1821
|
-
// Remove any orphaned containers that docker compose down missed
|
|
1822
|
-
await removeOrphanedContainers();
|
|
1823
|
-
console.log("✓ Removed orphaned containers");
|
|
1824
|
-
|
|
1825
1787
|
// Remove orphaned volumes from previous installs with different project names
|
|
1826
1788
|
if (!options.keepVolumes) {
|
|
1827
1789
|
const volumePatterns = [
|
package/dist/bin/postgres-ai.js
CHANGED
|
@@ -13064,7 +13064,7 @@ var {
|
|
|
13064
13064
|
// package.json
|
|
13065
13065
|
var package_default = {
|
|
13066
13066
|
name: "postgresai",
|
|
13067
|
-
version: "0.14.0-dev.
|
|
13067
|
+
version: "0.14.0-dev.66",
|
|
13068
13068
|
description: "postgres_ai CLI",
|
|
13069
13069
|
license: "Apache-2.0",
|
|
13070
13070
|
private: false,
|
|
@@ -15887,7 +15887,7 @@ var Result = import_lib.default.Result;
|
|
|
15887
15887
|
var TypeOverrides = import_lib.default.TypeOverrides;
|
|
15888
15888
|
var defaults = import_lib.default.defaults;
|
|
15889
15889
|
// package.json
|
|
15890
|
-
var version = "0.14.0-dev.
|
|
15890
|
+
var version = "0.14.0-dev.66";
|
|
15891
15891
|
var package_default2 = {
|
|
15892
15892
|
name: "postgresai",
|
|
15893
15893
|
version,
|
|
@@ -27182,12 +27182,8 @@ async function runCompose(args, grafanaPassword) {
|
|
|
27182
27182
|
}
|
|
27183
27183
|
}
|
|
27184
27184
|
}
|
|
27185
|
-
const finalArgs = [...args];
|
|
27186
|
-
if (process.platform === "darwin" && args.includes("up")) {
|
|
27187
|
-
finalArgs.push("--scale", "node-exporter=0");
|
|
27188
|
-
}
|
|
27189
27185
|
return new Promise((resolve6) => {
|
|
27190
|
-
const child = spawn2(cmd[0], [...cmd.slice(1), "-f", composeFile, ...
|
|
27186
|
+
const child = spawn2(cmd[0], [...cmd.slice(1), "-f", composeFile, ...args], {
|
|
27191
27187
|
stdio: "inherit",
|
|
27192
27188
|
env,
|
|
27193
27189
|
cwd: projectDir
|
|
@@ -27228,7 +27224,7 @@ mon.command("local-install").description("install local monitoring stack (genera
|
|
|
27228
27224
|
if (pwdMatch)
|
|
27229
27225
|
existingPassword = pwdMatch[1].trim();
|
|
27230
27226
|
}
|
|
27231
|
-
const imageTag = opts.tag ||
|
|
27227
|
+
const imageTag = opts.tag || existingTag || package_default.version;
|
|
27232
27228
|
const envLines = [`PGAI_TAG=${imageTag}`];
|
|
27233
27229
|
if (existingRegistry) {
|
|
27234
27230
|
envLines.push(`PGAI_REGISTRY=${existingRegistry}`);
|
|
@@ -27550,28 +27546,6 @@ mon.command("start").description("start monitoring services").action(async () =>
|
|
|
27550
27546
|
if (code !== 0)
|
|
27551
27547
|
process.exitCode = code;
|
|
27552
27548
|
});
|
|
27553
|
-
var MONITORING_CONTAINERS = [
|
|
27554
|
-
"postgres-ai-config-init",
|
|
27555
|
-
"node-exporter",
|
|
27556
|
-
"cadvisor",
|
|
27557
|
-
"grafana-with-datasources",
|
|
27558
|
-
"sink-postgres",
|
|
27559
|
-
"sink-prometheus",
|
|
27560
|
-
"target-db",
|
|
27561
|
-
"pgwatch-postgres",
|
|
27562
|
-
"pgwatch-prometheus",
|
|
27563
|
-
"postgres-exporter-sink",
|
|
27564
|
-
"flask-pgss-api",
|
|
27565
|
-
"sources-generator",
|
|
27566
|
-
"postgres-reports"
|
|
27567
|
-
];
|
|
27568
|
-
async function removeOrphanedContainers() {
|
|
27569
|
-
for (const container of MONITORING_CONTAINERS) {
|
|
27570
|
-
try {
|
|
27571
|
-
await execFilePromise("docker", ["rm", "-f", container]);
|
|
27572
|
-
} catch {}
|
|
27573
|
-
}
|
|
27574
|
-
}
|
|
27575
27549
|
mon.command("stop").description("stop monitoring services").action(async () => {
|
|
27576
27550
|
const code = await runCompose(["down"]);
|
|
27577
27551
|
if (code !== 0)
|
|
@@ -27786,8 +27760,6 @@ mon.command("clean").description("cleanup monitoring services artifacts (stops s
|
|
|
27786
27760
|
} else {
|
|
27787
27761
|
console.log("\u26A0 Could not stop services (may not be running)");
|
|
27788
27762
|
}
|
|
27789
|
-
await removeOrphanedContainers();
|
|
27790
|
-
console.log("\u2713 Removed orphaned containers");
|
|
27791
27763
|
if (!options.keepVolumes) {
|
|
27792
27764
|
const volumePatterns = [
|
|
27793
27765
|
"monitoring_grafana_data",
|
package/lib/metrics-embedded.ts
CHANGED