Fork me on GitHub
#biff
<
2024-07-07
>
jf05:07:55

couple of questions about tasks in biff: 1. I notice some duplication (I dont think duplication's the right word, but at least it conveys some sense of what I'm seeing) between https://github.com/jacobobryant/biff/blob/release/libs/tasks/src/com/biffweb/tasks.clj, and https://github.com/jacobobryant/biff/blob/release/tasks/src/com/biffweb/tasks.clj. Why is this necessary and when is each file used? 2. when attempting to run clj -M:dev deploy, I hit an issue with ssh (`root@<IP_ADDRESS>: Permission denied (publickey).`). From the output and the result on the server, it looks like it would be the restart subtask for deploy. a. first up, YES, the ssh issue is totally expected, and fine, IF root were to be necessary (I've set up restrictions on which users can ssh in by using AllowUsers in sshd_config) b. but the question is, why root? do we specifically need to do anything as root? I see in server-setup.sh that we've granted permissions for the app user to be able to restart the app already The output from clj -M:dev deploy:

$ clj -M:dev deploy
Identity added: /Users/jf/.ssh/id_ed25519 (jf@)
Started an ssh-agent session. If you set up `keychain`, you won't have to enter your password each time you run this command: 
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: 

Rebuilding...

Done in 164ms.
building file list ... done
.dockerignore
.gitignore
Dockerfile
README.md
cljfmt-indents.edn
config.env
deps.edn
server-setup.sh
dev/
dev/repl.clj
dev/tasks.clj
resources/
resources/config.edn
resources/config.template.env
...
sent 148760 bytes  received 1106 bytes  59946.40 bytes/sec
total size is 145095  speedup is 0.97
root@: Permission denied (publickey).
Exception in thread "main" java.lang.IllegalArgumentException: Multiple methods in multimethod 'simple-dispatch' match dispatch value: class babashka.process.Process -> interface clojure.lang.IDeref and interface clojure.lang.IPersistentMap, and neither is preferred
        at clojure.lang.MultiFn.findAndCacheBestMethod(MultiFn.java:179)
        at clojure.lang.MultiFn.getMethod(MultiFn.java:150)
        at clojure.lang.MultiFn.getFn(MultiFn.java:154)
        at clojure.lang.MultiFn.invoke(MultiFn.java:229)
        at clojure.pprint$write_out.invokeStatic(pprint_base.clj:194)
        at clojure.pprint$pprint_map$fn__11151$fn__11153.invoke(dispatch.clj:113)
        at clojure.pprint$pprint_map$fn__11151.invoke(dispatch.clj:113)
        at clojure.pprint$pprint_map.invokeStatic(dispatch.clj:112)
        at clojure.pprint$pprint_map.invoke(dispatch.clj:106)
        at clojure.lang.MultiFn.invoke(MultiFn.java:229)
        at clojure.pprint$write_out.invokeStatic(pprint_base.clj:194)
        at clojure.pprint$pprint_vector$fn__11136.invoke(dispatch.clj:95)
        at clojure.pprint$pprint_vector.invokeStatic(dispatch.clj:94)
        at clojure.pprint$pprint_vector.invoke(dispatch.clj:92)
        at clojure.lang.MultiFn.invoke(MultiFn.java:229)
        at clojure.pprint$write_out.invokeStatic(pprint_base.clj:194)
        at clojure.pprint$pprint_map$fn__11151$fn__11153.invoke(dispatch.clj:113)
        at clojure.pprint$pprint_map$fn__11151.invoke(dispatch.clj:113)
        at clojure.pprint$pprint_map.invokeStatic(dispatch.clj:112)
        at clojure.pprint$pprint_map.invoke(dispatch.clj:106)
        at clojure.lang.MultiFn.invoke(MultiFn.java:229)
        at clojure.pprint$write_out.invokeStatic(pprint_base.clj:194)
        at clojure.pprint$pprint_map$fn__11151$fn__11153.invoke(dispatch.clj:113)
        at clojure.pprint$pprint_map$fn__11151.invoke(dispatch.clj:113)
        at clojure.pprint$pprint_map.invokeStatic(dispatch.clj:112)
        at clojure.pprint$pprint_map.invoke(dispatch.clj:106)
        at clojure.lang.MultiFn.invoke(MultiFn.java:229)
        at clojure.pprint$write_out.invokeStatic(pprint_base.clj:194)
        at clojure.pprint$pprint$fn__10392.invoke(pprint_base.clj:249)
        at clojure.pprint$pprint.invokeStatic(pprint_base.clj:248)
        at clojure.pprint$pprint.invoke(pprint_base.clj:241)
        at clojure.pprint$pprint.invokeStatic(pprint_base.clj:245)
        at clojure.pprint$pprint.invoke(pprint_base.clj:241)
        at clojure.lang.Var.invoke(Var.java:384)
        at clojure.main$report_error$fn__9280$fn__9281.invoke(main.clj:603)
        at clojure.main$report_error$fn__9280.invoke(main.clj:602)
        at clojure.main$report_error.invokeStatic(main.clj:601)
        at clojure.main$main.invokeStatic(main.clj:666)
        at clojure.main$main.doInvoke(main.clj:616)
        at clojure.lang.RestFn.applyTo(RestFn.java:137)
        at clojure.lang.Var.applyTo(Var.java:705)
        at clojure.main.main(main.java:40)

Jacob O'Bryant05:07:57

1. the second file was used previously when Biff used bb tasks by default--I.e. it's a babashka file actually. it's only there for backwards compatibility now. the first file is the main one. 2. I think running the ssh commands as root was just an oversight, agreed they should run as app. I'll go ahead and push a commit to fix that next time I get a minute.

👌 1
🙏 1