Submit

Back to the channels

#repopack

  1. phaleth the VPS got beefier
  2. phaleth flog trust me bro script now works, but primate repo has some old version of flog.lock
  3. phaleth flog: error: /home/user/primate/primate/flog.lock: unsupported flog.lock version 0 (expected 1)
  4. phaleth there is a change in the making https://repopack.com/project/primate/tasks/236#flog.lock
  5. phaleth here just use buildkit already, the deamon is running on the VPS and is managed by systemd https://repopack.com/project/repopack/tasks/737 no need to do any short term solution, buildah is inferior
  6. blue hi phaleth
  7. phaleth damn, cannot force push
  8. phaleth and git fetch git pull isn't getting the commits I've reset locally
  9. blue where, phaleth?
  10. phaleth cannot force push to a feature branch
  11. phaleth that's too restrictive
  12. phaleth I mean task branch
  13. blue why would you wanna force push to a task branch?
  14. blue just add commits on top. it all gets squashed in the end anyway
  15. phaleth when screwing up something and not wanting to make another commit, git commit --amend is a thing for a reason
  16. phaleth yeah, but for the reviewer it's pain in the butt if they review locally, which they should
  17. blue the problem with amending commits on a task branch is that it rewrites history. it's probably ok as long as the task is in ACTIVE, but after it's been submitted to a REVIEW, it's weird
  18. blue I'll see if I can create a task for it that makes sense
  19. blue "I think you and phaleth are talking past each other. Repopack already permits a force-push to a task branch by its owner while the task is active—including after git commit --amend. It rejects pushes during review or ready; the owner must run rp task revise <number> before changing a submitted branch. Other users, including maintainers, cannot push to someone else’s task branch without an ownership
  20. blue handoff."
  21. blue should be working for you phaleth
  22. phaleth well I'm forced to do `rp task revise` anyway
  23. blue "His fetch/pull problem may be separate. If he reset away local commits that were never pushed, fetching cannot recover them; git reflog may. If they were pushed, we need the exact branch, task status/owner, and Git rejection text to tell why the push failed. I wouldn’t create a policy-change task yet—first ask him for those details."
  24. phaleth ok so that means I didn't revise
  25. blue yes
  26. phaleth but can the error tell me to do revise in some more understandable way?
  27. blue what error did you get?
  28. phaleth after amend I did this https://paste.debian.net/plainh/2a2daa96
  29. phaleth and it suggested nonsense so I executed that and obviously got rejected
  30. phaleth how can I tell primate website image build on repopack site to use specific arg? ARG FLOG_VERSION="0.1.0"
  31. phaleth you've mentioned 0.1.1 is released
  32. blue yes
  33. blue you can configure args on a job
  34. phaleth via CLI? ok
  35. blue run `rp job args` or `rp job args --help`
  36. blue generally: rp job args add <number> FLOG_VERSION
  37. blue you can add a default with --default; if you don't, the arg is required
  38. blue <number> is the job number
  39. blue obviously you'd need to edit the Containerfile, but you know that
  40. phaleth ok, cool
  41. blue to provide the arg during run, use --build-arg
  42. blue → rp job run
  43. blue usage: rp job run <job-number> [--source <ref>] [--build-arg NAME=VALUE]... [--attach]
  44. phaleth wait, not for job, but for app
  45. phaleth for containerized deployment
  46. blue phaleth: there's already `rp task push .`. but you need a flag for force-push, as well
  47. blue how about:
  48. blue rp task push . --replace-head
  49. blue that good?
  50. phaleth rp app args is not a thing
  51. phaleth rp task push --force-with-lease
  52. blue you need the .
  53. phaleth rp task push <number> --force-with-lease
  54. blue and --force-with-lease is git terminology, I'd prefer we use something saner
  55. phaleth what does the . mean there?
  56. phaleth heh
  57. blue . means "the task branch I'm currently on"
  58. phaleth oh :D
  59. phaleth ok, good to know
  60. blue it saves you remember the number
  61. blue remembering*
  62. phaleth yeah
  63. phaleth well, alright no args passed to the deployment
  64. blue yeah, I need to see if we can add args to app deployment as well
  65. blue I'm gonna go with --replace-head, unless you have a better suggestion. but --force-with-lease means nohting to me, git has terrible DX
  66. phaleth https://repopack.com/project/primate/tasks/238
  67. phaleth that's the usecase
  68. phaleth yeah, but how can I remember --replace-head unless the error message tells me
  69. phaleth the problem is that the error message is suggesting wrong thing to do
  70. phaleth and also nothing about revise
  71. blue hold on
  72. phaleth yeah, no hurry
  73. blue phaleth: https://repopack.com/project/repopack/tasks/740
  74. blue is that ok?
  75. blue " A task in review, ready, or revision must give a direct rp task revise <number> instruction before a rewrite."
  76. blue I can do it now and release a new rp. I've been meaning to release a new rp anyway today
  77. blue probably will be a 0.2.0
  78. phaleth no idea, looks like a wall of text to me
  79. phaleth not sure if it says the user will be told to revise the task
  80. phaleth looks like it does not, so it's just spewed a lot of nonsense it seems
  81. blue 12:23 < blue> " A task in review, ready, or revision must give a direct rp task revise <number> instruction before a rewrite."
  82. phaleth also clanker just spewed what I mentioned before at me here https://repopack.com/project/rcompat/tasks/86
  83. phaleth yeah, that does not say user will be told about revise in error message
  84. phaleth does the trust me bro script accept version as arg?
  85. blue you mean flog.sh/install ?
  86. phaleth yeah, looks like it does and that's what clanker means
  87. blue flog.run/install *
  88. phaleth Pass FLOG_VERSION="$FLOG_VERSION" to the installer command itself
  89. phaleth I feel like getting dummier and dummier the more I work with clanker
  90. blue phaleth: the problem with https://repopack.com/project/rcompat/tasks/86
  91. blue is that once flog updates, this build will fail
  92. blue this is a correct observation by clankerhood
  93. blue technically it's the same problem here https://repopack.com/project/primate/tasks/238
  94. blue do you need something like flog.run/install?version=XXX ?
  95. blue hold on
  96. blue trying to understand
  97. phaleth I cannot update flog#86
  98. blue submit it again
  99. blue I see, the trust me bro script supports FLOG_VERSION
  100. blue I missed that
  101. blue clanker apologised
  102. phaleth heh
  103. phaleth damn primate#238 is already merged :D
  104. phaleth will create another one
  105. phaleth but I still cannot submit the change to flog#86 or rcompat#86? I don't know
  106. phaleth rcompat#86
  107. blue rcompat#86
  108. blue `rp task submit`
  109. blue `rp task submit .`
  110. blue doesn't ework?
  111. phaleth I mean not submit, but push commit to that task
  112. blue ok let me fix repopack#740 first
  113. blue that will improve your workflow
  114. blue your latest note on repopack#740 will be accounted for in 740
  115. phaleth why'd the clanker say it was wrong? on rcompat#86, it wasn't completely wrong
  116. phaleth ok, cool
  117. blue it wasn't wrong at all
  118. blue clanker hallucinated
  119. phaleth yeah, also too bad it's spewing so much walls of text
  120. blue ya
  121. phaleth ok, just make sure to merge https://repopack.com/project/primate/tasks/239 before new flog release
  122. blue flog 0.1.2 coming
  123. phaleth I think once the branch gets restacked or whatever is the term then the work is busted
  124. phaleth I mean the local branch
  125. blue done
  126. blue yes, restacked
  127. blue also rp 0.1.4 is soon coming with the 740 changes
  128. phaleth nice :)
  129. phaleth do you want me to create repopack task for args to be passable to container image builds?
  130. phaleth `rp app args`
  131. phaleth there is already `rp app env set <app> <key>`
  132. phaleth I mean `rp app env set <app> <key> --value-stdin`
  133. phaleth I've set flog version env var for primate https://paste.debian.net/plainh/7940c836 we will see if 0.1.2 will be used on next deployment
  134. blue yes phaleth
  135. blue create a task please
  136. phaleth you think env var will not be applied? should give that a try I think
  137. blue where is that env var coming from?
  138. phaleth not sure what you mean, I've set that env var
  139. phaleth hoping it will be passed to the image build via the --build-arg flag or whatever the rest API of podman uses
  140. phaleth but maybe those env vars are just a runtime thing, no clue
  141. phaleth also arg is a better name for this kind of thing since it's called ARG in the Containerfile as well
  142. blue but only jobs supported --build-arg, is my point
  143. blue ok, will change to --arg
  144. blue oh I see, you just used envs for apps. yes, that's correct
  145. phaleth ok, so these env vars are used both at buildtime and runtime?
  146. phaleth don't you think there should be a different mechanism for build and runtime
  147. phaleth --build-arg is good, that's descriptive and matches podman
  148. phaleth and I think env vars should only be used at runtime, but then how to pass secrets to build if build requires secrets
  149. phaleth those env vars are already write only
  150. blue apps and jobs are different
  151. blue so should we do --build-arg or --arg for jobs?
  152. phaleth job is always running during a container build right?
  153. blue job runs in a containre, yes
  154. blue and it's never long-running
  155. phaleth I mean, it's always running as `podman build` not as `podman run -rm`
  156. blue yes
  157. blue well, it's building an image
  158. blue then runs it once
  159. phaleth hmm, that's weird, it should just use a stock image and run things in a container spawned from that stock image
  160. phaleth and then --arg would be appropriate
  161. phaleth as runtime arg
  162. phaleth I think `podman run -rm` should be the way, then the script the job runs can be just an sh script
  163. phaleth actually can't remember if the flag to delete the container after it's done is `-rm`, but there is such flag
  164. phaleth that way we will not get a ton of podman build layers cached on the server
  165. blue phaleth: https://dpaste.com/HT5BZDQVS
  166. blue maybe you can create a task for this?
  167. blue then we can also decide if we use --build-arg or --arg flags.
  168. blue and also whether we rename `rp job args ...` to `rp job build-args ...`
  169. phaleth ok, so one task for jobs and another for app deployments
  170. blue yes
  171. phaleth but what I don't know is how env vars are used
  172. blue hold on, let me clarify then
  173. blue Apps: rp app env set stores a write-only value. You bind its key to an App unit, and Repopack injects it when the container runs, not while its image builds. “Write-only” means the value cannot be read back through Repopack; it does not make it a safe build secret.
  174. phaleth `rp job args` will stay as is
  175. blue env -> runtime
  176. phaleth ah, ok, that's right
  177. blue Jobs: Today, rp job run --build-arg NAME=VALUE supplies a non-secret Containerfile build argument. It does not become a runtime env var or script argument. Image-mode Jobs currently have no equivalent per-Run runtime input mechanism.
  178. phaleth I thought env is runtime thing
  179. blue it is
  180. blue So these are separate concepts. If we add stock-image Jobs that run repository scripts, we can design runtime arguments for those Jobs—and decide their CLI name then. Build-time secrets would need their own safe mechanism.
  181. phaleth ok, and how to distinguish? --build-arg --build-arg-secret ?
  182. phaleth podman build also accepts ENV, that could be always write only
  183. blue yeah, we should create the two tasks and discuss there what's needed
  184. phaleth actually no, podman build does not accept ENV
  185. blue for jobs I haven't needed secrets yet
  186. blue but it could be a use case
  187. phaleth ENV variables are embedded in the image metadata and visible to anyone who can inspect
  188. blue ya
  189. phaleth well, how does for example the migration script primate generates work then?
  190. phaleth it bakes in secrets that means secrets end up in image layer
  191. phaleth for us that is fine, but outside user would not want us have their secrets
  192. phaleth Never use ENV for secrets.
  193. phaleth during image build that is
  194. blue "That script can be in the image without baking in the credential. Repopack’s App env bindings are injected at container runtime, not image build time. If Primate’s generated script actually writes a database password or URL literally into the script or image, that’s a real issue to inspect"
  195. phaleth yeah, it has no clue obviously
  196. blue I feel like we're talking about a few different things at once
  197. phaleth it just clankered a security problem
  198. phaleth yeah, I know, three different things
  199. blue apps have envs, those are secrets
  200. blue those are write-only; you cannot read htem again over the cli
  201. blue they're also encrypted
  202. blue `rp app env`
  203. phaleth yeah, that's understood
  204. blue ok, there we don't need changes, right?
  205. phaleth right, it's just using podman run -e under the hood
  206. phaleth or the related podman REST API
  207. blue yes
  208. blue so that's ok. what's next?
  209. phaleth lets just go back to jobs for a moment
  210. blue ok
  211. phaleth right now they are running within podman image build mostly
  212. phaleth only after that's over artifacts are somehow extracted
  213. phaleth jobs have dependencies, for those it'd be nice if the user could say I wanna cache that step cause it's expensive and you guys charge me for job time
  214. phaleth but then the artifact production itself should not be cached cause it also requires the source code as second input
  215. phaleth build-args that are not secrets might be fine unless those dependencies need to be fetched from some repository requiring auth
  216. phaleth or the source code is not hosted on repopack at least partially
  217. phaleth so it's good that there is cache currently but also bad cause we have to clear it and it's not controlled by the user what gets cached
  218. phaleth and now that means simple sh script won't do, there have to be some stages to the job
  219. phaleth also I wanna bring my own stock image should be a usecase
  220. phaleth also how do we isolate builds, I think runsc can be used as runtime for containers as well as runtime for podman builds, but I don't really remember testing that after bugs got fixed in podman 6
  221. phaleth also the default stock image should just be alpine, not negotiable, if clanker can solve that one issue then lets bother it with apps
  222. phaleth I think clanker has no chance there :)
  223. phaleth also you may say that runsc will be slow, for us we should still have option to use crun
  224. phaleth couple weeks ago I was thinking of documenting how to use an ephemeral builder in a separate disposable VPS, but if runsc is an option for builds
  225. blue ok
  226. blue let me review that
  227. phaleth one sec
  228. phaleth I have this in my notes https://paste.debian.net/plainh/217b1474
  229. phaleth but that's from the time when podman 6 wasn't a thing
  230. phaleth that means the stock image should be enforced and jobs should run at container runtime
  231. phaleth the caveat is when for example rp cli is built on alpine the cross-compilation requires cgo, on debian golang can cross-compile fine
  232. phaleth so maybe there should be a limited choice of stock images for jobs
  233. blue task incoming
  234. blue https://repopack.com/project/repopack/tasks/743
  235. phaleth nice, clanker is gonna invent new scripting language to let people identify caches
  236. phaleth it's prolly gonna argue that podman is not the right thing to use for this kind of problem
  237. blue it's all complexity, why do we need this
  238. blue it's currently working well, no?
  239. phaleth caching is hard, but we need security
  240. phaleth and if people are running long running jobs and cannot optimize via caching then that's a problem
  241. phaleth but currently we don't need those two, sure
  242. blue people on free plans are gonna pretty limited anyway
  243. blue so for now we leave it as `rp job args` but `rp job run --build-arg`, yes?
  244. phaleth well, just consider at least moving from build time to runtime and take sh script as input
  245. blue move what from build time to runtime?
  246. phaleth `rp job args` but `rp job run --arg ...`
  247. blue so you wanna change from --build-arg to --arg, ya?
  248. blue that's ok for a small change for now
  249. phaleth whatever is currently defined in Containerfile should be defined in sh sript and then the container that runs the sh script can be executed using runsc to improve security
  250. phaleth and there should be two stock images available alpine and debian
  251. blue I'm not sure I understand. what change do we want for now?
  252. phaleth let me give you an example
  253. blue ok
  254. phaleth here you can see a Containerfile defining all the heavy lifting https://repopack.com/project/repopack/jobs/1?run=335
  255. phaleth instead there should just be a choice of alpine or debian
  256. blue but plain alpine or debian doesn't contain go
  257. phaleth then all that heavy lifting should be executed via user defined sh script using `podman run -rm --runtime=runsc ...` (flags might be incorrect) behind the scenes
  258. phaleth well, you can make go images available if you want
  259. phaleth the point is the list is limited to trusted images
  260. phaleth and so for us the --runtime or whatever is the correct flag anyway should be chooseable to crun
  261. blue but then we need to maintain an eternally long list of trusted images
  262. phaleth yeah, and it's easy to install golang
  263. phaleth RUN wget -c -O golang.tar.gz https://go.dev/dl/go${GO_VER}.linux-amd64.tar.gz && \
  264. phaleth tar -C /usr/local -xzf golang.tar.gz
  265. phaleth ENV PATH="/usr/local/go/bin:${PATH}"
  266. phaleth compared to that node is pain in the butt to install in image build :)
  267. blue but this is the approahc you should proposed replacing. it requires the ability to control the containerfile
  268. blue hold on
  269. phaleth yeah, sorry, I mean they should do that in the sh script
  270. phaleth but you know if podman build accepts the runtime and does not fail then Containerfiles can still be used and so the layer caching mechanism of the podman build as well
  271. blue I don't know if I want to maintain trusted images, however I have another idea
  272. phaleth yeah, I also think letting people use Containerfiles is great idea
  273. blue rp image create go-toolchain --file ci/Containerfile.tools
  274. phaleth so that means we will need an ephemeral builder
  275. blue rp image build go-toolchain
  276. blue rp job create cli-check --image go-toolchain@<version> --script ci/check.sh
  277. blue rp job run <job-number> --source <full-sha> --attach
  278. blue that solves the caching issue, right?
  279. blue users can create their own base images
  280. blue and then reuse them in a project
  281. phaleth yeah, just not sure how the last two calls relate to each other
  282. phaleth but makes sense to have four steps
  283. blue the first one defines a reusable job
  284. blue the second starts a run against a git sha
  285. phaleth ok, so rp job create will return the job-number
  286. phaleth rp job create runner then?
  287. phaleth and rp job run --runner <number>
  288. blue rp job create <job-name> --image <image-name> --script <entry-script>
  289. blue rp job run <job-number> --source <sha> --attach
  290. blue that's what I propose. right now create works differently
  291. blue rp job create release '{"source":"refs/heads/master","execution":{"mode":"containerfile","containerfile":"Containerfile.release","context":"."},"artifact_paths":["/release"]}'
  292. phaleth rp job run <job-name> --source <sha> --attach
  293. phaleth then it's good
  294. blue I think run suppotrs both number and name
  295. phaleth yeah, at least that sounds doable
  296. blue ok
  297. phaleth will prolly be hard for people to realize they shouldn't do everything at image build time, but that's a different problem
  298. phaleth some will prolly just do two stage builds if <image-name> is available via FROM call in Containerfile, which is at least better
  299. phaleth cause who can be bothered with an sh script
  300. blue ya
  301. phaleth that means it boils down to having a container registry
  302. phaleth which is also what I thought about
  303. blue image registry? ya
  304. phaleth this explains how to setup registry in a container https://oneuptime.com/blog/post/2026-02-08-how-to-set-up-docker-registry-with-basic-auth-and-htpasswd/view
  305. phaleth essentially it's just: `podman run -d -p 5000:5000 --name cr registry:3`
  306. phaleth and also volume flags
  307. blue what do we need it for?
  308. blue we can just keep images locally for now, no?
  309. phaleth so we can store custom images
  310. phaleth locally stored images is not a good idea, actually I tend to clean them up alot cause of all these security issues that have been reported
  311. phaleth and it's difficult to distinguish between what is used/valid and what is just already obsolete when it's all on a single pile
  312. blue ya
  313. phaleth also the registry allows accounts to be used, not saying namespacing is not possible in image naming, but still
  314. blue ya
  315. phaleth repopack could also manage the images by itself and as written in repopack#392 it should anyway
  316. blue phaleth: https://repopack.com/project/repopack/tasks/743
  317. blue can you provide input on this
  318. phaleth yeah, sure
  319. blue thanks phaleth
  320. phaleth no problem, added some comments that give reasons why to do all that
  321. blue alright
  322. phaleth well, wish I could edit comments, but whatever, clanker might understand
  323. blue just post a new coment
  324. phaleth yeah
  325. phaleth hope that makes sense, after jobs are implemented then apps can also use the same approach
  326. phaleth this way we get security, cache and also the user can choose what to cache such that the cache isn't lost in case repopack stays on the same machine
  327. blue nice
  328. blue ya, makes sense
  329. phaleth args can be moved from underneath `rp job` later
  330. phaleth env can be moved from underneath wherever it is later
  331. blue moved where?
  332. phaleth rp app env
  333. phaleth not sure, env is now app specific and args is job specific
  334. phaleth and both jobs and apps should be able to use args and env
  335. phaleth to project maybe?
  336. phaleth or just have both in two places rp job and rp apps in the CLI cause of multiple jobs and apps having inputs of same name
  337. blue ya maybe
  338. phaleth or have them in their own space in the cli, but require job or app as input
  339. blue I'd be wary of keeping general secrets per project and not scoped to app
  340. phaleth yeah, true
  341. phaleth also there are now releases which is like a third category I guess
  342. blue yes

Search posts