diff --git a/pkg/worker/image.go b/pkg/worker/image.go index facd5f20d..3cef2cbb3 100644 --- a/pkg/worker/image.go +++ b/pkg/worker/image.go @@ -128,15 +128,15 @@ func (c *ImageClient) PullLazy(ctx context.Context, request *types.ContainerRequ if _, err := os.Stat(baseBlobFsContentPath); err == nil && c.cacheClient.IsPathCachedNearby(ctx, "/"+sourcePath) { localCachePath = baseBlobFsContentPath } else { - outputLogger.Info(fmt.Sprintf("Image <%s> not found in worker region, caching nearby", imageId)) + outputLogger.Info(fmt.Sprintf("Image <%s> not found in worker region, caching nearby\n", imageId)) // Otherwise, lets cache it in a nearby blobcache host _, err := c.cacheClient.StoreContentFromSource(sourcePath, sourceOffset) if err == nil { localCachePath = baseBlobFsContentPath - outputLogger.Info(fmt.Sprintf("Image <%s> cached in worker's region", imageId)) + outputLogger.Info(fmt.Sprintf("Image <%s> cached in worker region\n", imageId)) } else { - outputLogger.Info(fmt.Sprintf("Failed to cache image in worker's region <%s>: %v", imageId, err)) + outputLogger.Info(fmt.Sprintf("Failed to cache image in worker's region <%s>: %v\n", imageId, err)) } } } diff --git a/pkg/worker/lifecycle.go b/pkg/worker/lifecycle.go index b48091901..1ad0cc6a9 100644 --- a/pkg/worker/lifecycle.go +++ b/pkg/worker/lifecycle.go @@ -240,7 +240,7 @@ func (s *Worker) RunContainer(ctx context.Context, request *types.ContainerReque InitialSpec: initialBundleSpec, } - err = s.containerMountManager.SetupContainerMounts(request) + err = s.containerMountManager.SetupContainerMounts(request, outputLogger) if err != nil { s.containerLogger.Log(request.ContainerId, request.StubId, fmt.Sprintf("failed to setup container mounts: %v", err)) } diff --git a/pkg/worker/mount.go b/pkg/worker/mount.go index 3b4537e60..e4d891df9 100644 --- a/pkg/worker/mount.go +++ b/pkg/worker/mount.go @@ -2,6 +2,7 @@ package worker import ( "fmt" + "log/slog" "os" "path" @@ -25,7 +26,7 @@ func NewContainerMountManager(config types.AppConfig) *ContainerMountManager { } // SetupContainerMounts initializes any external storage for a container -func (c *ContainerMountManager) SetupContainerMounts(request *types.ContainerRequest) error { +func (c *ContainerMountManager) SetupContainerMounts(request *types.ContainerRequest, outputLogger *slog.Logger) error { // Create local workspace path so we can symlink volumes before the container starts os.MkdirAll(defaultContainerDirectory, os.FileMode(0755)) @@ -42,12 +43,14 @@ func (c *ContainerMountManager) SetupContainerMounts(request *types.ContainerReq } if m.MountType == storage.StorageModeMountPoint && m.MountPointConfig != nil { + log.Info().Interface("mount", m).Interface("config", m.MountPointConfig).Msg("setting up container mounts") // Add containerId to local mount path for mountpoint storage - m.LocalPath = path.Join(m.LocalPath, request.ContainerId) + m.LocalPath = path.Join(m.LocalPath, request.ContainerId, m.MountPointConfig.BucketName) request.Mounts[i].LocalPath = m.LocalPath err := c.setupMountPointS3(request.ContainerId, m) if err != nil { + outputLogger.Info(fmt.Sprintf("failed to setup s3 mount, error: %v\n", err)) return err } }