specmem-hardwicksoftware 3.5.20 → 3.5.21
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.
Potentially problematic release.
This version of specmem-hardwicksoftware might be problematic. Click here for more details.
package/package.json
CHANGED
|
@@ -126,6 +126,15 @@ const IS_MAC = PLATFORM === 'darwin';
|
|
|
126
126
|
const IS_LINUX = PLATFORM === 'linux';
|
|
127
127
|
const IS_WINDOWS = PLATFORM === 'win32';
|
|
128
128
|
|
|
129
|
+
// Detect if running inside Docker container
|
|
130
|
+
const IS_DOCKER = fs.existsSync('/.dockerenv') ||
|
|
131
|
+
(fs.existsSync('/proc/1/cgroup') &&
|
|
132
|
+
fs.readFileSync('/proc/1/cgroup', 'utf8').includes('docker'));
|
|
133
|
+
|
|
134
|
+
// Skip embeddings flag (for low-resource or containerized environments)
|
|
135
|
+
const SKIP_EMBEDDINGS = process.env.SPECMEM_SKIP_EMBEDDINGS === 'true' ||
|
|
136
|
+
process.env.SPECMEM_LITE === 'true';
|
|
137
|
+
|
|
129
138
|
/**
|
|
130
139
|
* Run a command and return success/output
|
|
131
140
|
*/
|
|
@@ -541,6 +550,25 @@ function adjustPgAuth() {
|
|
|
541
550
|
function setupDocker() {
|
|
542
551
|
log.header('Checking Docker');
|
|
543
552
|
|
|
553
|
+
// Skip if requested or in lite mode
|
|
554
|
+
if (SKIP_EMBEDDINGS) {
|
|
555
|
+
log.info('Skipping Docker/embeddings setup (SPECMEM_SKIP_EMBEDDINGS=true)');
|
|
556
|
+
log.info('SpecMem will use API-based embeddings as fallback');
|
|
557
|
+
return true;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
// Warn if running inside Docker (Docker-in-Docker is complex)
|
|
561
|
+
if (IS_DOCKER) {
|
|
562
|
+
log.warn('Running inside Docker container detected!');
|
|
563
|
+
log.info('Docker-in-Docker requires special setup.');
|
|
564
|
+
log.info('Options:');
|
|
565
|
+
log.info(' 1. Mount host Docker socket: -v /var/run/docker.sock:/var/run/docker.sock');
|
|
566
|
+
log.info(' 2. Use privileged mode: --privileged');
|
|
567
|
+
log.info(' 3. Skip local embeddings: export SPECMEM_SKIP_EMBEDDINGS=true');
|
|
568
|
+
log.info('');
|
|
569
|
+
log.info('Attempting to continue anyway...');
|
|
570
|
+
}
|
|
571
|
+
|
|
544
572
|
// Check if Docker is already installed
|
|
545
573
|
if (commandExists('docker')) {
|
|
546
574
|
log.success('Docker is installed');
|
|
@@ -608,7 +636,25 @@ function startDockerDaemon() {
|
|
|
608
636
|
return false;
|
|
609
637
|
|
|
610
638
|
} else if (IS_LINUX) {
|
|
611
|
-
//
|
|
639
|
+
// In Docker container, systemctl won't work
|
|
640
|
+
if (IS_DOCKER) {
|
|
641
|
+
log.warn('Inside Docker container - systemctl unavailable');
|
|
642
|
+
log.info('Checking if Docker socket is mounted...');
|
|
643
|
+
|
|
644
|
+
if (fs.existsSync('/var/run/docker.sock')) {
|
|
645
|
+
if (run('docker info', { silent: true }).success) {
|
|
646
|
+
log.success('Docker socket available (mounted from host)');
|
|
647
|
+
return true;
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
log.warn('Docker socket not available in container');
|
|
652
|
+
log.info('SpecMem will work without local embeddings');
|
|
653
|
+
log.info('To enable: run container with -v /var/run/docker.sock:/var/run/docker.sock');
|
|
654
|
+
return false;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
// Try systemctl first (only on non-containerized Linux)
|
|
612
658
|
log.step(1, 'Starting Docker via systemctl...');
|
|
613
659
|
run('sudo systemctl start docker');
|
|
614
660
|
run('sudo systemctl enable docker');
|