Ability to configure swap in tloncorp/urbit Docker Image

90 views
Skip to first unread message

Hugh Francis

unread,
Sep 23, 2022, 12:53:32 PM9/23/22
to urbit-dev
I'm using the tloncorp/urbit Docker Image to run my planet on fly.io.

It boots when I used their 4gb boxes, but they're too expensive for a urbit hobbyist to consider as an always on option.

When I use their hobby tier (which goes up to 2GB in memory), I get this error:

2022-09-23T16:47:04Z app[fc548de0] iad [info]Running with no STDIN
2022-09-23T16:47:04Z app[fc548de0] iad [info]~
2022-09-23T16:47:04Z app[fc548de0] iad [info]urbit 1.10
2022-09-23T16:47:04Z app[fc548de0] iad [info]boot: home is /urbit/lost+found
2022-09-23T16:47:04Z app[fc548de0] iad [info]boot: mapping 2048MB failed
2022-09-23T16:47:04Z app[fc548de0] iad [info]see urbit.org/using/install/#about-swap-space for adding swap space
2022-09-23T16:47:04Z app[fc548de0] iad [info]if porting to a new platform, try U3_OS_LoomBase 0x7f27336ef000

I'd love to be able to configure swap for my fly.io VM, but as I understand it, the nix derivation doesn't include the necessary CLI tools. 

Am I making sense? (I'm new to nix).
TY!

~/dharmaputra

unread,
Oct 4, 2022, 1:36:17 PM10/4/22
to urbit-dev, Hugh Francis

Hey Hugh

I think that should possible fork the tloncorp/urbit image and add as your final line to your dockerfile if its running on alpine
CMD if [[ ! -z "$SWAP" ]]; then fallocate -l $(($(stat -f -c "(%a*%s/10)*7" .))) _swapfile && mkswap _swapfile && swapon _swapfile && ls -hla; fi; free -m; /app/run 

Remember to set SWAP="true" on your fly.toml file

Hugh Francis

unread,
Oct 5, 2022, 8:31:20 PM10/5/22
to ~/dharmaputra, urbit-dev
Thanks everyone. 

Ended up starting a new container based on Alpine. Something like this:

(I manually copied over the scripts that the nix derivation places in the tlon container)

Cool thank you everyone!

--
Hugh Francis

c/o Sanctuary Computer, Inc
110 Bowery, 4th FL
New York, NY 10013
sanctuary.computer
Reply all
Reply to author
Forward
0 new messages