Fork me on GitHub
#tools-deps
<
2018-08-08
>
rickmoynihan12:08:46

is it (or will it ever be) possible to put specific paths from inside a git dep on the class/resource path, without needing a deps.edn file at the project root?

rickmoynihan12:08:54

thinking for resource deps

dominicm12:08:09

@rickmoynihan you could probably use gitlibs directly!

dominicm12:08:06

I suppose not if you wanted them on the classpath :thinking_face:

dominicm12:08:18

@rickmoynihan https://github.com/clojure/tools.gitlibs if io/file is okay for you though. Obviously I don't have the context of your use case.

rickmoynihan12:08:02

Thanks hadn’t seen gitlibs before

rickmoynihan12:08:12

it’s ok I think :local/root is better for this anyway

Alex Miller (Clojure team)13:08:03

tools.deps uses gitlibs for its git deps

👍 4
richiardiandrea18:08:54

has anybody run into problems with OpenJDK 9 and retrieving deps?

lilactown19:08:40

is there a way to tell the CLI tools to “just download dependencies”?

lilactown19:08:43

trying to tune my docker build

dominicm19:08:25

As opposed to doing what

richiardiandrea20:08:46

reporting the full error here, is it a known issue or it is worth a Jira?

Alex Miller (Clojure team)20:08:32

the problem here is buried - “Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact mount:mount:pom:0.1.13 from/to clojars (https://repo.clojars.org/): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target”

Alex Miller (Clojure team)20:08:49

this is a certificate problem re the JDK being used and clojars

Alex Miller (Clojure team)21:08:12

openjdk9 does not install with any root certs (I think this is fixed in 10)

richiardiandrea21:08:48

oh cool ok, thanks a lot Alex

ghadi20:08:53

@lilactown you can put RUN clojure -Spath in your dockerfile

ghadi20:08:11

should have the intended effect, if an oblique approach

lilactown21:08:17

@ghadi thanks! I think that almost worked… for some reason my uberjar command still downloads and installs all it’s deps 😭

ghadi21:08:50

lein uberjar?

lilactown21:08:14

not quite:

:uberjar
  {:extra-deps
   {pack/pack.alpha
    ;; {:local/root "/Users/will/Code/pack.alpha"}
    {:git/url ""
     :sha     "c444ae3af083b0bfa68160daac576607232f556c"}}
   :main-opts ["-m" "mach.pack.alpha.capsule" "dist/lilactown.jar"
               "-a" ":server" "-m" "lilactown.core"]}

ghadi21:08:47

All its deps, or just the pack deps?

lilactown21:08:17

I think it’s just the pack deps

ghadi21:08:25

RUN clojure -A:uberjar -Spath

ghadi21:08:39

should do the the trick to handle that

lilactown21:08:00

here’s my relevant dockerfile stuff:

COPY deps.edn .

RUN clojure -A:server:uberjar -Spath

COPY . /usr/app

RUN clojure -A:uberjar

lilactown21:08:12

hrm. I wonder if changing it to -R:server:uberjar -Spath would change it

lilactown21:08:15

seems more correct anyway

ghadi21:08:17

are you setting WORKDIR /usr/app in the dockerfile?

ghadi21:08:26

-A subsumes -R

lilactown21:08:03

yes, I’m setting workdir too

ghadi21:08:11

(I like multistage builds) I'm surprised L27 redownloads things, to be honest. All should get downloaded on L21

lilactown21:08:45

yeah me too 😕

ghadi21:08:12

offtopic for this room, but I wouldn't trust openjdk-8-alpine until OpenJDK fully supports Alpine

ghadi21:08:40

JDK 11 has official support, IIRC

lilactown21:08:45

:thinking_face: I haven’t noticed any problems yet. anything in particular I should watch out for?

ghadi21:08:41

not sure tbh. I've also used it in the past. Now I use jlink --add-modules to create slimmer packaged JVM

ghadi21:08:36

FROM openjdk:10 as jdk
RUN jlink \
  --strip-debug \
  --compress=1 \
  --vm=server \
  --output /tmp/linkedjdk \
  --add-modules ,jdk.management,jdk.unsupported,java.xml.bind,java.xml.ws.annotation

FROM debian:stretch-slim
COPY --from=jdk /tmp/linkedjdk /jdk/
# This is temporarily necessary as it appears the new OpenJDK TrustStore is incomplete
# Apparently, AWS's Step Function endpoint uses a different signing root than S3
COPY --from=jdk /docker-java-home/lib/security/cacerts /jdk/lib/security/
COPY my.jar /MYCOMPANY/
ENTRYPOINT ["/jdk/bin/java"]

ghadi21:08:45

that's my dockerfile @lilactown

lilactown21:08:28

saving this for later 😉 I remember you talking about this last week I think

ghadi21:08:46

depending on what modules you need, you can get by with less

ghadi21:08:21

I'd assume it would manifest as a hard VM crash. But if it works, it works!