Skip to content

Commit

Permalink
Bootstrap sbt build
Browse files Browse the repository at this point in the history
Covered by .github/dco/adrien_piquerez.md
  • Loading branch information
adpi2 committed Dec 10, 2024
1 parent 4509132 commit 7406eee
Show file tree
Hide file tree
Showing 165 changed files with 2,810 additions and 1,440 deletions.
1 change: 1 addition & 0 deletions .sbtopts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-J-Xmx4g
62 changes: 62 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@

import optimus.BuildTool
import optimus.Dependencies
import optimus.DHT
import optimus.GSF
import optimus.Platform
import optimus.Silverking
import optimus.Stratosphere

ThisBuild / scalaVersion := Dependencies.scala2Version

val buildToolApp = BuildTool.app
val buildToolRest = BuildTool.rest
val buildToolRunConf = BuildTool.runConf
val builtToolFormat = BuildTool.format
val buildToolCore = BuildTool.core

val dhtClient3 = DHT.client3
val dhtDigest = DHT.digest
val dhtCommon3 = DHT.common3

val gsfBreadcrumbs = GSF.breadcrumbs

val platform = Platform.platform
val platformGitUtils = Platform.gitUtils
val platformBitBucketUtils = Platform.bitBucketUtils
val platformRestUtils = Platform.restUtils
val platformPriqlDalPersistence = Platform.priqlDalPersistence
val platformPriqlDal = Platform.priqlDal
val platformPriql = Platform.priql
val platformDalClient = Platform.dalClient
val platformMSNetSSL = Platform.msNetSSL
val platformVersioningRuntime = Platform.versioningRuntime
val platformTls = Platform.tls
val platformDalCore = Platform.dalCore
val platformDalEnvironment = Platform.dalEnvironment
val platformCollections = Platform.collections
val platformCore = Platform.core
val platformDebugger = Platform.debugger
val platformInstrumentation = Platform.instrumentation
val platformInputs = Platform.inputs
val platformCoreConfig = Platform.coreConfig
val platformEntityAgent = Platform.entityAgent
val platformEntityAgentExt = Platform.entityAgentExt
val platformEntityPlugin = Platform.entityPlugin
val platformEntityPluginJar = Platform.entityPluginJar
val platformBreadcrumbs = Platform.breadcrumbs
val platformMissing = Platform.missing
val platformUtils = Platform.utils
val platformScalaCompat = Platform.scalaCompat
val platformStagingPlugin = Platform.stagingPlugin
val platformStagingPluingJar = Platform.stagingPluginJar
val platformCoreMacro = Platform.coreMacro
val platformAlarms = Platform.alarms
val platformAnnotations = Platform.annotations
val platformSprayJson = Platform.sprayJson

val silverking = Silverking.silverking
val silverkingUtils = Silverking.utils

val stratosphereBootstrap = Stratosphere.bootstrap
val stratosphereCommon = Stratosphere.common
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import optimus.buildtool.utils.AssetUtils
import optimus.scalacompat.collection._
import optimus.platform.util.Log
import optimus.platform._
import optimus.tools.testplan.model.TestplanField.TestCases
// import optimus.tools.testplan.model.TestplanField.TestCases

import scala.jdk.CollectionConverters._
import scala.collection.immutable.Seq
Expand Down Expand Up @@ -409,7 +409,7 @@ final class TestplanInstaller(
testModulesFiles ++ testplanFile
}

private def validateUniqueTestCaseNames(testplan: TestPlan): Unit = {
private def validateUniqueTestCaseNames(testplan: TestPlan): Unit = ??? /* {
val testCaseColumn = testplan.headers.indexOf(TestCases.toString)
val duplicateTestNames = testplan.values
.groupBy(t => t(testCaseColumn))
Expand All @@ -424,6 +424,6 @@ final class TestplanInstaller(
|Please make sure the test group names in the .testplan.json file are not the same.""".stripMargin
throw new IllegalStateException(msg)
}
}
} */

}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import optimus.buildtool.utils.CompilePathBuilder
import optimus.buildtool.utils.Utils
import optimus.buildtool.utils.Utils.durationStringNanos
import optimus.dht.client.api.DHTClient
import optimus.dht.client.api.DHTClientBuilder
// import optimus.dht.client.api.DHTClientBuilder
import optimus.dht.client.api.kv.KVClient
import optimus.dht.client.api.kv.KVKey
import optimus.dht.client.api.kv.KVLargeEntry
Expand Down Expand Up @@ -94,15 +94,15 @@ object DHTStore extends Log {
case _ => ClusterType.Custom
}

