Skip to content

Commit bb2ce4a

Browse files
committed
feat: update default template base image from sandbox/base to uhub.service.ucloud.cn/agentbox/e2bdev/base:latest in template generation and tests.
1 parent 4562694 commit bb2ce4a

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

src/commands/template/init.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async function generateTemplateFiles(
2828
memoryMB?: number
2929
): Promise<GeneratedFiles> {
3030
const template = Template()
31-
.fromImage('sandbox/base')
31+
.fromImage('uhub.service.ucloud.cn/agentbox/e2bdev/base:latest')
3232
.runCmd('echo Hello World Sandbox!')
3333

3434
return generateAndWriteTemplateFiles(
@@ -258,10 +258,13 @@ export const initCommand = new commander.Command('init')
258258
await fs.promises.mkdir(templateDir, { recursive: true })
259259

260260
// Step 4: Generate template and build files in the template directory
261+
// Default to 2 CPU cores and 2GB memory (2048 MB)
261262
const generatedFiles = await generateTemplateFiles(
262263
templateDir,
263264
templateName,
264-
language
265+
language,
266+
2, // cpuCount: 2 cores
267+
2048 // memoryMB: 2GB
265268
)
266269

267270
// Step 5: Add scripts

tests/commands/template/init.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ build/%:
257257
expect(templateContent).toContain("import { Template } from 'ucloud_sandbox'")
258258
expect(templateContent).toContain('export const template = Template()')
259259
expect(templateContent).toContain('fromImage')
260-
expect(templateContent).toContain('sandbox/base')
260+
expect(templateContent).toContain('uhub.service.ucloud.cn/agentbox/e2bdev/base:latest')
261261
})
262262

263263
test('should generate correct Python template content', async () => {
@@ -277,7 +277,7 @@ build/%:
277277
expect(templateContent).toContain('template = (')
278278
expect(templateContent).toContain('Template()')
279279
expect(templateContent).toContain('from_image')
280-
expect(templateContent).toContain('sandbox/base')
280+
expect(templateContent).toContain('uhub.service.ucloud.cn/agentbox/e2bdev/base:latest')
281281
})
282282

283283
test('should generate correct async Python template content', async () => {

0 commit comments

Comments
 (0)