Fork me on GitHub
#babashka
<
2023-06-06
>
kiemdoder06:06:22

Is cheshire.core still aliased as json ? I get a "Could not resolve symbol: json" when trying to use json.

Tomas Brejla06:06:29

Works for me. Can you provide more detailed description what exactly doesn't work in your case?

➜  /tmp ./bb
Babashka v1.3.179 REPL.
Use :repl/quit or :repl/exit to quit the REPL.
Clojure rocks, Bash reaches.

user=> (json/parse-string "{}")
{}
➜  /tmp bb           
Babashka v1.3.180 REPL.
Use :repl/quit or :repl/exit to quit the REPL.
Clojure rocks, Bash reaches.

user=> (json/parse-string "{}") 
{}

kiemdoder06:06:56

I tried it as part of a task:

{:tasks
{ 
test (prn (json/parse-string "{}"))}}

kiemdoder06:06:26

Maybe these aliases are not available in the tasks.

👍 2
jmglov06:06:54

They aren’t, no. The usual pattern is to do this:

{:tasks
 {:init (require '[cheshire.core :as json])

 test (prn (json/parse-string "{}"))}}

kiemdoder07:06:31

Ah. Thank you for the response 👍

2
kiemdoder06:06:15

babashka v1.3.180

Eugen19:06:48

hi @retrogradeorbit, I added an issue to bbssh regarding unix sockets - access remote docker host https://github.com/epiccastle/bbssh/issues/12 . It looks like it's possible to do with Jsch (there is an example). I would like to use it with contajners from @rahul080327 to manage some swarm clusters .

Eugen11:06:02

I added an example that verifies jsch allows to open a remote unix socket as a local port.

Eugen11:06:09

so the issue is in bbssh

borkdude11:06:42

#CUHG31VR6 is also the channel where you can maybe post a link to this question, not sure if @retrogradeorbit has seen it here

Eugen11:06:52

posted a link to this disscussion

Crispin06:06:33

@U011NGC5FFY thanks for linking me to this. I missed it last week. If Jsch supports this it should be not much work to add it to bbssh.

Crispin06:06:44

I might get some time this evening to give it a go.

Eugen08:06:35

thanks. that would be awesome

Eugen08:06:55

I can test it, just ping me when you have something

Crispin09:06:07

@U011NGC5FFY what platform are you on?

borkdude09:06:00

if I remember correctly he's on linux

Crispin09:06:46

ah Ill have to fix the linux CI build then... its been broken for a while

Eugen09:06:34

yes amd64, Debian

Crispin09:06:38

you can put the binary somewhere and then use it like (pods/load-pod "path/to/test/bbssh" {:transport :socket})

Crispin09:06:57

let me know if it solves your problem and if so I'll do a release

Eugen09:06:22

thanks. on the road. Will test when I get back home tonight/tomorrow morning

Crispin09:06:42

yep all good!

Eugen09:06:03

I've tested this and it works so I think it can be released. Ran it 100 times in a loop.

Eugen09:06:25

please let me know if you plan to release this soon.

Eugen09:06:40

also, a curiosity can bbssh be used in normal clojure code? i.e. not as an external process started by bb . Planning to make some suggestions for contajners docs

Crispin13:06:15

> also, a curiosity can bbssh be used in normal clojure code? No. My long term plan is to make a clj ssh library that has the same API, so that cljc code could be written that targets bb and clj.

👍 2
Crispin13:06:03

you could probably call it as a pod still though

borkdude13:06:05

you can use the pods API from normal Clojure (but it will still spin up a new process running the pod, like in bb)

👆 2
👍 2
Crispin14:06:09

Im off to sleep. Any issues let me know and I'll get to them tomorrow. Thanks all.

Eugen14:06:38

thank you, have a good night

Eugen15:06:53

cool, thanks