Skip to content

Commit

Permalink
Remove fatjar distribution
Browse files Browse the repository at this point in the history
Previously we had issues with enrich fatjars as we never really run them
anywhere in practice. This is a problematic thing to maintain.
This release removes fatjars as a distribution method.
  • Loading branch information
peel committed May 30, 2024
1 parent 10acd9d commit 1e02745
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 56 deletions.
15 changes: 0 additions & 15 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 11
- name: Build artifacts
run: |
sbt 'project kafka' assembly
sbt 'project kinesis' assembly
sbt 'project nsq' assembly
sbt 'project pubsub' assembly
sbt 'project sqs' assembly
sbt 'project stdout' assembly
- name: Get current version
id: ver
run: |
Expand All @@ -35,13 +27,6 @@ jobs:
prerelease: true
name: ${{ steps.ver.outputs.project_version }}
tag_name: ${{ steps.ver.outputs.project_version }}
files: |
kafka/target/scala-2.13/snowplow-stream-collector-kafka-${{ steps.ver.outputs.project_version }}.jar
kinesis/target/scala-2.13/snowplow-stream-collector-kinesis-${{ steps.ver.outputs.project_version }}.jar
nsq/target/scala-2.13/snowplow-stream-collector-nsq-${{ steps.ver.outputs.project_version }}.jar
pubsub/target/scala-2.13/snowplow-stream-collector-google-pubsub-${{ steps.ver.outputs.project_version }}.jar
sqs/target/scala-2.13/snowplow-stream-collector-sqs-${{ steps.ver.outputs.project_version }}.jar
stdout/target/scala-2.13/snowplow-stream-collector-stdout-${{ steps.ver.outputs.project_version }}.jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ collector {
disable = false
interval = 1 second
method = "POST"
url = "127.0.0.1"
url = "host.docker.internal"
port = 9191
secure = false
userProvidedId = userProvidedIdValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ collector {
disable = true
interval = "1 second"
method = "POST"
url = "127.0.0.1"
url = "host.docker.internal"
port = 9191
userProvidedId = Disabled
moduleName = Disabled
Expand Down
17 changes: 7 additions & 10 deletions .github/workflows/telemetryIntegTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ jobs:
python-version: '3.8'
- name: build
run: |
sbt "project stdout" assembly
find $(pwd) -name "*.jar"
sbt stdout/docker:publishLocal
- name: run micro
run: >
docker run -d
Expand All @@ -29,16 +28,14 @@ jobs:
--collector-config /config/config.hocon
--iglu /config/iglu.json
- name: run collectors
run: |
java -jar $(pwd)/stdout/target/scala-*/*.jar --config $(pwd)/.github/workflows/integration_tests/telemetry/sender_config/config.hocon &
PID_C1=$!
java -jar $(pwd)/stdout/target/scala-*/*.jar --config $(pwd)/.github/workflows/integration_tests/telemetry/sender_config/config_disabled.hocon &
PID_C2=$!
sleep 30
kill $PID_C1 $PID_C2
run: >-
docker run -d --name enabled --add-host=host.docker.internal:host-gateway -v ${PWD}/.github/workflows/integration_tests/telemetry/sender_config/config.hocon:/snowplow/config.hocon -p 9292:9292 snowplow/scala-stream-collector-stdout --config /snowplow/config.hocon;
docker run -d --name disabled --add-host=host.docker.internal:host-gateway -v ${PWD}/.github/workflows/integration_tests/telemetry/sender_config/config_disabled.hocon:/snowplow/config.hocon -p 10292:10292 snowplow/scala-stream-collector-stdout --config /snowplow/config.hocon;
sleep 30;
docker kill enabled && docker kill disabled
- name: assess result
run: |
pip install requests
python3 .github/workflows/integration_tests/telemetry/verify_micro_content.py
- name: clean up
run: docker stop micro
run: docker stop micro
29 changes: 1 addition & 28 deletions project/BuildSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import com.typesafe.sbt.packager.docker.DockerPlugin.autoImport._
import org.scalafmt.sbt.ScalafmtPlugin.autoImport._
import sbt.Keys._
import sbt._
import sbtassembly.AssemblyPlugin.autoImport._
import sbtassembly.MergeStrategy
import sbtbuildinfo.BuildInfoPlugin.autoImport._
import sbtdynver.DynVerPlugin.autoImport._

Expand All @@ -37,7 +35,7 @@ object BuildSettings {
)
)

lazy val coreHttp4sSettings = commonSettings ++ sbtAssemblySettings ++ Defaults.itSettings
lazy val coreHttp4sSettings = commonSettings ++ Defaults.itSettings

lazy val kinesisSettings =
commonSinkSettings ++ integrationTestSettings ++ Seq(
Expand Down Expand Up @@ -119,7 +117,6 @@ object BuildSettings {
lazy val commonSinkSettings =
commonSettings ++
buildInfoSettings ++
sbtAssemblySettings ++
formatting ++
dynVerSettings ++
addExampleConfToTestCp
Expand All @@ -134,31 +131,7 @@ object BuildSettings {
ThisBuild / dynverVTagPrefix := false, // Otherwise git tags required to have v-prefix
ThisBuild / dynverSeparator := "-" // to be compatible with docker
)

lazy val sbtAssemblySettings = Seq(
assembly / assemblyJarName := { s"${moduleName.value}-${version.value}.jar" },
assembly / assemblyMergeStrategy := {
// merge strategy for fixing netty conflict
case PathList("io", "netty", xs @ _*) => MergeStrategy.first
case x if x.contains("native/lib/libnetty-unix-common.a") => MergeStrategy.first
case fileName if fileName.toLowerCase == "reference.conf" => reverseConcat
case x if x.endsWith("io.netty.versions.properties") => MergeStrategy.discard
case x if x.endsWith("module-info.class") => MergeStrategy.first
case x if x.endsWith("paginators-1.json") => MergeStrategy.first
case x if x.endsWith("service-2.json") => MergeStrategy.first
case x =>
val oldStrategy = (assembly / assemblyMergeStrategy).value
oldStrategy(x)
}
)

lazy val reverseConcat: MergeStrategy = new MergeStrategy {
val name = "reverseConcat"

def apply(tempDir: File, path: String, files: Seq[File]): Either[String, Seq[(File, String)]] =
MergeStrategy.concat(tempDir, path, files.reverse)
}

lazy val formatting = Seq(
scalafmtConfig := file(".scalafmt.conf"),
scalafmtOnCompile := true
Expand Down
1 change: 0 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.15.0")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.17")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2")
Expand Down

0 comments on commit 1e02745

Please sign in to comment.