Chat Logs

  1. * phaleth joined #primate
  2. bluehi phaleth
  3. bluephaleth: https://gitea.repopack.app/repopack/website/src/branch/master/README.md
  4. bluerepopack can now deploy the primate website
  5. bluea lot of it is based on your work
  6. bluehttps://gitea.repopack.app/repopack/website/src/branch/master/strategies
  7. blue'strategies' are the RP mechanism for autodetection of deploy conditions
  8. bluethe strategies have requirements which, if fulfilled, they are selected. they then gather info and feed it into a containerfile
  9. bluecurrently there is only the primate/deno/v0 strategy so there's no real mechanism/heuristics to select a strategy, and also the strategy is saved to disk, which is going to moved to a db table
  10. bluethe readme should contain all you need to try it out locally, I'd be happy if you could tell me if that works for you as well
  11. bluethe next step should probably be to databaserise the strategies, and then add primate/bun/v0 and see how to meaningfully select between. since the primate repo has no particular hints as for its preferred strategy, it would likely use the `primate/v0` which would be a node strategy in the future
  12. bluealternatively, in the step PICK_STRATEGY, the user will be offered a few strategies and can pick one, and set his preferred strategy for the future
  13. blueI'm still working out the best ergonomics for this, obviously we want the default to go as smooth as possible
  14. bluethere are many open items to deal with, such as subdomains to ip mappings, so programatically dealing with haproxy, show container logs, and much much more, but it's a good start
  15. bluemy idea for the strategies is that they're be admin-managed for now (so by us), but later users would be able to submit strategies, or use custom strategies in their own namespaces/projects
  16. bluethey'd be*
  17. blueonce we got the strategies in the DB I'm going to start branching out and trying more apps. I'm particular excited about trying get dreamreal's bytecode.news online *without* relying on his Dockerfile or docker-compose.yml
  18. bluesince his project has a pom.xml using `org.springframework.boot` as parent, I was thinking of creating a `spring/v0` (in the pom.xml family) strategy and seeing how far I can get with that
  19. phalethhi blue
  20. bluehi
  21. phalethsounds great
  22. blueya
  23. phalethsince I'm on debian it's tricky for me to test that locally, I should install archlinux on VBox, not sure when
  24. phalethtoo much stuff is happening
  25. bluehow do you mean
  26. bluebtw, you don't specifically need arch for this, I think
  27. blueI just checked the readme and you just need podman really
  28. phalethbytecode.news deployment is documented for systemd-nspawn, shouldn't be too hard to make Containerfiles for podman out of that, what I don't remember is how to do container linking
  29. phalethpodman on debian is outdated
  30. blueoh
  31. blueyeah, that's the next thing we're gonna have to tackle, multi-container setups
  32. bluebytecodenews has the java backend, postgres db, then next frontend and I think some mail service
  33. phalethit's just like podman network is already there, how to give each container it's IP is also documented, so it's now only a configuration problem
  34. bluejava backend is easily detectable and deployable, postgres db can be inferred from the pos.xml deps, the next frontend and the mail service are gonna be harder
  35. phalethfor example the app server of bytecode.news needs the IP of the db
  36. blueyes
  37. phalethI don't actually remember how bytecode.news app server is cofigured, but I'm pretty sure I've documented that for systemd-nspawn
  38. blueso we have a few options I think. we can define virtual host names for the network, I believe, so you don't have to work with ips. or we make the ips available as ENVs
  39. blueI remember virtual host names were a pain for nspawn, but should be possible with podman
  40. blueENV variables I haven't done yet in RP
  41. bluebut you'd just add them over the ui
  42. phalethdon't worry about vhost for podman, it's doable but also pain, the network for podman is internal
  43. phalethyou can see how that is done from primate website deployment doc
  44. blueyeah
  45. bluesome of the things we'll be able to figure out from .env.default
  46. bluefor bytecodenews for exapmle, it's DB_URL=jdbc:postgresql://localhost:5432/nevet
  47. phalethyeah, I think that's documented in the provision repo somewhere in nspawn dir
  48. bluethat, combined with the pom.xml dep, indicates a postgres container
  49. blueso we spawn up a postgres container put its connection string under DB_URL
  50. bluewhich for a spring framework app, should be `jdbc:postgresql://`
  51. blueand the hostname
  52. phalethpodman 5.8.3 is out, can I reboot the VPS?
  53. phalethbye bye blue
  54. phalethjust ask to reboot the VPS in irc and it already does that
  55. * blue joined #primate
  56. bluephaleth: done
  57. phalethcool
  58. blueso the point I was making is this
  59. phalethcontainers didn't start automatically
  60. blueoh
  61. bluein the bytecode.news repo, they have a docker-compse.yml but also an env.default
  62. phalethsudo podman start --all
  63. phalethhad to do that manually
  64. bluewe have all the data we need to autogenerate a deployment, I think
  65. bluewhy didn't they start automatically?
  66. phalethoh, you wanna autogenerate deployment
  67. phalethno idea, systemd is buggy
  68. blueyes
  69. bluethat's what I'm already doing for primate website
  70. bluethe deployment strategy isn't specific for primate website, it's for primate in general
  71. bluein the case of primate, the heuristics aren't that complex, it's detecting 'primate' package.json and looking for config/app.ts or config/app.js
  72. bluethis doesn't have to work for 100% of repositories, but it'd be great success if it works for 80% of them
  73. bluewe're gonna craft strategies like wordpress/v0, nextjs/v0, and they're gonna detect and deploy
  74. blueand strategies belong to families based on a detected file in root
  75. blueprimate/deno/v0 is a strategy in the family package_json
  76. bluewordpress/v0 would be a composer_json strategy
  77. bluesome things will be hardcoded, others detected. wordpress always uses mysql so we don't need to detect that
  78. phalethin provision repo take a look at nspawn/containers/nevet
  79. phalethand also nspawn/containers/wp-nginx
  80. phaleththe vhost and systemd stuff can be ignored
  81. blueyeah
  82. bluethis "Allow connectivity from specific machine." step could be a real pain in the butt
  83. blueanyway, we'll get to the bridge when we cross it. multi-container setups are complex
  84. bluemy base idea is to delegate into substrategy
  85. bluehttps://gitea.repopack.app/repopack/website/src/branch/master/strategies/primate_deno_v0.yaml#L30
  86. bluethis "link: database: detect" does nothing right now (and is anyway irrelevant for primate website)
  87. bluebut ideally, it should be able to detect a database requirement, create a container and link it
  88. bluein primate's case it is easy: do we have a "@primate/postgresql" dep. though this is specific to primate and I hope that the database substrategy for package_json family could be general
  89. blueanyway, most of the real complexity in RP is in those strategies and the generation of Containerfiles and containers
  90. bluenext I'm going to do hatchling or scld or just primate/bun/v0 so I can see how easy it would be switch back and forth between deno and bun
  91. bluewe're also going to have a command line tool `repopack` over npm, so you could do `repopack deploy` from the root of your repo
  92. bluebut that requires login etc., couldn't bother with that mess just yet
  93. bluefor now, see if you can get a newer podman on debian or maybe arch on a virtual machine. would be good to know if this works well for you locally too
  94. blueafaik you only need some version of podman 5, not the latest
  95. phalethpodman does have internal dns, so assigning ip addresses to containers might not be necessary
  96. phalethit's just about trying it
  97. phalethonly podman networks are needed
  98. blueya
  99. phalethI'll try later, pretty sure I already don't understand :D but too busy with other crap right now
  100. blueno worries, if you follow the readme, it should work
  101. blueotherwise ask here or in #repopack
  102. blueI'm off to the store, bbl