Submit

Back to the channels

#repopack

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

Search posts