This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-17
Channels
- # aleph (4)
- # announcements (2)
- # babashka (85)
- # beginners (136)
- # calva (72)
- # clj-commons (32)
- # clj-kondo (7)
- # cljs-dev (3)
- # clojure (117)
- # clojure-europe (38)
- # clojure-nl (3)
- # clojure-norway (1)
- # clojure-uk (4)
- # clojurescript (19)
- # conjure (38)
- # core-logic (2)
- # cursive (10)
- # datalevin (1)
- # datalog (1)
- # datomic (6)
- # events (2)
- # fulcro (16)
- # google-cloud (5)
- # graphql (10)
- # gratitude (3)
- # hugsql (3)
- # luminus (5)
- # membrane-term (12)
- # missionary (2)
- # nextjournal (5)
- # off-topic (3)
- # pedestal (2)
- # polylith (7)
- # portal (3)
- # re-frame (6)
- # reagent (26)
- # reclojure (8)
- # releases (3)
- # reveal (5)
- # shadow-cljs (14)
- # spacemacs (20)
- # sql (3)
- # tools-build (3)
- # web-security (9)
@hannu.hartikainen Holy cow, I absolutely loved your article on Google Jib as a way to run Java/Clojure apps in production. I’ve gotten Google Cloud Build container build times down to 45 seconds, using just distroless
and the uberjar file.
https://www.vincit.fi/en/clojure-in-google-cloud-run-with-jib/
I used the jib CLI, and was amazed that incremental uploads can take less than 7 seconds.
I tried last night to use the Google Jib Core API to upload images, using the fantastic work in @vvehvilainen’s lein-jib-build
plugin, but couldn’t get credentials loaded, after a couple hours of trying. This morning, I confirmed that the Jib CLI works, so I know it can be done.
Any chance anyone might want to collaborate to get a simple tools.build
interface to Jib running? (I’ll post a gist of my attempts from last night shortly.)
Thanks, all!
https://github.com/vehvis/lein-jib-build
Here’s the code I’m evaluating: https://gist.github.com/realgenekim/fdcad45286d065cc559cd75a8f946ad4#file-jib-build-clj-L45 And the error I’m getting is below. Any ideas?
Execution error (HttpResponseException) at com.google.api.client.http.HttpRequest/execute (HttpRequest.java:1113).
401 Unauthorized
GET
{"errors":[{"code":"UNAUTHORIZED","message":"You don't have the needed permissions to perform this operation, and you may have invalid credentials. To authenticate your request, follow the steps in: "}]}
And yet, in the CLI, I see this: (6.8 seconds! Amazing!)
genekim@Genes-2020-M1-MacBook-Pro datomic-cloudrun % time make jibcli
bin/jib-0.5.0/bin/jib jar --target= \
target/datomic-test-standalone.jar
[WARN] Base image 'adoptopenjdk:8-jre' does not use a specific image digest - build may not be reproducible
Using credentials from Docker config (/Users/genekim/.docker/config.json) for
The base image requires auth. Trying again for adoptopenjdk:8-jre...
Using base image with digest: sha256:bf736024c65942ab045c497e408706f9e599651bf8c01a75ecb3d6971d66700d
Container entrypoint set to [java, -cp, /app/explodedJar:/app/dependencies/*, datomic_proxy.core]
Container program arguments set to []
Executing tasks:
[============================ ] 91.7% complete
> launching layer pushers
make jibcli 6.80s user 10.46s system 101% cpu 17.073 total
genekim@Genes-2020-M1-MacBook-Pro datomic-cloudrun %
Holy cow. I’m now getting credentials! Null Pointer Exception went away, when I passed in a real logger as an argument to CredentialRetrieverFactory.
(Copied from JUXT Pack: https://github.com/juxt/pack.alpha/blob/master/src/mach/pack/alpha/jib.clj)
trying docker-credential-gcloud for
Using credentials from Docker config (/Users/genekim/.docker/config.json) for
I’ll update the gist with the working code later today. 🎉thanks for the tips - we do a bunch of stuff on GCP with Clojure - (currently cloud build with a simple distroless base after building a uberjar) so will have to look at jib
Ya, thanks for writing this up, this is really cool.