Submit

Back to the channels

#primate

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

Search posts