Skip to content

Commit f70ab2c

Browse files
committed
log
1 parent 77aa1bf commit f70ab2c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

components/supervisor/pkg/supervisor/supervisor.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ func Run(options ...RunOption) {
239239
gitpodConfigService := config.NewConfigService(cfg.RepoRoot+"/.gitpod.yml", cstate.ContentReady(), log.Log)
240240
go gitpodConfigService.Watch(ctx)
241241

242+
log.Info("starting ports manager")
242243
portMgmt := ports.NewManager(
243244
createExposedPortsImpl(cfg, gitpodService),
244245
&ports.PollingServedPortsObserver{
@@ -249,6 +250,7 @@ func Run(options ...RunOption) {
249250
internalPorts...,
250251
)
251252

253+
log.Info("finished ports manager")
252254
if opts.RunGP {
253255
cstate.MarkContentReady(csapi.WorkspaceInitFromOther)
254256
} else {
@@ -257,6 +259,8 @@ func Run(options ...RunOption) {
257259
go analyseConfigChanges(ctx, cfg, analytics, gitpodConfigService, gitpodService)
258260
}
259261

262+
log.Info("termMux")
263+
260264
termMux := terminal.NewMux()
261265
termMuxSrv := terminal.NewMuxTerminalService(termMux)
262266
termMuxSrv.DefaultWorkdir = cfg.RepoRoot
@@ -278,6 +282,8 @@ func Run(options ...RunOption) {
278282
Gid: gitpodGID,
279283
}
280284

285+
log.Info("taskManager")
286+
281287
taskManager := newTasksManager(cfg, termMuxSrv, cstate, nil)
282288

283289
apiServices := []RegisterableService{
@@ -297,12 +303,14 @@ func Run(options ...RunOption) {
297303
}
298304
apiServices = append(apiServices, additionalServices...)
299305

306+
log.Info("installDotfiles")
300307
if !cfg.isHeadless() {
301308
// We need to checkout dotfiles first, because they may be changing the path which affects the IDE.
302309
// TODO(cw): provide better feedback if the IDE start fails because of the dotfiles (provide any feedback at all).
303310
installDotfiles(ctx, cfg, tokenService, childProcEnvvars)
304311
}
305312

313+
log.Info("ideWG")
306314
var ideWG sync.WaitGroup
307315
ideWG.Add(1)
308316
go startAndWatchIDE(ctx, cfg, &cfg.IDE, childProcEnvvars, &ideWG, cstate, ideReady, WebIDE)
@@ -1302,6 +1310,7 @@ func startSSHServer(ctx context.Context, cfg *Config, wg *sync.WaitGroup, childP
13021310
}
13031311

13041312
func startContentInit(ctx context.Context, cfg *Config, wg *sync.WaitGroup, cst ContentState) {
1313+
log.Info("starting content init")
13051314
defer wg.Done()
13061315
defer log.Info("supervisor: workspace content available")
13071316

@@ -1327,6 +1336,8 @@ func startContentInit(ctx context.Context, cfg *Config, wg *sync.WaitGroup, cst
13271336
log.Info("Detected content.json in /.workspace folder, assuming PVC feature enabled")
13281337
}
13291338

1339+
log.Infof("waiting for content.json to be available at %s", fn)
1340+
13301341
var contentFile *os.File
13311342

13321343
contentFile, err = os.Open(fn)
@@ -1341,6 +1352,7 @@ func startContentInit(ctx context.Context, cfg *Config, wg *sync.WaitGroup, cst
13411352
// TODO: rewrite using fsnotify
13421353
t := time.NewTicker(100 * time.Millisecond)
13431354
for range t.C {
1355+
log.Infof("waiting for %s to be available", fnReady)
13441356
b, err := os.ReadFile(fnReady)
13451357
if err != nil {
13461358
if !os.IsNotExist(err) {
@@ -1368,12 +1380,14 @@ func startContentInit(ctx context.Context, cfg *Config, wg *sync.WaitGroup, cst
13681380

13691381
defer contentFile.Close()
13701382

1383+
log.Info("supervisor: workspace content available")
13711384
var src csapi.WorkspaceInitSource
13721385
src, err = executor.Execute(ctx, "/workspace", contentFile, true)
13731386
if err != nil {
13741387
return
13751388
}
13761389

1390+
log.Infof("supervisor: remove %s", fn)
13771391
err = os.Remove(fn)
13781392
if os.IsNotExist(err) {
13791393
// file is gone - we're good

0 commit comments

Comments
 (0)