Fork me on GitHub
#biff
<
2022-12-31
>
Epidiah Ravachol15:12:18

Magnificent! With this update, I got Vim-Iced to play well with Biff just by adding com.github.liquidz/iced-nrepl{:mvn/version "1.2.474"} to the deps.edn and iced.nrepl/wrap-iced to the --middleware vector under :biff.tasks/clj-args in the config.edn :tasks map. I feel like a wizard!

wizard 1
loganrios17:12:34

Thanks so much for your continued work on this framework!

🙌 1
Nitin15:12:35

I am not able to create a new project, even though I have java installed.

➜  ~ bb -e "$(curl -s )"
`java` command not found. Please install Java 11 or higher.
➜  ~ java -version                                         
openjdk version "11.0.17" 2022-10-18
OpenJDK Runtime Environment (build 11.0.17+8-post-Ubuntu-1ubuntu220.04)
OpenJDK 64-Bit Server VM (build 11.0.17+8-post-Ubuntu-1ubuntu220.04, mixed mode, sharing)
➜  ~ uname -a 
Linux predevi 5.15.0-56-generic #62~20.04.1-Ubuntu SMP Tue Nov 22 21:24:20 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
➜  ~ lsb_release -a                                        
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.5 LTS
Release:	20.04
Codename:	focal

pavlosmelissinos15:12:22

Can you try this command? javap -verbose java.lang.String

🙌 1
Nitin15:12:29

I found that this was happening because of a https://github.com/jacobobryant/biff/commit/4d8b4cccbed70c4faff968172c17c40e4314652d that was pushed recently I had openjre installed, I also installed openjdk

👍 1
Nitin15:12:51

I got it working now, thank you so much

Jacob O'Bryant16:12:58

hmm, maybe using javap wasn't an reliable as I thought then. I'll switch it back to the previous method, or perhaps use the old method as a fallback

Jacob O'Bryant16:12:27

Stack overflow, you've failed me again

Nitin18:12:59

The https://biffweb.com/docs/get-started/new-project/ clearly mentions JDK, it was my mistake that I tried running new-project with JRE.

Jacob O'Bryant18:12:42

does clojure work with just jre though? if so then jre should be sufficient for biff

Jacob O'Bryant18:12:09

(in which case I should probably update the requirements page)

Jacob O'Bryant20:12:00

This is now fixed

Jacob O'Bryant20:12:25

Just made another release with a couple additional small things. Notably, the Could not find namespace error when running bb tasks is fixed, hallelujah https://github.com/jacobobryant/biff/releases/tag/v0.5.7

9
Epidiah Ravachol02:01:21

I'm, unfortunately, still getting that Could not find namespace error running bb tasks and bb --force dev doesn't seem to make a difference.

Jacob O'Bryant03:01:26

In that case there might be a typo? If you paste your bb.edn and contents of the files in tasks I could help doublecheck

👍 2
Epidiah Ravachol03:01:55

Sure thing and thanks! bb.edn

{:deps {com.d1kh/tasks {:local/root "tasks"}}
 :tasks {dev         com.biffweb.tasks/dev 
         format      com.biffweb.tasks/format
         clean       com.biffweb.tasks/clean
         deploy      com.biffweb.tasks/deploy
         soft-deploy com.biffweb.tasks/soft-deploy
         refresh     com.biffweb.tasks/refresh
         restart     com.biffweb.tasks/restart
         logs        com.biffweb.tasks/logs
         prod-repl   com.biffweb.tasks/prod-repl
         prod-dev    com.biffweb.tasks/prod-dev
         hello       com.d1kh.tasks/hello

         post-receive com.biffweb.tasks/post-receive
         run-cmd      com.biffweb.tasks/run-cmd}}
In tasks I have this deps.edn
{:paths ["src"]
 :deps {com.biffweb/tasks {:git/url "" :tag "v0.5.7" :sha "02b6bd543b76ad94d9e3afe9949191e0f37467f5"}}}
And there's tasks/src/com/d1kh/tasks.clj which is just this:
(ns com.d1kh.tasks)

(defn hello
  "An example of a custom task. See ./tasks/"
  []
  (println "Hello, Wrold."))
Which has a deliberate typo in the string "Hello, Wrold." because everything needs a little imperfection.

Jacob O'Bryant03:01:27

hm, so you get the error if you run bb --force hello ?

Jacob O'Bryant03:01:53

I'm not seeing any typos

Jacob O'Bryant03:01:03

other than Wrold 🙂

Epidiah Ravachol04:01:09

It looks like bb --force hello works fine, but bb --force dev is still being stubborn.

Jacob O'Bryant05:01:05

