Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External docker build #637

Merged
merged 5 commits into from
Aug 23, 2023
Merged

External docker build #637

merged 5 commits into from
Aug 23, 2023

Conversation

keynmol
Copy link
Contributor

@keynmol keynmol commented Aug 23, 2023

Closes #579

Problem

The original issue in 579 was caused by our usage of sbt-pack and its special handling of -D arguments: https://github.com/xerial/sbt-pack/blob/master/src/main/twirl/xerial/sbt/pack/launch.scala.txt#L139

Initially I thought that switching to sbt-native-packager would fix this, but after implementing it I realised that this would require changing the CLI contract as -- needs to be handled by the launcher script first, then moped: https://github.com/sbt/sbt-native-packager/blob/master/src/main/resources/com/typesafe/sbt/packager/archetypes/scripts/bash-template#L338

In the end, I feel strongly that these packaging solutions are not suitable for our use case as we want the CLI interface to stay stable and -- to be handled by moped alone.

Solution

We move our entire Docker build into a self-contained Dockerfile - inside of which we publish the CLI and bootstrap it with coursier in the necessary location.

Everything else remains the same, but this guarantees that the arguments are passed verbatim to the scip-java jar.

As a positive side effect, this makes it easier to build the docker container - you don't need JDK installed, just docker build . -t scip-java-local is enough.

Test plan

  • Existing docker tests must continue to work

This is prompted by various issues around our handling of arguments and
how this clashes with -- and -D argument handling by both sbt-pack and
sbt-native-packager

Instead, we build scip-java entirely inside the docker container and
point `scip-java` command directly at the jar, to exclude any
possibility of weirdness introduced by launcher scripts.

Additionally, this allows anyone to build a docker container without
having JVM and SBT installed.
@keynmol keynmol requested a review from olafurpg August 23, 2023 12:02
Copy link
Member

@olafurpg olafurpg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏻

@keynmol keynmol merged commit 58ea149 into main Aug 23, 2023
11 checks passed
@keynmol keynmol deleted the external-docker-build branch August 23, 2023 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Maven Custom Properties are Ignored
2 participants