Skip to content

Commit

Permalink
[WOR-1192] Change terminal storage class for autoclass-managed worksp…
Browse files Browse the repository at this point in the history
…ace buckets (#2642)
  • Loading branch information
marctalbott authored Dec 1, 2023
1 parent 73151ec commit 8ef14b9
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import com.google.api.services.storage.{Storage, StorageScopes}
import com.google.auth.oauth2.ServiceAccountCredentials
import com.google.cloud.Identity
import com.google.cloud.storage.Storage.BucketSourceOption
import com.google.cloud.storage.StorageException
import com.google.cloud.storage.{StorageClass, StorageException}
import io.opencensus.scala.Tracing._
import io.opencensus.trace.{AttributeValue, Span}
import org.apache.commons.lang3.StringUtils
Expand Down Expand Up @@ -228,7 +228,8 @@ class HttpGoogleServicesDAO(val clientSecrets: GoogleClientSecrets,
bucketPolicyOnlyEnabled = true,
logBucket = Option(GcsBucketName(GoogleServicesDAO.getStorageLogsBucketName(googleProject))),
location = bucketLocation,
autoclassEnabled = true
autoclassEnabled = true,
autoclassTerminalStorageClass = Option(StorageClass.ARCHIVE)
)
.compile
.drain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import cats.effect.unsafe.implicits.global
import cats.implicits._
import com.google.cloud.Identity
import com.google.cloud.Identity.serviceAccount
import com.google.cloud.storage.Storage
import com.google.cloud.storage.{Storage, StorageClass}
import com.google.cloud.storage.Storage.{BucketGetOption, BucketSourceOption, BucketTargetOption}
import com.google.storagetransfer.v1.proto.TransferTypes.{TransferJob, TransferOperation}
import net.ceedubs.ficus.Ficus.{finiteDurationReader, toFicusConfig}
Expand Down Expand Up @@ -776,7 +776,8 @@ object MultiregionalBucketMigrationActor {
GoogleServicesDAO.getStorageLogsBucketName(workspace.googleProjectId)
).some,
location = env.defaultBucketLocation.some,
autoclassEnabled = true
autoclassEnabled = true,
autoclassTerminalStorageClass = Option(StorageClass.ARCHIVE)
)
.compile
.drain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import akka.stream.ActorMaterializer
import cats.effect.IO
import com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets
import com.google.api.client.json.gson.GsonFactory
import com.google.cloud.storage.StorageClass
import org.broadinstitute.dsde.rawls.TestExecutionContext
import org.broadinstitute.dsde.rawls.dataaccess.HttpGoogleServicesDAO._
import org.broadinstitute.dsde.rawls.model.{
Expand Down Expand Up @@ -160,7 +161,8 @@ class HttpGoogleServicesDAOSpec extends AnyFlatSpec with Matchers with MockitoTe
any(),
any(),
any(),
autoclassEnabled = ArgumentMatchers.eq(true)
autoclassEnabled = ArgumentMatchers.eq(true),
autoclassTerminalStorageClass = ArgumentMatchers.eq(Option(StorageClass.ARCHIVE))
)
).thenReturn(fs2.Stream.unit)

Expand Down Expand Up @@ -208,7 +210,8 @@ class HttpGoogleServicesDAOSpec extends AnyFlatSpec with Matchers with MockitoTe
any(),
any(),
any(),
autoclassEnabled = ArgumentMatchers.eq(true)
autoclassEnabled = ArgumentMatchers.eq(true),
autoclassTerminalStorageClass = ArgumentMatchers.eq(Option(StorageClass.ARCHIVE))
),
times(1)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import cats.effect.unsafe.IORuntime
import cats.effect.unsafe.implicits.global
import cats.implicits._
import com.google.cloud.Identity
import com.google.cloud.storage.{Acl, BucketInfo, Storage}
import com.google.cloud.storage.{Acl, BucketInfo, Storage, StorageClass}
import com.google.rpc.Code
import com.google.storagetransfer.v1.proto.TransferTypes._
import io.grpc.{Status, StatusRuntimeException}
Expand Down Expand Up @@ -618,7 +618,8 @@ class MultiregionalBucketMigrationActorSpec extends AnyFlatSpecLike with Matcher
retryConfig: RetryConfig,
location: Option[String],
bucketTargetOptions: List[Storage.BucketTargetOption],
autoclassEnabled: Boolean
autoclassEnabled: Boolean,
autoclassTerminalStorageClass: Option[StorageClass]
): fs2.Stream[IO, Unit] =
fs2.Stream.raiseError[IO](error)
}
Expand Down
6 changes: 3 additions & 3 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ object Dependencies {
val mysqlConnector: ModuleID = "com.mysql" % "mysql-connector-j" % "8.1.0"
val liquibaseCore: ModuleID = "org.liquibase" % "liquibase-core" % "4.17.2"

val workbenchLibsHash = "3d9bda9"
val workbenchLibsHash = "8ccaa6d"

val workbenchModelV = s"0.19-${workbenchLibsHash}"
val workbenchGoogleV = s"0.30-${workbenchLibsHash}"
val workbenchNotificationsV = s"0.6-${workbenchLibsHash}"
val workbenchGoogle2V = s"0.34-${workbenchLibsHash}"
val workbenchGoogle2V = s"0.35-${workbenchLibsHash}"
val workbenchOauth2V = s"0.5-${workbenchLibsHash}"
val workbenchOpenTelemetryV = s"0.7-$workbenchLibsHash"
val workbenchOpenTelemetryV = s"0.8-$workbenchLibsHash"

def excludeWorkbenchGoogle = ExclusionRule("org.broadinstitute.dsde.workbench", "workbench-google_2.13")

Expand Down

0 comments on commit 8ef14b9

Please sign in to comment.