Skip to content

Commit

Permalink
[CORE] Following #8192, amend a quick fix for build info message (#8205)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhztheplayer authored Dec 11, 2024
1 parent 39370b2 commit 08316c9
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions gluten-core/src/main/scala/org/apache/gluten/GlutenPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,18 @@ private[gluten] class GlutenDriverPlugin extends DriverPlugin with Logging {
// export gluten version to property to spark
System.setProperty("gluten.version", VERSION)

val glutenBuildInfo = new mutable.HashMap[String, String]()
val glutenBuildInfo = new mutable.LinkedHashMap[String, String]()

val components = Component.sorted()
glutenBuildInfo.put("Components", components.map(_.buildInfo().name).mkString(","))
components.foreach {
comp =>
val buildInfo = comp.buildInfo()
glutenBuildInfo.put(s"Component ${buildInfo.name} Branch", buildInfo.branch)
glutenBuildInfo.put(s"Component ${buildInfo.name} Revision", buildInfo.revision)
glutenBuildInfo.put(s"Component ${buildInfo.name} Revision Time", buildInfo.revisionTime)
}

glutenBuildInfo.put("Gluten Version", VERSION)
glutenBuildInfo.put("GCC Version", GCC_VERSION)
glutenBuildInfo.put("Java Version", JAVA_COMPILE_VERSION)
Expand All @@ -104,26 +115,15 @@ private[gluten] class GlutenDriverPlugin extends DriverPlugin with Logging {
glutenBuildInfo.put("Gluten Build Time", BUILD_DATE)
glutenBuildInfo.put("Gluten Repo URL", REPO_URL)

Component.sorted().foreach {
comp =>
val buildInfo = comp.buildInfo()
glutenBuildInfo.put("Component", buildInfo.name)
glutenBuildInfo.put("Component Branch", buildInfo.branch)
glutenBuildInfo.put("Component Revision", buildInfo.revision)
glutenBuildInfo.put("Component Revision Time", buildInfo.revisionTime)
}

val infoMap = glutenBuildInfo.toMap
val loggingInfo = infoMap.toSeq
.sortBy(_._1)
val loggingInfo = glutenBuildInfo
.map { case (name, value) => s"$name: $value" }
.mkString(
"Gluten build info:\n==============================================================\n",
"\n",
"\n=============================================================="
)
logInfo(loggingInfo)
val event = GlutenBuildInfoEvent(infoMap)
val event = GlutenBuildInfoEvent(glutenBuildInfo.toMap)
GlutenEventUtils.post(sc, event)
}

Expand Down

0 comments on commit 08316c9

Please sign in to comment.