Skip to content

Commit

Permalink
Exclude opentelmetry in compile and test
Browse files Browse the repository at this point in the history
  • Loading branch information
TQJADE committed Aug 22, 2024
1 parent cee8f55 commit 334792d
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 28 deletions.
29 changes: 10 additions & 19 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

<properties>
<sbt.project.name>core</sbt.project.name>
<opentelemetry.exclude>**/*Opentelemetry*.scala</opentelemetry.exclude>
<opentelemetry.exclude>**/OpenTelemetry*.scala</opentelemetry.exclude>
</properties>

<dependencies>
Expand Down Expand Up @@ -516,6 +516,15 @@
<outputDirectory>target/scala-${scala.binary.version}/classes</outputDirectory>
<testOutputDirectory>target/scala-${scala.binary.version}/test-classes</testOutputDirectory>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>${opentelemetry.exclude}</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
Expand Down Expand Up @@ -627,36 +636,18 @@
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk</artifactId>
<version>1.41.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-api</artifactId>
<version>1.41.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-exporter-otlp</artifactId>
<version>1.41.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>${opentelemetry.exclude}</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
<profile>
<id>sparkr</id>
Expand Down
2 changes: 1 addition & 1 deletion dev/connect-jvm-client-mima-check
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#

set -o pipefail
set -ex
set -e

# Go to the Spark project root directory
FWDIR="$(cd "`dirname "$0"`"/..; pwd)"
Expand Down
6 changes: 3 additions & 3 deletions dev/mima
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
#

set -o pipefail
set -ex
set -e

# Go to the Spark project root directory
FWDIR="$(cd "`dirname "$0"`"/..; pwd)"
cd "$FWDIR"

SPARK_PROFILES=${1:-"-Pkubernetes -Pyarn -Pspark-ganglia-lgpl -Pkinesis-asl -Phive-thriftserver -Phive "}
TOOLS_CLASSPATH="$(build/sbt -DcopyDependencies=false "export tools/fullClasspath" | grep jar | tail -n1)"
SPARK_PROFILES=${1:-"-Pkubernetes -Pyarn -Pspark-ganglia-lgpl -Pkinesis-asl -Phive-thriftserver -Phive"}
TOOLS_CLASSPATH="$(build/sbt -DcopyDependencies=false "export tools/fullClasspath" | grep jar | tail -n1)"
OLD_DEPS_CLASSPATH="$(build/sbt -DcopyDependencies=false $SPARK_PROFILES "export oldDeps/fullClasspath" | grep jar | tail -n1)"

rm -f .generated-mima*
Expand Down
2 changes: 1 addition & 1 deletion dev/run-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ def main():
else:
test_env = "local"

extra_profiles = (get_hadoop_profiles(hadoop_version) + get_scala_profiles(scala_version))
extra_profiles = get_hadoop_profiles(hadoop_version) + get_scala_profiles(scala_version)

print(
"[info] Using build tool",
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
<ojdbc11.version>23.5.0.24.07</ojdbc11.version>
<!-- Used for SBT build to retrieve the Spark version -->
<spark.version>${project.version}</spark.version>
<opentelemetry.exclude>**/OpenTelemetry*.scala</opentelemetry.exclude>
</properties>
<repositories>
<repository>
Expand Down Expand Up @@ -3065,6 +3066,9 @@
<javacArg>${java.version}</javacArg>
<javacArg>-Xlint:all,-serial,-path,-try</javacArg>
</javacArgs>
<excludes>
<exclude>${opentelemetry.exclude}</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -3704,10 +3708,6 @@
</modules>
</profile>

<profile>
<id>opentelemetry-reporter</id>
</profile>

<profile>
<id>test-java-home</id>
<activation>
Expand Down
11 changes: 11 additions & 0 deletions project/SparkBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,10 @@ object SparkBuild extends PomBuild {
enable(SparkR.settings)(core)
}

if (!profiles.contains("opentelemetry-reporter")) {
enable(OpenTelemetry.settings)(core)
}

/**
* Adds the ability to run the spark shell directly from SBT without building an assembly
* jar.
Expand Down Expand Up @@ -1329,6 +1333,13 @@ object Volcano {
)
}

object OpenTelemetry {
// Exclude all OpenTelemetry file for Compile and Test
lazy val settings = Seq(
unmanagedSources / excludeFilter := HiddenFileFilter || "OpenTelemetry*.scala"
)
}

trait SharedUnidocSettings {

import BuildCommons._
Expand Down

0 comments on commit 334792d

Please sign in to comment.