Submit

Back to the channels

#primate

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

Search posts