@aifabrix/builder 2.3.4 → 2.3.5
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 +0 -6
- package/bin/aifabrix.js +0 -0
- package/lib/infra.js +1 -1
- package/lib/secrets.js +1 -1
- package/lib/utils/infra-containers.js +24 -13
- package/package.json +1 -1
package/README.md
CHANGED
package/bin/aifabrix.js
CHANGED
|
File without changes
|
package/lib/infra.js
CHANGED
|
@@ -123,7 +123,7 @@ async function startInfra(developerId = null) {
|
|
|
123
123
|
// Dev 0: infra-aifabrix-network, Dev > 0: infra-dev{id}-aifabrix-network
|
|
124
124
|
const networkName = idNum === 0 ? 'infra-aifabrix-network' : `infra-dev${devId}-aifabrix-network`;
|
|
125
125
|
const composeContent = template({
|
|
126
|
-
devId:
|
|
126
|
+
devId: idNum,
|
|
127
127
|
postgresPort: ports.postgres,
|
|
128
128
|
redisPort: ports.redis,
|
|
129
129
|
pgadminPort: ports.pgadmin,
|
package/lib/secrets.js
CHANGED
|
@@ -438,7 +438,7 @@ async function generateAdminSecretsEnv(secretsPath) {
|
|
|
438
438
|
POSTGRES_PASSWORD=${postgresPassword}
|
|
439
439
|
PGADMIN_DEFAULT_EMAIL=admin@aifabrix.ai
|
|
440
440
|
PGADMIN_DEFAULT_PASSWORD=${postgresPassword}
|
|
441
|
-
REDIS_HOST=local:
|
|
441
|
+
REDIS_HOST=local:redis:6379
|
|
442
442
|
REDIS_COMMANDER_USER=admin
|
|
443
443
|
REDIS_COMMANDER_PASSWORD=${postgresPassword}
|
|
444
444
|
`;
|
|
@@ -28,21 +28,32 @@ async function findContainer(serviceName, devId = null) {
|
|
|
28
28
|
const developerId = devId || await config.getDeveloperId();
|
|
29
29
|
const idNum = typeof developerId === 'string' ? parseInt(developerId, 10) : developerId;
|
|
30
30
|
// Dev 0: aifabrix-{serviceName}, Dev > 0: aifabrix-dev{id}-{serviceName}
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
31
|
+
const primaryPattern = idNum === 0 ? `aifabrix-${serviceName}` : `aifabrix-dev${developerId}-${serviceName}`;
|
|
32
|
+
|
|
33
|
+
// Search order expected by tests:
|
|
34
|
+
// 1) primaryPattern
|
|
35
|
+
// 2) infra-{serviceName} (old pattern)
|
|
36
|
+
// 3) aifabrix-{serviceName} (base pattern)
|
|
37
|
+
const patternsToTry = [
|
|
38
|
+
primaryPattern,
|
|
39
|
+
`infra-${serviceName}`,
|
|
40
|
+
`aifabrix-${serviceName}`
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
for (const pattern of patternsToTry) {
|
|
44
|
+
const { stdout } = await execAsync(`docker ps --filter "name=${pattern}" --format "{{.Names}}"`);
|
|
45
|
+
const names = stdout
|
|
46
|
+
.split('\n')
|
|
47
|
+
.map(s => s.trim())
|
|
48
|
+
.filter(s => s.length > 0);
|
|
49
|
+
const exactMatch = names.find(n => n === pattern);
|
|
50
|
+
if (exactMatch || names[0]) {
|
|
51
|
+
return exactMatch || names[0];
|
|
43
52
|
}
|
|
44
53
|
}
|
|
45
|
-
|
|
54
|
+
|
|
55
|
+
// Not found with any pattern
|
|
56
|
+
return '';
|
|
46
57
|
} catch (error) {
|
|
47
58
|
return null;
|
|
48
59
|
}
|