mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-13 05:12:55 -07:00
feat(offload): rename container to maintainer-worker and finalize COS integration
This commit is contained in:
@@ -55,6 +55,7 @@ async function provisionWorker() {
|
|||||||
'--boot-disk-size', '200GB',
|
'--boot-disk-size', '200GB',
|
||||||
'--boot-disk-type', 'pd-balanced',
|
'--boot-disk-type', 'pd-balanced',
|
||||||
'--container-image', imageUri,
|
'--container-image', imageUri,
|
||||||
|
'--container-name', 'maintainer-worker',
|
||||||
'--container-restart-policy', 'always',
|
'--container-restart-policy', 'always',
|
||||||
'--container-mount-host-path', 'host-path=/home/$(whoami)/dev,mount-path=/home/node/dev,mode=rw',
|
'--container-mount-host-path', 'host-path=/home/$(whoami)/dev,mount-path=/home/node/dev,mode=rw',
|
||||||
'--container-mount-host-path', 'host-path=/home/$(whoami)/.gemini,mount-path=/home/node/.gemini,mode=rw',
|
'--container-mount-host-path', 'host-path=/home/$(whoami)/.gemini,mount-path=/home/node/.gemini,mode=rw',
|
||||||
|
|||||||
@@ -64,9 +64,9 @@ export async function runOrchestrator(args: string[], env: NodeJS.ProcessEnv = p
|
|||||||
|
|
||||||
let tmuxCmd = `cd ${remoteWorktreeDir} && ${remoteWorker}; exec $SHELL`;
|
let tmuxCmd = `cd ${remoteWorktreeDir} && ${remoteWorker}; exec $SHELL`;
|
||||||
if (useContainer) {
|
if (useContainer) {
|
||||||
// If in container mode, we jump into the shared 'gemini-sandbox' container
|
// If in container mode, we jump into the shared 'maintainer-worker' container
|
||||||
// We must use -i and -t for the interactive tmux session
|
// We must use -i and -t for the interactive tmux session
|
||||||
tmuxCmd = `docker exec -it -w /home/node/dev/worktrees/offload-${prNumber}-${action} gemini-sandbox sh -c "${remoteWorker}; exec $SHELL"`;
|
tmuxCmd = `docker exec -it -w /home/node/dev/worktrees/offload-${prNumber}-${action} maintainer-worker sh -c "${remoteWorker}; exec $SHELL"`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const sshInternal = `tmux attach-session -t ${sessionName} 2>/dev/null || tmux new-session -s ${sessionName} -n 'offload' ${q(tmuxCmd)}`;
|
const sshInternal = `tmux attach-session -t ${sessionName} 2>/dev/null || tmux new-session -s ${sessionName} -n 'offload' ${q(tmuxCmd)}`;
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ function getStatus() {
|
|||||||
const activeSessions = tmux.stdout.toString().split('\n').filter(s => s.startsWith('offload-'));
|
const activeSessions = tmux.stdout.toString().split('\n').filter(s => s.startsWith('offload-'));
|
||||||
|
|
||||||
// 2. Scan worktrees inside the CONTAINER
|
// 2. Scan worktrees inside the CONTAINER
|
||||||
const findJobs = spawnSync('docker', ['exec', 'gemini-sandbox', 'ls', WORKTREE_BASE], { stdio: 'pipe' });
|
const findJobs = spawnSync('docker', ['exec', 'maintainer-worker', 'ls', WORKTREE_BASE], { stdio: 'pipe' });
|
||||||
const jobs = findJobs.stdout.toString().split('\n').filter(d => d.startsWith('offload-'));
|
const jobs = findJobs.stdout.toString().split('\n').filter(d => d.startsWith('offload-'));
|
||||||
|
|
||||||
if (jobs.length === 0 && activeSessions.length === 0) {
|
if (jobs.length === 0 && activeSessions.length === 0) {
|
||||||
@@ -42,11 +42,11 @@ function getStatus() {
|
|||||||
state = '🏃 RUNNING';
|
state = '🏃 RUNNING';
|
||||||
} else {
|
} else {
|
||||||
// Check logs inside the container
|
// Check logs inside the container
|
||||||
const logCheck = spawnSync('docker', ['exec', 'gemini-sandbox', 'sh', '-c', `ls ${WORKTREE_BASE}/${id}/.gemini/logs/*.log 2>/dev/null | tail -n 1`], { stdio: 'pipe' });
|
const logCheck = spawnSync('docker', ['exec', 'maintainer-worker', 'sh', '-c', `ls ${WORKTREE_BASE}/${id}/.gemini/logs/*.log 2>/dev/null | tail -n 1`], { stdio: 'pipe' });
|
||||||
const lastLogFile = logCheck.stdout.toString().trim();
|
const lastLogFile = logCheck.stdout.toString().trim();
|
||||||
|
|
||||||
if (lastLogFile) {
|
if (lastLogFile) {
|
||||||
const logContent = spawnSync('docker', ['exec', 'gemini-sandbox', 'cat', lastLogFile], { stdio: 'pipe' }).stdout.toString();
|
const logContent = spawnSync('docker', ['exec', 'maintainer-worker', 'cat', lastLogFile], { stdio: 'pipe' }).stdout.toString();
|
||||||
if (logContent.includes('SUCCESS')) state = '✅ SUCCESS';
|
if (logContent.includes('SUCCESS')) state = '✅ SUCCESS';
|
||||||
else if (logContent.includes('FAILED')) state = '❌ FAILED';
|
else if (logContent.includes('FAILED')) state = '❌ FAILED';
|
||||||
else state = '🏁 FINISHED';
|
else state = '🏁 FINISHED';
|
||||||
|
|||||||
Reference in New Issue
Block a user