This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-11
Channels
- # announcements (2)
- # asami (10)
- # aws (2)
- # babashka (28)
- # beginners (103)
- # calva (2)
- # clj-kondo (10)
- # clojure (69)
- # clojure-austin (11)
- # clojure-europe (48)
- # clojure-nl (10)
- # clojure-switzerland (1)
- # clojure-uk (2)
- # clojurescript (6)
- # conjure (2)
- # consulting (1)
- # core-async (2)
- # core-typed (2)
- # cursive (5)
- # datomic (15)
- # jobs (1)
- # malli (4)
- # meander (7)
- # membrane (26)
- # missionary (6)
- # nbb (39)
- # reagent (3)
- # releases (1)
- # ring (3)
- # shadow-cljs (28)
- # spacemacs (2)
- # sql (6)
- # vim (5)
Does anybody has practical experience with pod-babashka-aws
. Like "does it work stable enough for production"?
I think so, but I'll let others comment on that. Also check out https://github.com/grzm/awyeah-api which is a minor rewrite of cognitect aws-api for bb.
Works stable enough yes!
@UJ1339K2B thanks a lot
I am thinking achieving a simple tool like https://www.fabfile.org/ where on my laptop issue commands that will be run on remote machines. My conceived workflow is:
1. use bb on local laptop to launch tasks.
2. The task will first ssh
to the remote machince, download bb
if not already installed there.
3. Also, transfer clj files to the remote machine
4. On the remote machine, use bb to run the clj files
5. get back the result
Anyone has done that before? I wonder is nbb or bb more suitable to do that?
@UGC0NEP4Y you can try out https://github.com/liquidz/dad or https://github.com/epiccastle/spire for this
You can keep it more simple than dad or spire with just this: https://github.com/babashka/babashka/wiki/Bash-and-Babashka-equivalents#run-local-script-on-remote-server-bb-installed
And nbb: yes, it has a hard dependency on node, although you can make a self-contained executable with caxa. (https://github.com/babashka/nbb/tree/main/doc/caxa)
If you don't mind using nodejs, here is an example using #nbb https://github.com/babashka/nbb/blob/main/examples/sharp/example.cljs
Sweet! Thanks @U04V15CAJ
It sounds like you already have what you need, but just for posterity, you can also probably do it by calling convert
from ImageMagick, if you have that installed.
There was an https://clojurians.slack.com/archives/CLX41ASCS/p1652642195641759 about resolving dependancies on hosts without a network connection, but I’m finding myself in a slightly different problem. When I’m at work, I’m behind a corporate firewall that is the only way to get to HTTP(S) connections.
I’ve created a bb.edn that consists of { :deps { etaoin/etaoin {:mvn/version "0.4.6"} } }
and so far nothing else in the directory. If I run bb
it eventually comes back with:
Error building classpath. Failed to read artifact descriptor for org.clojure:clojure:jar:1.11.1
org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.clojure:clojure:jar:1.11.1
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.clojure:clojure:pom:1.11.1 from/to central ( ): Connect to timed out
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact org.clojure:clojure:pom:1.11.1 from/to central ( ): Connect to timed out
Caused by: org.apache.http.conn.ConnectTimeoutException: Connect to timed out
I’m only including the top level of the traceback, but can send it in full if needed. I’ve run this with -http://Djava.net.useSystemProxies=true and in fact I can see the java process that is spawned with the correct proxies set, but it still seems to be unable to contact http://repo1.maven.org.
Have I missed something in the documentation about working behind proxies? Or is there a better way forward than building uberjars on a host outside the work network?Perhaps you can try this: https://github.com/borkdude/deps.clj#proxy-environment-variables bb uses deps.clj to download dependencies
Ah okay, I can actually see the results of that, my http_proxy and https_proxy were already set, and I can see the -Dhttp.proxyHost (and Port) and the https equivalent set on the java command line, but looking at packet traces it’s still trying to directly connect to the ip 151.101.212.209 which is http://repo1.maven.org. I’ve also tried changing the envrionment settings for http_proxy/https_proxy to bogus URL’s
and can see the results reflected in the java process that is spawned.
It seems like it’s ignoring the proxy configuration?
E.g. using this uberjar: https://github.com/borkdude/deps.clj/releases/download/v0.1.1100/deps.clj-0.1.1100-standalone.jar
java -jar thejar.jar -Sdeps-file=bb.edn
I had actually just grabbed the binary from the deps.clj site to start and got:
$ env | grep proxy
https_proxy=
http_proxy=
$ deps -Sverbose -Sdeps-file bb.edn
deps.clj version = 0.1.1100
version = 1.11.0.1100
install_dir = /usr/local/lib/clojure
config_dir = /home/fith/.clojure
config_paths = /usr/local/lib/clojure/deps.edn /home/fith/.clojure/deps.edn deps.edn
cache_dir = /home/fith/.clojure/.cpcache
cp_file = /home/fith/.clojure/.cpcache/C0FEA91FB41E7AA69DBED62612D56780.cp
Refreshing classpath
Error building classpath. Failed to read artifact descriptor for org.clojure:clojure:jar:1.11.0
org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.clojure:clojure:jar:1.11.0
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.clojure:clojure:pom:1.11.0 from/to central ( ): Connect to timed out
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact org.clojure:clojure:pom:1.11.0 from/to central ( ): Connect to timed out
Caused by: org.apache.http.conn.ConnectTimeoutException: Connect to timed out
But I am also seeing identical results running the uberjar that you linked
$ java -jar ~/Downloads/deps.clj-0.1.1100-standalone.jar -Sdeps-file=bb.edn
Invalid option: -Sdeps-file=bb.edn
$ java -jar ~/Downloads/deps.clj-0.1.1100-standalone.jar -Sdeps-file bb.edn
Error building classpath. Failed to read artifact descriptor for org.clojure:clojure:jar:1.11.0
org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.clojure:clojure:jar:1.11.0
I don’t think I have anything that weird in my setup… Actually, I’ll create another user and try running from there just incase there’s something with my environment, or some other “leftover” from previous projectsSame thing with a fresh user, it times out trying to get to http://Maven.org
Perhaps you can grab the deps.clj source and debug a little to see if there's anything unexpected
Another possibility, especially if the proxy seems to be being used - I'm similarly behind a company firewall, so I have a proxy set up using system properties and so on, but I can't get to maven central at work because we have an in-house artifact server, so big repos (maven central, npm, etc) are blocked because we're meant to use the in-house one. Obviously I can't say that this is definitely what's happening here, but one thing to try might be browsing to that URL through the proxy (in a browser or via curl or what have you) and seeing if that's blocked. If you know that you can usually get to maven central, please ignore this. 🙂
Interesting on both points, I’ll grab some source and also double check the URL. I’m fairly certain we aren’t blocking out Maven, but now that you say that I’m not SURE we’re aren’t, will check in the morning when I’m back 🙂 Thank you both!
If all else fails, you could always build an uberjar of the deps on some other system and bring it over, and then use --classpath deps.jar
Okay, so I’ve narrowed this down to being outside of deps.clj and babashka per se… It appears to be coming from within clojure.tools.deps.alpha.script.make-classpath2. I’m still looking through the code there. The following is the minimal case for the java that is exec’ed by deps.clj to build the classpath.
/usr/lib/jvm/java-11-openjdk-amd64/bin/java -Dhttp.proxyHost=172.16.10.20 -Dhttp.proxyPort=8080 -Dhttps.proxyHost=172.16.10.20 -Dhttps.proxyPort=8080 -Xms256m -classpath /home/fith/.deps.clj/1.11.0.1100/ClojureTools/clojure-tools-1.11.0.1100.jar clojure.main
-m clojure.tools.deps.alpha.script.make-classpath2
I haven’t yet narrowed down the exact place it’s reaching out to http://repo1.maven.org so I’m not sure why the java System Properties for the proxies are being ignored.