def ZkBuilder(zkPath: String): DHTClientBuilder =
DHTClientBuilder.create
def ZkBuilder(zkPath: String): Nothing = ???
/* DHTClientBuilder.create
.zkPath(zkPath)
.kerberos(true)
.replicationStrategy(new SimpleReplicationStrategy(2))
.readTimeout(Duration.ofSeconds(System.getProperty("obt.dht.readTimeoutSeconds", "60").toLong))
.defaultOperationTimeout(
Duration.ofSeconds(System.getProperty("obt.dht.defaultOperationTimeoutSeconds", "60").toLong))
.ioThreads(System.getProperty("obt.dht.ioThreads", "12").toInt)
.ioThreads(System.getProperty("obt.dht.ioThreads", "12").toInt) */

private[cache] sealed trait StoredKey {
val id: ScopeId
Expand Down Expand Up @@ -154,15 +154,15 @@ class DHTStore(
clusterType: ClusterType = ClusterType.QA,
artifactVersion: String,
val cacheMode: CacheMode,
clientBuilder: DHTClientBuilder)
/* clientBuilder: DHTClientBuilder */)
extends ArtifactStoreBase
with RemoteAssetStore
with MultiWriteableArtifactStore
with Log {
import DHTStore._
override protected def cacheType: String = s"DHT $clusterType"
override protected def stat: ObtStats.Cache = ObtStats.DHT
private val client: DHTClient = clientBuilder.build()
private val client: DHTClient = ??? /* clientBuilder.build() */

override def toString: String = client.getServerConnectionsManager.toString
private val lvClient = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import optimus.buildtool.files.Directory
import optimus.buildtool.files.Pathed
import optimus.buildtool.utils.CompilePathBuilder
import optimus.dht.client.internal.registry.ZookeeperRegistryObserver
import optimus.dht.common.util.registry.ZKUtils
/* import optimus.dht.common.util.registry.ZKUtils
import optimus.dht.common.util.registry.ZkConfig
import optimus.dht.server.api.registry.RegistryConsts
import optimus.dht.server.management.DHTManagementInterface
import optimus.dht.server.management.DHTManagementInterface */
import optimus.platform._
import optimus.platform.util.ArgHandlers.StringOptionOptionHandler
import optimus.platform.util.Log
Expand Down Expand Up @@ -155,7 +155,7 @@ object ObtDhtCacheAdminApp extends OptimusApp[ObtDhtCacheAdminAppCmdLine] with L
DHTStore.zkClusterType(zkPath),
artifactVersion,
cacheMode = CacheMode.ReadWrite, // admin needs to be able to read and delete
DHTStore.ZkBuilder(zkPath)
/* DHTStore.ZkBuilder(zkPath) */
)

@entersGraph override def run(): Unit = {
Expand All @@ -181,7 +181,7 @@ object ObtDhtCacheAdminApp extends OptimusApp[ObtDhtCacheAdminAppCmdLine] with L
DHTStore.zkClusterType(zkPath),
artifactVersion,
cacheMode = CacheMode.ReadOnly,
DHTStore.ZkBuilder(zkPath))
/* DHTStore.ZkBuilder(zkPath) */)

