Submit

Back to the channels

#primate

  1. * phaleth joined #primate
  2. blue hi phaleth
  3. blue phaleth: https://gitea.repopack.app/repopack/website/src/branch/master/README.md
  4. blue repopack can now deploy the primate website
  5. blue a lot of it is based on your work
  6. blue https://gitea.repopack.app/repopack/website/src/branch/master/strategies
  7. blue 'strategies' are the RP mechanism for autodetection of deploy conditions
  8. blue the strategies have requirements which, if fulfilled, they are selected. they then gather info and feed it into a containerfile
  9. blue currently 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. blue the 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. blue the 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. blue alternatively, 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. blue I'm still working out the best ergonomics for this, obviously we want the default to go as smooth as possible
  14. blue there 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. blue my 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. blue they'd be*
  17. blue once 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. blue since 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. phaleth hi blue
  20. blue hi
  21. phaleth sounds great
  22. blue ya
  23. phaleth since I'm on debian it's tricky for me to test that locally, I should install archlinux on VBox, not sure when
  24. phaleth too much stuff is happening
  25. blue how do you mean
  26. blue btw, you don't specifically need arch for this, I think
  27. blue I just checked the readme and you just need podman really
  28. phaleth bytecode.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. phaleth podman on debian is outdated
  30. blue oh
  31. blue yeah, that's the next thing we're gonna have to tackle, multi-container setups
  32. blue bytecodenews has the java backend, postgres db, then next frontend and I think some mail service
  33. phaleth it'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. blue java 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. phaleth for example the app server of bytecode.news needs the IP of the db
  36. blue yes
  37. phaleth I don't actually remember how bytecode.news app server is cofigured, but I'm pretty sure I've documented that for systemd-nspawn
  38. blue so 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. blue I remember virtual host names were a pain for nspawn, but should be possible with podman
  40. blue ENV variables I haven't done yet in RP
  41. blue but you'd just add them over the ui
  42. phaleth don't worry about vhost for podman, it's doable but also pain, the network for podman is internal
  43. phaleth you can see how that is done from primate website deployment doc
  44. blue yeah
  45. blue some of the things we'll be able to figure out from .env.default
  46. blue for bytecodenews for exapmle, it's DB_URL=jdbc:postgresql://localhost:5432/nevet
  47. phaleth yeah, I think that's documented in the provision repo somewhere in nspawn dir
  48. blue that, combined with the pom.xml dep, indicates a postgres container
  49. blue so we spawn up a postgres container put its connection string under DB_URL
  50. blue which for a spring framework app, should be `jdbc:postgresql://`
  51. blue and the hostname
  52. phaleth podman 5.8.3 is out, can I reboot the VPS?
  53. phaleth bye bye blue
  54. phaleth just ask to reboot the VPS in irc and it already does that
  55. * blue joined #primate
  56. blue phaleth: done
  57. phaleth cool
  58. blue so the point I was making is this
  59. phaleth containers didn't start automatically
  60. blue oh
  61. blue in the bytecode.news repo, they have a docker-compse.yml but also an env.default
  62. phaleth sudo podman start --all
  63. phaleth had to do that manually
  64. blue we have all the data we need to autogenerate a deployment, I think
  65. blue why didn't they start automatically?
  66. phaleth oh, you wanna autogenerate deployment
  67. phaleth no idea, systemd is buggy
  68. blue yes
  69. blue that's what I'm already doing for primate website
  70. blue the deployment strategy isn't specific for primate website, it's for primate in general
  71. blue in 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. blue this doesn't have to work for 100% of repositories, but it'd be great success if it works for 80% of them
  73. blue we're gonna craft strategies like wordpress/v0, nextjs/v0, and they're gonna detect and deploy
  74. blue and strategies belong to families based on a detected file in root
  75. blue primate/deno/v0 is a strategy in the family package_json
  76. blue wordpress/v0 would be a composer_json strategy
  77. blue some things will be hardcoded, others detected. wordpress always uses mysql so we don't need to detect that
  78. phaleth in provision repo take a look at nspawn/containers/nevet
  79. phaleth and also nspawn/containers/wp-nginx
  80. phaleth the vhost and systemd stuff can be ignored
  81. blue yeah
  82. blue this "Allow connectivity from specific machine." step could be a real pain in the butt
  83. blue anyway, we'll get to the bridge when we cross it. multi-container setups are complex
  84. blue my base idea is to delegate into substrategy
  85. blue https://gitea.repopack.app/repopack/website/src/branch/master/strategies/primate_deno_v0.yaml#L30
  86. blue this "link: database: detect" does nothing right now (and is anyway irrelevant for primate website)
  87. blue but ideally, it should be able to detect a database requirement, create a container and link it
  88. blue in 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. blue anyway, most of the real complexity in RP is in those strategies and the generation of Containerfiles and containers
  90. blue next 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. blue we'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. blue but that requires login etc., couldn't bother with that mess just yet
  93. blue for 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. blue afaik you only need some version of podman 5, not the latest
  95. phaleth podman does have internal dns, so assigning ip addresses to containers might not be necessary
  96. phaleth it's just about trying it
  97. phaleth only podman networks are needed
  98. blue ya
  99. phaleth I'll try later, pretty sure I already don't understand :D but too busy with other crap right now
  100. blue no worries, if you follow the readme, it should work
  101. blue otherwise ask here or in #repopack
  102. blue I'm off to the store, bbl

Search posts