well that's a bit of a head scratcher. I just double checked that bb dev works on a new project on the same commit you have in tasks/deps.edn, and that works. what about another task in com.biffweb.task -- does bb --force run-cmd work? Does bb hello work if you put this in your tasks.clj file?

(ns com.d1kh.tasks
  (:require [com.biffweb.tasks :as tasks]))

(defn hello
  "An example of a custom task. See ./tasks/"
  []
  (println "Hello, Wrold.")
  (tasks/dev))
what does bb --version give you?

Epidiah Ravachol14:01:16

Sorry, took a little nap there. I was running babashka v1.0.168, but I just upgraded to v1.0.169 and I'm still having problems with bb dev. bb --force run-cmd also can't find the namespace and neither can the new version of bb hello. But here's a new wrinkle, I went and tried the bb dev in folder where I was working on the tutorial and that works just fine.

Jacob O'Bryant20:01:35

Just copied and pasted your files to my machine, got the error, and finally spotted the problem: you need to set :deps/root in tasks/deps.edn:

{:paths ["src"]
 :deps {com.biffweb/tasks {:git/url ""
                           :tag "v0.5.7"
                           :sha "02b6bd543b76ad94d9e3afe9949191e0f37467f5"
                           :deps/root "tasks"}}}
Perhaps you removed that bit when upgrading to v0.5.7.

🎉 2
Epidiah Ravachol20:01:22

That was it! And that must've been the cause. Apologies for the hassle!

Jacob O'Bryant21:12:51

I'm starting to lean away from using Fly as the recommended deployment platform. • Unlike Digital Ocean, It doesn't come with managed services for postgres or s3. e.g. if you run postgres, you're just running it as a regular app, and thus you'll have to fix it if it crashes + worry about backups. (Both DO and Fly do have managed services for redis). • It's actually a little bit more expensive. I forgot previously that in addition to containers, you'll also need to run storage volumes for XT. On DO a 1GB droplet is $6/month and comes with 25GB of disk space; on Fly a 1GB container + 25GB volume costs $9.45. Not necessarily a big deal, but a small tick against Fly nonetheless. • The separate volume thing means there is an additional moving part/additional thing that has to be set up. • Fewer pricing tiers on Fly. e.g. containers with shared cpus on Fly only go up to 2GB of memory; on DO they go up to 16GB. • I think I can make deploying to DO pretty seamless if I publish an image for a pre-configured Biff instance, and maybe I can even get it on their 1-click app marketplace. • I'm also feeling better about the VM experience now that the sudo: a terminal is required to read the password error has been fixed. I think the kinks are mostly all smoothed out now. • I'm not sure if you can rsync stuff onto a Fly volume, which would be nice to have for developing-in-prod. • It'd still take me a decent amount of time to get the Fly experience polished with docs and everything, so if I'm going to go through with that, I'd want the experience on Fly to be significantly better than it is on DO, which I'm not sure it would be. So I think I'll shelve the Fly stuff for now, and I'll look into making a DO 1-click install image instead. And if anyone else wants to take the https://gist.github.com/jacobobryant/d3b2654c36161414a7b6a306b3f678b5 I wrote and make a tutorial for running Biff on Fly, I'll be happy to link to it in the docs 🙂.

👍 17
macrobartfast01:01:34

That definitely works for me! The one-click deploy is probably my main wish and if that happens on DO then I have everything. No pressure from me, of course… my cup overruneth already. DO has great customer support and also a simple UI which I really appreciate. I also really appreciate their billing model with the add-funds-ahead-of-time model. That takes away the worry of accidentally running up a huge bill.

👌 2
tbrooke23:01:01

I have only tried DO and not left anything up for long but it isn’t that difficult - You do have to make sure you get the cheapest offerings and I think the managed postgres adds a bit. I’ll give it another try soon

👍 2
Jacob O'Bryant23:01:12

It is ok to stick with filesystem persistence in prod as well. you'd definitely want to at least have DO's automatic weekly backups switched on. I'd be interested to set up an automated backup task and include it with Biff actually, e.g. have it backup the tx log + doc store to s3 every hour. DO's s3 clone is only $5/month, and there's enough space that you could use it for backing up as many apps as you want.

🙌 2
macrobartfast00:01:46

Fun fact for the thread: the least expensive droplet ($4 a month?) doesn’t work, but the next one up does. If remember correctly one needs 1GB of RAM.

Jacob O'Bryant00:01:12

I discovered that too 🙂 . I've since added a note to https://biffweb.com/docs/reference/production/ about that: > 1. Create an Ubuntu VPS in e.g. DigitalOcean. Give it at least 1GB of memory.