Submit

Back to the channels

#primate

  1. * phaleth joined #primate
  2. blue hi phaleth
  3. phaleth hi blue
  4. phaleth long list https://freebsdfoundation.github.io/freebsd-laptop-testing/
  5. nevet FreeBSD Laptop Compatibility
  6. blue lol
  7. blue did I tell you the ssd on my t480 broke down?
  8. blue I ordered a samsung 990 PRO NVMe M.2, 1TB, should be arriving today
  9. phaleth already huh
  10. blue well it was a used computer
  11. blue I should have known tbh, to begin with. because when I first put superarch on it, the first install broke down in the middle. and then I had a sudden btrfs remounts root as readonly, once a week
  12. blue so I was expecting it
  13. blue this 990 PRO NVME M.2 is totally an overkill for this computer: its throughput is roughly 4x than what the pci 3.0 x2 port can handle
  14. phaleth ok, as long as you don't loose any data it's fine, I also expect mine to break down
  15. blue but it's a tlc thing, and it's reliable, I could just put it in the next comptuer
  16. blue and I prefer 1tb to the 512mb I had. these containers take a lot of room
  17. blue the oracle container is like 5gb
  18. blue 512gb*
  19. blue I've been working on repopack. so good news, I checked how gitea handles ssh, and it's easier than I thought. you have two options. you can have a hugebutt authorized_keys file where for every key, you specify a command and then you essentially have a command that gets the key and runs stuff
  20. blue or, the better solution is, there's an openssh config variable that does that as well
  21. blue and inside the run command, the key is available as OPENSSH_KEY or so
  22. blue so you can derive the user and the acl from that
  23. blue no need for ssh2 or other shenanigangs, we can keep to openssh
  24. blue another thing I've been doing is putting plans into the database (not commited yet)
  25. blue so I've noticed the primate/node, primate/bun and primate/deno plans all end up having the same yaml
  26. phaleth so there will be a huge openssh config file?
  27. blue no, we're going with the second option
  28. phaleth the variable? is there no size limit to that?
  29. blue it's programmatic
  30. blue so you have two options
  31. phaleth yeah, I cannot imagine, but if openssh server has some sort of API then great
  32. blue hugebutt authorized_keys with these lines:
  33. phaleth I can imageine the authorized_keys file
  34. phaleth but the problem is that it's a file and not a db
  35. blue command="/path/to/repopack serve key-42",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-ed25519 AAAA
  36. blue or, you put in sshd_config
  37. blue AuthorizedKeysCommand /usr/local/bin/rp-authorize keys -e git -u %u -t %t -k %k
  38. blue AuthorizedKeysCommandUser git
  39. blue smth like that
  40. phaleth ok, well, would be great if all of the data would be stored in the db as well and the application was just able to configure whatever necessary
  41. blue yes. the pubkeys will be in the db
  42. blue and this command will just run
  43. blue query the db using the %k
  44. blue and do stuff
  45. phaleth just imagine you have a problem on PROD system and now you need the data and configs quickly
  46. blue it's all gonna be in the db
  47. phaleth all the software I know and work with is making the process of debugging a problem very time consuming
  48. phaleth cool
  49. blue this rp-authorize or whatever will just query the db. fortunately primate can do that, because random .ts files can just import the db or stores and query in isolation
  50. phaleth ok, sounds good
  51. phaleth now the difficulty may only be in building the entire system, but that's expected
  52. phaleth also deploying
  53. blue well, one of the milestones would be deploying rp locally, on rp
  54. blue for that I might need haproxy locally, which is going to be a bit annoying
  55. blue esp with the subdomains and stuff
  56. phaleth I think rp will just run in a priviledged container and there will only be one subdomain pointing to it
  57. phaleth priviledged so it can manage the haproxy configuration and connect to podman via localhost and whatnot
  58. blue ya
  59. blue so as I was saying, I reworked the plans a bit
  60. phaleth actually the repopack.com domain should point to it since it's hosting the website
  61. blue they now have variants, which means different Containerfiles (it's a 1:n table)
  62. blue yes
  63. blue so the primate plan has node, node-lts, bun and deno variants. the main variant is node-lts, but you can choose another if you want
  64. phaleth ok, variants of containerfiles?
  65. blue yes. plan variants. a deployment_plan_variant table containing deployment_plan_id and containerfile
  66. phaleth ok, well, people will wanna run nextjs
  67. blue that's a nextjs plan
  68. blue it's unrelated to the primate plan, and has other conditions (like a next.config.js file, and a next dependency)
  69. phaleth but if these variants are not difficult to create, as in it's kinda just configuration then why not
  70. blue yup
  71. blue https://superarch.org/variants.png
  72. phaleth also if it follows the idea of pre-built images then it may also make deployments fast
  73. blue you cannot 100% prebuild the image because we're copying your code into. but you can prebuild some of it
  74. blue I also added the concept of extensions, to a plan. I don't know if it's going to be widely used but for primate it's super useful
  75. phaleth ah, so people should be able to edit those Containerfiles
  76. blue I was able to a define a go_mod extension for the primate plan, and then I could deploy apps/go (it needs a `go` executable)
  77. blue so RP can now technically deploy a primate app with go, python and ruby backends, even if combined
  78. blue which I don't think any service on earth can do
  79. phaleth yeah
  80. phaleth I think the idea is to make all nextjs plans paid and primate ones free :)
  81. blue and yes, people will be able to create their own custom plans, either for their own use, or submit for general use
  82. blue haha, YES!
  83. blue anyway, before I commit those changes, I'll add a preseed step you can execute so you don't have to manually enter the plans I've entered
  84. blue the nice thing now is that you can edit a plan, redeploy, and see if it improves/changes anything
  85. * jreicher joined #primate
  86. phaleth well, do you think it'd be possible to disallow editing of FROM lines? and also COPY lines
  87. phaleth just have the person specify where is the src dir in the repo
  88. blue that's already done; you specify a path for your app
  89. phaleth and also not allow any fetching of whatever from the interwebz, which is tricky
  90. phaleth only allow the builder to reach container registries
  91. phaleth for starters I'd just not allow anybody to edit a plan
  92. blue step 1 is just us making plans. step 2 is users submit plans, and we approve them. step 3 are custom plans used by the user in his apps, but that's the most dangerous
  93. blue for now we're going to stick to step 1 and if anyone needs anything he can create a support ticket on repopack.com/repopack/support repo
  94. phaleth I think we can just let anybody do whatever but with very limited resources
  95. blue ya
  96. phaleth and if they want their app to run fast then they should not use nextjs or whatever :) just use primate to get all benefits
  97. phaleth cause you know if you let people execute arbitrary code you might as well just let them deploy however they want
  98. phaleth podman has a bunch of not only resource limits but also rate limits, but it should be tricky to figure out the usage
  99. blue yes
  100. phaleth some rate limits will just have to be enforced by repopack
  101. blue remember that in the future, we're going to segment customers by vps/dedi if they're enterprise
  102. blue since you'd need slas for these servers
  103. blue enterprise clients are gonna be the money cows, anyway
  104. phaleth yeah, windows servers
  105. blue speaking of slas, I belive contabo offers them
  106. blue haha
  107. blue phaleth: I pushed out all the changes. I'll send you the json export
  108. blue you just go to plans, click on Import JSON, select the file, and run it
  109. phaleth json
  110. blue yes
  111. blue easiest way for you to seed the db
  112. phaleth so why is not automatic? like on every start it can check if there is a seed script and if it executed that and if not then exec that
  113. blue it could be, but this was easier for now. we're gonna mess around a lot with those plans
  114. phaleth I guess it's cause WIP :)
  115. blue exacty
  116. blue the import and export are gonna go away anyway
  117. phaleth ok, I will have to try later
  118. blue cool
  119. blue now you can also choose 'detect' in the plan configuration of an app
  120. blue if you choose an app, you will have the option of choosing a variant
  121. blue and all primate apps under the primate repo /apps, are adapted to be deployable by RP, given the plans I've provided you
  122. blue though I think only the primate/bun variant handles extensions, for now
  123. blue so if you want to test apps/{go,python,ruby}, you'd need to use that variant
  124. blue if you a plan*, I meant
  125. blue if you choose a plan*
  126. blue https://github.com/primate-run/primate/commit/a822c25a842d21e2159b2eb8643e466c7f4b4298
  127. nevet make all apps deployable · primate-run/primate@a822c25
  128. blue this is the commit that adapted them. mostly moved the ports to .env.local instead of hardcoded in the primate config, since RP can't handle that
  129. blue and I've patched primate to read the PORT env variable if set, and if http.port wasn't explicitly set in the config
  130. blue so what happens is kinda cool. if you run those apps locally, they're gonna use the port in .env.local. which is great because you want different ports to be able to run them in parallel, with no conflicts
  131. blue but if you run those apps through rp, they're isolated and you can just use the default PORT that the primate plan injects, which is 6161
  132. blue and then rp knows to map this inner port to some random external port 42xxx
  133. blue another thing I did with primate is that it reads the HOST env variable if http.host isn't explicitly set
  134. blue this was very important for rp, because primate's default is 127.0.0.1, that doesn't work in a container
  135. blue so the primate plan just injects 0.0.0.0 and everything works
  136. blue we skirted around this problem by explicitly setting http.host to 0.0.0.0 in apps/website, if you remember. once we move to rp for deployment we won't need this hack
  137. blue https://github.com/primate-run/primate/blob/master/apps/website/config/app.ts#L9-L11
  138. blue these 3 lines will disappear once we use rp to deploy the website
  139. blue which is good: they were only added so it works in podman
  140. phaleth yeah, noone else will be deploying primate website on public intewebz
  141. phaleth anyway, think about only having primate plans then a static plan and then a custom plan and that's it
  142. phaleth cause nowadays people expect magic to happen and not to have to choose a plan
  143. blue ya

Search posts