From fd3684fb043af055f68fb5d2a9bb28fb5199a374 Mon Sep 17 00:00:00 2001 From: LizBaldo Date: Fri, 3 Nov 2023 17:07:54 -0400 Subject: [PATCH] use the file path and not name in the background process --- project/Dependencies.scala | 8 ++++---- project/Settings.scala | 2 +- .../welder/server/BackgroundTask.scala | 19 +++++++++++++++---- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 19c73a19..6117b3aa 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -2,13 +2,13 @@ import sbt._ object Dependencies { val circeVersion = "0.14.3" - val http4sVersion = "1.0.0-M35" + val http4sVersion = "1.0.0-M38" val grpcCoreVersion = "1.51.0" val scalaTestVersion = "3.2.14" - val workbenchLibsHash = "1a6839f" - val workbenchGoogle2V = s"0.25-$workbenchLibsHash" - val workbenchAzureV = s"0.1-$workbenchLibsHash" + val workbenchLibsHash = "2eac218" + val workbenchGoogle2V = s"0.34-$workbenchLibsHash" + val workbenchAzureV = s"0.6-$workbenchLibsHash" val common = List( "com.github.pureconfig" %% "pureconfig" % "0.17.2", diff --git a/project/Settings.scala b/project/Settings.scala index 148fa806..ffff8f6b 100644 --- a/project/Settings.scala +++ b/project/Settings.scala @@ -11,7 +11,7 @@ import com.typesafe.sbt.packager.linux.LinuxPlugin.autoImport._ import sbtbuildinfo.BuildInfoPlugin.autoImport._ object Settings { - lazy val artifactory = "https://artifactory.broadinstitute.org/artifactory/" + lazy val artifactory = "https://broadinstitute.jfrog.io/broadinstitute/" lazy val commonResolvers = List( "artifactory-releases" at artifactory + "libs-release", diff --git a/server/src/main/scala/org/broadinstitute/dsp/workbench/welder/server/BackgroundTask.scala b/server/src/main/scala/org/broadinstitute/dsp/workbench/welder/server/BackgroundTask.scala index cafff545..6f8c6c83 100644 --- a/server/src/main/scala/org/broadinstitute/dsp/workbench/welder/server/BackgroundTask.scala +++ b/server/src/main/scala/org/broadinstitute/dsp/workbench/welder/server/BackgroundTask.scala @@ -106,17 +106,28 @@ class BackgroundTask( } val delocalizeBackgroundProcess: Stream[IO, Unit] = { + println(s"Background sync enabled: ${config.shouldBackgroundSync}") if (config.shouldBackgroundSync) { val res = (for { storageLinks <- storageLinksCache.get + _ <- logger.info(s"Background sync enabled: ${config.shouldBackgroundSync}") implicit0(tid: Ask[IO, TraceId]) <- IO(TraceId(UUID.randomUUID().toString)).map(tid => Ask.const[IO, TraceId](tid)) _ <- storageLinks.values.toList.traverse { storageLink => findFilesWithPattern(config.workingDirectory.resolve(storageLink.localBaseDirectory.path.asPath), storageLink.pattern).traverse_ { file => val gsPath = getCloudBlobPath(storageLink, new File(file.getName)) - checkSyncStatus( - gsPath, - RelativePath(java.nio.file.Paths.get(file.getName)) - ) + // Because of the locking mechanism in place for notebooks, we want to exclude ipynb files from the background delocalization process + val patternToExclude = ".*.ipynb$".r + println(s"storageLink: ${storageLink}") + println(s"gspath: ${gsPath}") + println(s"file: ${file}") + println(s"filename: ${file.getName}") + println(s"relative path: ${RelativePath(java.nio.file.Paths.get(file.getPath))}") + if (!patternToExclude.findFirstIn(file.getName).isDefined) { + checkSyncStatus( + gsPath, + RelativePath(java.nio.file.Paths.get(file.getPath)) + ) + } else logger.info("Not syncing .ipynb file") // TODO remove just for debugging } } } yield ()).handleErrorWith(r => logger.info(r)(s"Unexpected error encountered ${r}"))