val maybeResult = getArtifactKey match {
case artifactKey: ArtifactKey =>
Expand Down Expand Up @@ -211,7 +211,7 @@ object ObtDhtCacheAdminApp extends OptimusApp[ObtDhtCacheAdminAppCmdLine] with L

private def getAllKeys: Seq[StoredKey] = {

val keys: Seq[StoredKey] = jmxUrls.flatMap { jmxUrl =>
val keys: Seq[StoredKey] = ??? /* jmxUrls.flatMap { jmxUrl =>
withDhtManagementBean(jmxUrl) { bean =>
bean.returnKeyspaceKeys(keyspaceName, "", false).toSeq.map { case Array(maybeKey, _, _) =>
Option(maybeKey).flatMap {
Expand All @@ -223,7 +223,7 @@ object ObtDhtCacheAdminApp extends OptimusApp[ObtDhtCacheAdminAppCmdLine] with L
}
}
}
}.flatten
}.flatten */

log.info(s"found ${keys.size} keys in total")
if (keys.nonEmpty) {
Expand Down Expand Up @@ -260,7 +260,7 @@ object ObtDhtCacheAdminApp extends OptimusApp[ObtDhtCacheAdminAppCmdLine] with L
keys
}

private def getJmxUrls: Seq[String] = {
private def getJmxUrls: Seq[String] = ??? /* {
val zkConfig = ZkConfig.parse(zkPath, true)
val curatorFramework = ZKUtils.getFrameworkBuilder(zkConfig).build
curatorFramework.start()
Expand All @@ -275,11 +275,11 @@ object ObtDhtCacheAdminApp extends OptimusApp[ObtDhtCacheAdminAppCmdLine] with L
Option(zkaData.get(RegistryConsts.JMX_URL_KEY).asInstanceOf[String])
}
}
} */

private val dhtManagementObjectName = "com.dht:type=DHTManagement"

private def withDhtManagementBean[T](jmxUrlStr: String)(f: DHTManagementInterface => T): T = {
/* private def withDhtManagementBean[T](jmxUrlStr: String)(f: DHTManagementInterface => T): T = {
val conn = Try {
log.info(s"Connecting to DHT jmx interface with url: $jmxUrlStr")
val jmxUrl = new JMXServiceURL(jmxUrlStr)
Expand All @@ -302,7 +302,7 @@ object ObtDhtCacheAdminApp extends OptimusApp[ObtDhtCacheAdminAppCmdLine] with L
} finally {
conn.close()
}
}
} */

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import optimus.buildtool.cache.dht.LocalDhtServer
import optimus.buildtool.cache.silverking.SilverKingConfig
import optimus.buildtool.cache.silverking.SilverKingStore
import optimus.buildtool.utils.CompilePathBuilder
import optimus.dht.client.api.DHTClientBuilder
// import optimus.dht.client.api.DHTClientBuilder
import optimus.dht.client.api.registry.StaticRegistryObserver
import optimus.platform._
import optimus.stratosphere.config.StratoWorkspace
Expand Down Expand Up @@ -91,7 +91,7 @@ import optimus.stratosphere.config.StratoWorkspace
val forcedReadThroughStores: Set[DHTStore] = cmdLine.crossRegionReadThroughDHTLocations.apar
.withFilter(!_.equalsIgnoreCase(NoneArg))
.map { location =>
new DHTStore(pathBuilder, DHTStore.zkClusterType(location), version, cacheMode, DHTStore.ZkBuilder(location))
new DHTStore(pathBuilder, DHTStore.zkClusterType(location), version, cacheMode/* , DHTStore.ZkBuilder(location) */)
}
.toSet
if (forcedReadThroughStores.nonEmpty) {
Expand All @@ -111,7 +111,7 @@ import optimus.stratosphere.config.StratoWorkspace
version: String = defaultVersion,
silverKing: String = cmdLine.silverKing,
offlinePuts: Boolean = true,
): RemoteArtifactCache = {
): RemoteArtifactCache = ??? /* {
val store = (silverKing, cmdLine.dhtRemoteStore) match {
case (NoneArg, NoneArg) =>
Expand Down Expand Up @@ -161,7 +161,7 @@ import optimus.stratosphere.config.StratoWorkspace
)
}
getCrossRegionPopulatingCache(store, cacheMode, version)
}
} */

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import optimus.buildtool.utils.HashedContent
import optimus.buildtool.utils.Utils
import optimus.buildtool.utils.stats.SourceCodeStats
import optimus.platform._
import optimus.tools.scalacplugins.entity.ThresholdProfiler
// import optimus.tools.scalacplugins.entity.ThresholdProfiler
import sbt.internal.inc.MiniSetupUtil
import sbt.internal.prof.Zprof
import sbt.internal.prof.Zprof.ZincRun
Expand Down Expand Up @@ -316,13 +316,15 @@ class ZincProfiler(scopeId: ScopeId, traceType: MessageTrace, compilerInputs: Co
* clearly see them.
*/
private def republishSlowCompilationWarnings(messages: Seq[CompilationMessage]): Seq[Double] = {
messages.collect {
//TODO
/* messages.collect {
case CompilationMessage(pos, msg @ ThresholdProfiler.MessageString(_, durationInSecs), _, _, _, _, _) =>
val posStr = pos.map(p => s"${p.filepath.split("/").last}:${p.startLine}").getOrElse("?:?")
val str = s"$prefix$msg ($posStr)"
log.warn(s"$prefix$msg")
ObtTrace.warn(str)
durationInSecs
}
} */
Seq.empty
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class ClassAnalysisStore(
)
)
private val store =
FileAnalysisStore.binary(analysisJar.path.toFile, mappers, tmpDir = jars.analysisJar.tempPath.parent.path.toFile)
FileAnalysisStore.binary(analysisJar.path.toFile, mappers /*, tmpDir = jars.analysisJar.tempPath.parent.path.toFile */)

override def get: Optional[AnalysisContents] = store.get
override def unsafeGet: AnalysisContents = store.unsafeGet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class SignatureAnalysisStore(
private val store = FileAnalysisStore.binary(
signatureAnalysisJar.path.toFile,
signatureMappers,
tmpDir = signatureAnalysisJar.parent.path.toFile)
/* tmpDir = signatureAnalysisJar.parent.path.toFile */)

// this store is only used for writing - signature analysis for upstreams is loaded via ZincEntryLookup
override def get(): Optional[AnalysisContents] =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ object GitLog {
} else log.info(s"Skipping tag request for $tagName as only forward tagging are allowed (HEAD is $currentHead)")
}

@async @impure private def isMovingForward(tagName: String): Boolean = {
@async @impure private def isMovingForward(tagName: String): Boolean = ??? /* {
// git ls-remote --tags
val currentRemoteHash: Option[String] = utils.git
.lsRemote()
Expand All @@ -284,5 +284,5 @@ object GitLog {
log.info(s"Tag $tagName is currently pointing to $remoteHash")
utils.repo.hasObject(ObjectId.fromString(remoteHash))
}
}
} */
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package optimus.dht.client.api;
import java.io.FileInputStream;
Expand Down Expand Up @@ -87,17 +87,17 @@ public class DHTClientBuilder {
private static final Logger logger = LoggerFactory.getLogger(DHTClientBuilder.class);
/** Holder for settings. */
/** Holder for settings.
protected class Setting<T> {
/** Property name */
/** Property name
final String name;
/** Property value (if set) */
/** Property value (if set)
T value;
/** Optional property default value supplier */
/** Optional property default value supplier
final Supplier<T> defaultValueSupplier;
/** Cached default value */
/** Cached default value
T defaultValue;
/** List of properties that conflict with this setting */
/** List of properties that conflict with this setting
final List<Setting<?>> conflictsWith;
public Setting(String name, Supplier<T> defaultValueSupplier, Setting<?>... conflictsWith) {
Expand Down Expand Up @@ -161,7 +161,7 @@ public boolean isSet() {
* Creates a new instance of a builder.
*
* @return a new instance of a builder
*/
public static DHTClientBuilder create() {
return new DHTClientBuilder();
}
Expand Down Expand Up @@ -693,3 +693,4 @@ protected RegistryObserver registryObserver() {
}
}
}
*/
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
package optimus.dht.common.internal.transport;
import optimus.dht.common.util.StringTool;
Expand Down Expand Up @@ -43,3 +44,4 @@ public String toString() {
+ "]";
}
}
*/
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package optimus.dht.common.util.registry;
import com.ms.infra.zookeeper.utils.ConnectionInfo;
Expand Down Expand Up @@ -45,3 +45,4 @@ public static CuratorFrameworkFactory.Builder getFrameworkBuilder(ZkConfig confi
config, connectionInfo.connectString(), connectionInfo.proid()));
}
}
*/
Loading

0 comments on commit 7406eee

Please sign in to comment.