Skip to content

Commit c2eb066

Browse files
committed
wip
1 parent 7589698 commit c2eb066

File tree

5 files changed

+1
-23
lines changed

5 files changed

+1
-23
lines changed

components/content-service/pkg/initializer/download.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ func (ws *fileDownloadInitializer) Run(ctx context.Context, mappings []archive.I
5656
return src, err
5757
}
5858
}
59-
log.Info("fileDownloadInitializer run")
6059
return csapi.WorkspaceInitFromOther, nil
6160
}
6261

components/content-service/pkg/initializer/git.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ func (ws *GitInitializer) Run(ctx context.Context, mappings []archive.IDMapping)
6464
span.SetTag("isGitWS", isGitWS)
6565
defer tracing.FinishSpan(span, &err)
6666

67-
log.Info("GitInitializer run")
6867
src = csapi.WorkspaceInitFromOther
6968
if isGitWS {
7069
log.WithField("stage", "init").WithField("location", ws.Location).Info("Not running git clone. Workspace is already a Git workspace")

components/content-service/pkg/initializer/initializer.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ type EmptyInitializer struct{}
5555

5656
// Run does nothing
5757
func (e *EmptyInitializer) Run(ctx context.Context, mappings []archive.IDMapping) (csapi.WorkspaceInitSource, error) {
58-
log.Info("empty initializer")
5958
return csapi.WorkspaceInitFromOther, nil
6059
}
6160

@@ -65,7 +64,6 @@ type CompositeInitializer []Initializer
6564
// Run calls run on all child initializers
6665
func (e CompositeInitializer) Run(ctx context.Context, mappings []archive.IDMapping) (_ csapi.WorkspaceInitSource, err error) {
6766
span, ctx := opentracing.StartSpanFromContext(ctx, "CompositeInitializer.Run")
68-
log.Info("composite initializer")
6967
defer tracing.FinishSpan(span, &err)
7068
for _, init := range e {
7169
_, err := init.Run(ctx, mappings)
@@ -391,7 +389,6 @@ func InitializeWorkspace(ctx context.Context, location string, remoteStorage sto
391389
o(&cfg)
392390
}
393391

394-
log.Info("InitializeWorkspace")
395392
src = csapi.WorkspaceInitFromOther
396393

397394
// Note: it's important that CleanSlate does not remove the location itself, but merely its content.
@@ -435,11 +432,9 @@ func InitializeWorkspace(ctx context.Context, location string, remoteStorage sto
435432

436433
span.SetTag("hasBackup", hasBackup)
437434
if hasBackup {
438-
log.Info("has backup")
439435
src = csapi.WorkspaceInitFromBackup
440436
} else {
441437
src, err = cfg.Initializer.Run(ctx, cfg.mappings)
442-
log.Infof("src from initializer run: %v", src)
443438
if err != nil {
444439
return src, xerrors.Errorf("cannot initialize workspace: %w", err)
445440
}
@@ -491,7 +486,6 @@ func EnsureCleanDotGitpodDirectory(ctx context.Context, wspath string) error {
491486

492487
// PlaceWorkspaceReadyFile writes a file in the workspace which indicates that the workspace has been initialized
493488
func PlaceWorkspaceReadyFile(ctx context.Context, wspath string, initsrc csapi.WorkspaceInitSource, uid, gid int) (err error) {
494-
log.Infof("PlaceWorkspaceReadyFile: %s, %v", wspath, initsrc)
495489
//nolint:ineffassign,staticcheck
496490
span, ctx := opentracing.StartSpanFromContext(ctx, "placeWorkspaceReadyFile")
497491
span.SetTag("source", initsrc)

components/content-service/pkg/layer/provider.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,6 @@ func (s *Provider) GetContentLayerPVC(ctx context.Context, owner, workspaceID st
290290
// At this point we've found neither a full-workspace-backup, nor a legacy backup.
291291
// It's time to use the initializer.
292292
if gis := initializer.GetSnapshot(); gis != nil {
293-
log.Infof("GetContentLayerPVC: GetSnapshot. %v", gis.FromVolumeSnapshot)
294293
if gis.FromVolumeSnapshot {
295294
layer, err = contentDescriptorToLayerPVC([]byte{})
296295
if err != nil {
@@ -307,7 +306,6 @@ func (s *Provider) GetContentLayerPVC(ctx context.Context, owner, workspaceID st
307306
return s.getSnapshotContentLayer(ctx, gis)
308307
}
309308
if pis := initializer.GetPrebuild(); pis != nil {
310-
log.Infof("GetContentLayerPVC: GetPrebuild. %v", pis.Prebuild.FromVolumeSnapshot)
311309
if pis.Prebuild.FromVolumeSnapshot {
312310
layer, err = contentDescriptorToLayerPVC([]byte{})
313311
if err != nil {
@@ -413,7 +411,7 @@ func (s *Provider) getSnapshotContentLayer(ctx context.Context, sp *csapi.Snapsh
413411
}
414412

415413
// we've found a manifest for this fwb snapshot - let's use it
416-
l, err = s.layerFromContentManifest(ctx, manifest, csapi.WorkspaceInitFromPrebuild, true)
414+
l, err = s.layerFromContentManifest(ctx, manifest, csapi.WorkspaceInitFromOther, true)
417415
return l, manifest, nil
418416
}
419417

@@ -422,8 +420,6 @@ func (s *Provider) getPrebuildContentLayer(ctx context.Context, pb *csapi.Prebui
422420
defer tracing.FinishSpan(span, &err)
423421
span.LogKV("isPVC", isPVC)
424422

425-
log.Infof("getPrebuildContentLayer: %v", isPVC)
426-
427423
segs := strings.Split(pb.Prebuild.Snapshot, "@")
428424
if len(segs) != 2 {
429425
return nil, nil, xerrors.Errorf("invalid snapshot FQN: %s", pb.Prebuild.Snapshot)
@@ -487,7 +483,6 @@ func (s *Provider) getPrebuildContentLayer(ctx context.Context, pb *csapi.Prebui
487483
}
488484

489485
func (s *Provider) layerFromContentManifest(ctx context.Context, mf *csapi.WorkspaceContentManifest, initsrc csapi.WorkspaceInitSource, ready bool) (l []Layer, err error) {
490-
log.Infof("layerFromContentManifest: %v, %v", ready, initsrc)
491486
// we have a valid full workspace backup
492487
l = make([]Layer, len(mf.Layers))
493488
for i, mfl := range mf.Layers {
@@ -540,22 +535,19 @@ var pvcEnabledFile = `PVC`
540535
// we cannot use /workspace folder as when mounting /workspace folder through PVC
541536
// it will mask anything that was in container layer, hence we are using /.workspace instead here
542537
func contentDescriptorToLayerPVC(cdesc []byte) (*Layer, error) {
543-
log.Info("contentDescriptorToLayerPVC")
544538
layers := []fileInLayer{
545539
{&tar.Header{Typeflag: tar.TypeDir, Name: "/.workspace", Uid: initializer.GitpodUID, Gid: initializer.GitpodGID, Mode: 0755}, nil},
546540
{&tar.Header{Typeflag: tar.TypeDir, Name: "/.workspace/.gitpod", Uid: initializer.GitpodUID, Gid: initializer.GitpodGID, Mode: 0755}, nil},
547541
{&tar.Header{Typeflag: tar.TypeReg, Name: "/.workspace/.gitpod/pvc", Uid: 0, Gid: 0, Mode: 0775, Size: int64(len(pvcEnabledFile))}, []byte(pvcEnabledFile)},
548542
{&tar.Header{Typeflag: tar.TypeReg, Name: "/.supervisor/prestophook.sh", Uid: 0, Gid: 0, Mode: 0775, Size: int64(len(prestophookScript))}, []byte(prestophookScript)},
549543
}
550544
if len(cdesc) > 0 {
551-
log.Infof("contentDescriptorToLayerPVC: %v", string(cdesc))
552545
layers = append(layers, fileInLayer{&tar.Header{Typeflag: tar.TypeReg, Name: "/.workspace/.gitpod/content.json", Uid: initializer.GitpodUID, Gid: initializer.GitpodGID, Mode: 0755, Size: int64(len(cdesc))}, cdesc})
553546
}
554547
return layerFromContent(layers...)
555548
}
556549

557550
func workspaceReadyLayerPVC(src csapi.WorkspaceInitSource) (*Layer, error) {
558-
log.Infof("workspaceReadyLayerPVC: %v", src)
559551
msg := csapi.WorkspaceReadyMessage{
560552
Source: src,
561553
}
@@ -572,7 +564,6 @@ func workspaceReadyLayerPVC(src csapi.WorkspaceInitSource) (*Layer, error) {
572564
}
573565

574566
func workspaceReadyLayer(src csapi.WorkspaceInitSource) (*Layer, error) {
575-
log.Infof("workspaceReadyLayer: %v", src)
576567
msg := csapi.WorkspaceReadyMessage{
577568
Source: src,
578569
}

components/supervisor/pkg/supervisor/tasks.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -385,15 +385,13 @@ func getHistfileCommand(task *task, commands []*string, contentSource csapi.Work
385385
}
386386

387387
func getCommands(task *task, isHeadless bool, contentSource csapi.WorkspaceInitSource, storeLocation string) []*string {
388-
log.Infof("getCommands: %v", contentSource)
389388
if isHeadless {
390389
// prebuild
391390
return []*string{task.config.Before, task.config.Init, task.config.Prebuild}
392391
}
393392
if contentSource == csapi.WorkspaceInitFromPrebuild {
394393
// prebuilt
395394
prebuildLogFileName := prebuildLogFileName(task, storeLocation)
396-
log.Infof("getCommands: prebuild: %s", prebuildLogFileName)
397395
legacyPrebuildLogFileName := logs.LegacyPrebuildLogFileName(task.Id)
398396
printlogs := "[ -r " + legacyPrebuildLogFileName + " ] && cat " + legacyPrebuildLogFileName + "; [ -r " + prebuildLogFileName + " ] && cat " + prebuildLogFileName + "; true"
399397
return []*string{task.config.Before, &printlogs, task.config.Command}
@@ -430,7 +428,6 @@ func (tm *tasksManager) watch(task *task, term *terminal.Term) {
430428
fileName = prebuildLogFileName(task, tm.storeLocation)
431429
oldFileName = fileName + "-old"
432430
)
433-
log.Infof("writing prebuild logs to %s", fileName)
434431
if _, err := os.Stat(fileName); err == nil {
435432
// If the file already exists (from a parent prebuild), temporarily move it so that it doesn't get truncated.
436433
// On the off chance that renaming fails here, we silently ignore that -- the new prebuild logs simply won't reflect
@@ -489,9 +486,7 @@ func (tm *tasksManager) watch(task *task, term *terminal.Term) {
489486
}
490487

491488
func importParentLogAndGetDuration(fn string, out io.Writer) time.Duration {
492-
log.Infof("Importing parent prebuild log from %s", fn)
493489
if _, err := os.Stat(fn); err != nil {
494-
log.Info("No parent prebuild log found")
495490
return 0
496491
}
497492
defer os.Remove(fn)

0 commit comments

Comments
 (0)