Skip to content

Commit f67aa1e

Browse files
committed
[inner-loop] run Isolated docker in debug workspace
1 parent 9aebb8f commit f67aa1e

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

components/gitpod-cli/cmd/rebuild.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,10 @@ func runRebuild(ctx context.Context, supervisorClient *supervisor.SupervisorClie
262262
// volumes
263263
"-v", "/workspace:/workspace",
264264
"-v", "/.supervisor:/.supervisor",
265-
"-v", "/var/run/docker.sock:/var/run/docker.sock",
266265
"-v", "/ide:/ide",
266+
"-v", "/usr/bin/docker-up:/usr/bin/docker-up",
267+
"-v", "/usr/bin/runc-facade:/usr/bin/runc-facade",
268+
"-v", "/usr/local/bin/docker-compose:/usr/local/bin/docker-compose",
267269
// "-v", "/ide-desktop:/ide-desktop", // TODO fix desktop IDEs later
268270
// "-v", "/ide-desktop-plugins:/ide-desktop-plugins", // TODO refactor to keep all IDE deps under ide or ide-desktop
269271

components/supervisor/pkg/supervisor/supervisor.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,9 @@ func Run(options ...RunOption) {
398398
tasksSuccessChan := make(chan taskSuccess, 1)
399399
go taskManager.Run(ctx, &wg, tasksSuccessChan)
400400

401-
if !opts.RunGP && !cfg.isDebugWorkspace() {
401+
if !opts.RunGP {
402402
wg.Add(1)
403-
go socketActivationForDocker(ctx, &wg, termMux)
403+
go socketActivationForDocker(ctx, &wg, termMux, cfg.isDebugWorkspace())
404404
}
405405

406406
if cfg.isHeadless() {
@@ -1499,7 +1499,7 @@ func recordInitializerMetrics(path string, metrics *metrics.SupervisorMetrics) {
14991499
}
15001500
}
15011501

1502-
func socketActivationForDocker(ctx context.Context, wg *sync.WaitGroup, term *terminal.Mux) {
1502+
func socketActivationForDocker(ctx context.Context, wg *sync.WaitGroup, term *terminal.Mux, isDebugWorkspace bool) {
15031503
defer wg.Done()
15041504

15051505
fn := "/var/run/docker.sock"
@@ -1521,6 +1521,10 @@ func socketActivationForDocker(ctx context.Context, wg *sync.WaitGroup, term *te
15211521
cmd := exec.Command("/usr/bin/docker-up")
15221522
cmd.Env = append(os.Environ(), "LISTEN_FDS=1")
15231523
cmd.ExtraFiles = []*os.File{socketFD}
1524+
if isDebugWorkspace {
1525+
cmd.Args = append(cmd.Args, "--iface", "eth0")
1526+
cmd.Args = append(cmd.Args, "--data-root", "/workspace/.docker-root-debug")
1527+
}
15241528
alias, err := term.Start(cmd, terminal.TermOptions{
15251529
Annotations: map[string]string{
15261530
"gitpod.supervisor": "true",

0 commit comments

Comments
 (0)