본문으로 건너뛰기
cccskills
무료GitHub에 공개

run-dev

Build, test, and format CubeSandbox components using make targets and a Docker builder. Also covers the web dashboard’s development workflow, API type synchronization, and troubleshooting for missing services, outdated build tools, and environment requirements.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

Build, test, format, and develop CubeSandbox components. Use when asked to build, compile, run tests, format code, or do development work on this project.

연동 도구DockerRedis
설치 방법 보기

이럴 때 유용합니다

  • Build all components or a specific CubeSandbox component
  • Run component tests or a single targeted test
  • Format Go and Rust code and lint the web interface
  • Start the web dashboard and synchronize API types
  • Investigate build failures and missing test dependencies

포함된 파일(1)

  • SKILL.md6.8 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

CubeSandbox Development Skill

CubeSandbox is a monorepo sandbox service (Go + Rust + Web). All component builds run inside a Docker builder container via make targets at the repo root. The builder image provides Go 1.24, Rust 1.89, protoc, and all build dependencies.

Paths in this document are relative to the repo root

Prerequisites

# Docker must be running
docker info > /dev/null 2>&1 || { echo "Docker is not running"; exit 1; }

The builder image is built once (or when toolchains change):

make builder-image

Build

All builds happen inside the cube-sandbox-builder:ubuntu2004 Docker image. Binaries land in _output/bin/.

Build all Go components

make all

This builds: cubemaster, cubelet, cubevsmapdump, network-agent, agent, cubeapi, shim.

Build individual components

CommandComponentLanguageTime
make cubemasterMaster scheduler + CLIGo~30s
make cubeletPer-node sandbox agent + CLIGo + Rust (cubecow SDK)~90s
make agentIn-guest agent daemonRust~2min
make cubeapi or make cube-apiE2B-compatible REST APIRust (musl)~3min
make shimcontainerd shim + runtimeRust~2min
make network-agentNetwork managementGo~30s
make cubevsmapdumpeBPF map dump toolGo~20s
make cube-proxy-sidecarProxy sidecar (dev only)Go~20s
make cubecow-smokeCubeCoW smoke testGo + Rust~60s
make cube-init / make guest-initGuest PID1 (cube-init)Rust (musl)~30s
make agent-ext4 / make cube-agent-ext4Independent cube-agent.ext4 (+ version)Rust + e2fsprogs~2min
make pmem-assetscube-init + agent-ext4—~2min

Agent-independent pmem outputs:

make cube-init     # → _output/bin/cube-init
make agent-ext4    # → _output/cube-agent/cube-agent.ext4 (+ version)
make pmem-assets   # both of the above

Verify a build

# Check files in `_output/bin/`
file _output/bin/cubemaster

Test

Tests run inside the builder container. Some tests need external services (Redis, KVM) and will fail without them — see Gotchas.

Run component tests

# Agent tests (Rust) — 101+ tests, most pass without KVM
make builder-run BUILDER_CMD='cd /workspace/agent && make test'

# CubeMaster tests (Go) — unit-style cmd and pkg packages
make cubemaster-test

# Cubelet tests (Go) — full self-contained set (all packages except api/ and
# integration/); root/host-capability tests probe and skip themselves
make cubelet-test

# Cubelet mount tests — focused privileged lane for CAP_SYS_ADMIN tests
make cubelet-mount-test

# CubeCoW native tests (Go + CGO, needs cubecow SDK built)
make cubecow-test-native

# Integration tests — require a running CubeSandbox cluster (dev-env or one-click deploy)

Run a single test

# CubeMaster: single package with verbose output
make builder-run BUILDER_CMD='cd /workspace/CubeMaster && CI=true CUBE_MASTER_CONFIG_PATH=/workspace/CubeMaster/test/conf.yaml go test -v -run TestSomething ./pkg/base/...'

# Agent: single test
make builder-run BUILDER_CMD='cd /workspace/agent && cargo test -p cube-agent test_name'

Format and Lint

# Format all components (Go + Rust)
make fmt

# Web UI lint
make web-lint

For a single component:

# Go component
make builder-run BUILDER_CMD='cd /workspace/CubeMaster && make fmt'

# Rust component — fmt automatically runs in builder
make builder-run BUILDER_CMD='cd /workspace/CubeAPI && cargo fmt --check'

Web UI

The web dashboard lives in web/ (Vite + Vue + TypeScript).

make web-install     # Install npm dependencies (~30s)
make web-build       # Build static assets → web/dist/ (~2s)
make web-dev         # Start Vite dev server (localhost:5173)
make web-lint        # Lint check
make web-preview     # Preview built assets

Sync OpenAPI types after CubeAPI changes:

make web-api-sync

Gotchas

  1. Tests need Redis/KVM/MicroVM context.

    • CubeMaster/pkg/base/wrapredis tests panic if Redis is not reachable.
    • agent sandbox tests (9 of 110) fail without a running KVM MicroVM.
    • Run with -short or filter to the relevant package when iterating.
  2. CubeMaster tests use CUBE_MASTER_CONFIG_PATH. Must be set to test/conf.yaml inside the container (absolute path from /workspace).

  3. go covdata not available. The builder's Go toolchain (1.25) removed covdata. Use -coverprofile directly or skip coverage:

    go test -short ./pkg/...    # no coverage flag
    
  4. Builder container runs as host UID:GID. The builder-run target mounts the workspace with --user $(UID):$(GID). Files written by the builder (e.g., _output/bin/*) are owned by the host user.

  5. All builds are sequential. The Makefile uses builder-run which spawns one Docker container per target. Building make all runs each component sequentially. For parallel builds, use separate terminals or background processes.

  6. Agent build runs embedded unit tests before linking. make agent includes cargo test for the logging crate as part of the build. These are pure unit tests and always pass.

  7. CubeCoW SDK must be built before cubelet. make cubelet handles this automatically via the cubecow-sdk dependency, but if you build cubelet outside the make flow, run make cubecow-sdk first.

  8. KVM required for running sandboxes. Building works without KVM, but actually creating/starting sandboxes needs /dev/kvm with nested virtualization enabled. This container has it (/dev/kvm exists with nested=Y).

Troubleshooting

SymptomFix
docker: Cannot connectDocker daemon not running. sudo systemctl start docker
make: *** [builder-image] ErrorDocker build failed. Check network, retry with make builder-image BUILDER_FORCE_REBUILD=1. From China, add MIRROR=cn to source the clang-14 apt packages from a China mirror
error: protoc not installed inside builderBuilder image is outdated. Rebuild: make builder-image BUILDER_FORCE_REBUILD=1
go: no such tool "covdata"Don't use -coverprofile flag with make test in CubeMaster. Use raw go test instead.
cargo: command not found on hostRust builds run inside Docker. Use make <target>, not raw cargo.
Build hangs on "Download modules"Go module download is slow. The builder persists GOPATH at ~/.cache/cube-sandbox-builder/go, so retry is faster.
panic: nil pointer dereference in Redis testExpected — no Redis in builder. Filter: -run 'Test[^D]' or skip wrapredis package.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Run Python code and Shell commands in an isolated Cube Sandbox environment. The skill covers file access, host directory mounting, network restrictions, and pausing and resuming execution while preserving the sandbox's memory state.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Running untrusted code in an isolated environment
  • Reading and writing sandbox files
  • Restricting outbound network access
TencentCloud/CubeSandbox1.3만2026년 10월 18일 업데이트

TencentCloud의 스킬 모두 보기

이 스킬의 문제 신고