refactor(setup): drop Apple Container support
Apple Container is no longer supported — the runtime abstraction in src/container-runtime.ts is already Docker-only. Remove the remaining setup-time branches that probed for it: the Apple Container runtime option in the container build step, the APPLE_CONTAINER field emitted by the environment check, and the `command -v container` probe in verify. `--runtime docker` still parses for backwards compatibility with the /setup skill. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -10,7 +10,9 @@ import { commandExists } from './platform.js';
|
|||||||
import { emitStatus } from './status.js';
|
import { emitStatus } from './status.js';
|
||||||
|
|
||||||
function parseArgs(args: string[]): { runtime: string } {
|
function parseArgs(args: string[]): { runtime: string } {
|
||||||
let runtime = '';
|
// `--runtime` is still accepted for backwards compatibility with the /setup
|
||||||
|
// skill, but `docker` is the only supported value.
|
||||||
|
let runtime = 'docker';
|
||||||
for (let i = 0; i < args.length; i++) {
|
for (let i = 0; i < args.length; i++) {
|
||||||
if (args[i] === '--runtime' && args[i + 1]) {
|
if (args[i] === '--runtime' && args[i + 1]) {
|
||||||
runtime = args[i + 1];
|
runtime = args[i + 1];
|
||||||
@@ -26,34 +28,19 @@ export async function run(args: string[]): Promise<void> {
|
|||||||
const image = 'nanoclaw-agent:latest';
|
const image = 'nanoclaw-agent:latest';
|
||||||
const logFile = path.join(projectRoot, 'logs', 'setup.log');
|
const logFile = path.join(projectRoot, 'logs', 'setup.log');
|
||||||
|
|
||||||
if (!runtime) {
|
if (runtime !== 'docker') {
|
||||||
emitStatus('SETUP_CONTAINER', {
|
|
||||||
RUNTIME: 'unknown',
|
|
||||||
IMAGE: image,
|
|
||||||
BUILD_OK: false,
|
|
||||||
TEST_OK: false,
|
|
||||||
STATUS: 'failed',
|
|
||||||
ERROR: 'missing_runtime_flag',
|
|
||||||
LOG: 'logs/setup.log',
|
|
||||||
});
|
|
||||||
process.exit(4);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Validate runtime availability
|
|
||||||
if (runtime === 'apple-container' && !commandExists('container')) {
|
|
||||||
emitStatus('SETUP_CONTAINER', {
|
emitStatus('SETUP_CONTAINER', {
|
||||||
RUNTIME: runtime,
|
RUNTIME: runtime,
|
||||||
IMAGE: image,
|
IMAGE: image,
|
||||||
BUILD_OK: false,
|
BUILD_OK: false,
|
||||||
TEST_OK: false,
|
TEST_OK: false,
|
||||||
STATUS: 'failed',
|
STATUS: 'failed',
|
||||||
ERROR: 'runtime_not_available',
|
ERROR: 'unknown_runtime',
|
||||||
LOG: 'logs/setup.log',
|
LOG: 'logs/setup.log',
|
||||||
});
|
});
|
||||||
process.exit(2);
|
process.exit(4);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (runtime === 'docker') {
|
|
||||||
if (!commandExists('docker')) {
|
if (!commandExists('docker')) {
|
||||||
emitStatus('SETUP_CONTAINER', {
|
emitStatus('SETUP_CONTAINER', {
|
||||||
RUNTIME: runtime,
|
RUNTIME: runtime,
|
||||||
@@ -66,6 +53,7 @@ export async function run(args: string[]): Promise<void> {
|
|||||||
});
|
});
|
||||||
process.exit(2);
|
process.exit(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
execSync('docker info', { stdio: 'ignore' });
|
execSync('docker info', { stdio: 'ignore' });
|
||||||
} catch {
|
} catch {
|
||||||
@@ -80,24 +68,9 @@ export async function run(args: string[]): Promise<void> {
|
|||||||
});
|
});
|
||||||
process.exit(2);
|
process.exit(2);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!['apple-container', 'docker'].includes(runtime)) {
|
const buildCmd = 'docker build';
|
||||||
emitStatus('SETUP_CONTAINER', {
|
const runCmd = 'docker';
|
||||||
RUNTIME: runtime,
|
|
||||||
IMAGE: image,
|
|
||||||
BUILD_OK: false,
|
|
||||||
TEST_OK: false,
|
|
||||||
STATUS: 'failed',
|
|
||||||
ERROR: 'unknown_runtime',
|
|
||||||
LOG: 'logs/setup.log',
|
|
||||||
});
|
|
||||||
process.exit(4);
|
|
||||||
}
|
|
||||||
|
|
||||||
const buildCmd =
|
|
||||||
runtime === 'apple-container' ? 'container build' : 'docker build';
|
|
||||||
const runCmd = runtime === 'apple-container' ? 'container' : 'docker';
|
|
||||||
|
|
||||||
// Build-args from .env. Only INSTALL_CJK_FONTS is passed through today.
|
// Build-args from .env. Only INSTALL_CJK_FONTS is passed through today.
|
||||||
// Keeps /setup and ./container/build.sh in sync — both read the same source.
|
// Keeps /setup and ./container/build.sh in sync — both read the same source.
|
||||||
|
|||||||
@@ -21,12 +21,6 @@ export async function run(_args: string[]): Promise<void> {
|
|||||||
const wsl = isWSL();
|
const wsl = isWSL();
|
||||||
const headless = isHeadless();
|
const headless = isHeadless();
|
||||||
|
|
||||||
// Check Apple Container
|
|
||||||
let appleContainer: 'installed' | 'not_found' = 'not_found';
|
|
||||||
if (commandExists('container')) {
|
|
||||||
appleContainer = 'installed';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check Docker
|
// Check Docker
|
||||||
let docker: 'running' | 'installed_not_running' | 'not_found' = 'not_found';
|
let docker: 'running' | 'installed_not_running' | 'not_found' = 'not_found';
|
||||||
if (commandExists('docker')) {
|
if (commandExists('docker')) {
|
||||||
@@ -78,7 +72,6 @@ export async function run(_args: string[]): Promise<void> {
|
|||||||
{
|
{
|
||||||
platform,
|
platform,
|
||||||
wsl,
|
wsl,
|
||||||
appleContainer,
|
|
||||||
docker,
|
docker,
|
||||||
hasEnv,
|
hasEnv,
|
||||||
hasAuth,
|
hasAuth,
|
||||||
@@ -91,7 +84,6 @@ export async function run(_args: string[]): Promise<void> {
|
|||||||
PLATFORM: platform,
|
PLATFORM: platform,
|
||||||
IS_WSL: wsl,
|
IS_WSL: wsl,
|
||||||
IS_HEADLESS: headless,
|
IS_HEADLESS: headless,
|
||||||
APPLE_CONTAINER: appleContainer,
|
|
||||||
DOCKER: docker,
|
DOCKER: docker,
|
||||||
HAS_ENV: hasEnv,
|
HAS_ENV: hasEnv,
|
||||||
HAS_AUTH: hasAuth,
|
HAS_AUTH: hasAuth,
|
||||||
|
|||||||
@@ -84,16 +84,11 @@ export async function run(_args: string[]): Promise<void> {
|
|||||||
|
|
||||||
// 2. Check container runtime
|
// 2. Check container runtime
|
||||||
let containerRuntime = 'none';
|
let containerRuntime = 'none';
|
||||||
try {
|
|
||||||
execSync('command -v container', { stdio: 'ignore' });
|
|
||||||
containerRuntime = 'apple-container';
|
|
||||||
} catch {
|
|
||||||
try {
|
try {
|
||||||
execSync('docker info', { stdio: 'ignore' });
|
execSync('docker info', { stdio: 'ignore' });
|
||||||
containerRuntime = 'docker';
|
containerRuntime = 'docker';
|
||||||
} catch {
|
} catch {
|
||||||
// No runtime
|
// Docker not running
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. Check credentials
|
// 3. Check credentials
|
||||||
|
|||||||
Reference in New Issue
Block a user