1
0
Fork 0
mirror of https://github.com/imjasonh/kontain.me synced 2026-07-08 09:04:54 +00:00
Commit graph

8 commits

Author SHA1 Message Date
977420c74d git: document incremental plan/blockers; some deps work
Signed-off-by: Jason Hall <imjasonh@gmail.com>
2026-05-15 10:30:35 -04:00
c90342181d fix upload-pack negotiation for stateless-RPC
Three related bugs in the git smart-HTTP upload-pack handler surfaced as
'bad band #78', 60s 504 hangs, and "expected ACK/NAK, got '?PACK'" when
fetching after previous pulls.

- Don't advertise no-done; we don't implement the ACK ready handshake.
- With multi_ack_detailed, don't emit per-round NAKs — only the final
  one after 'done'. Per-round NAKs make the client treat the first as
  the transition to sideband pack data, then choke on the second.
- Break out of the negotiation loop when a round reads no content
  (client closed without 'done') so we don't spin on EOF.
- Only emit pack data when 'done' was actually received. Non-final
  rounds get just NAK so HTTP keep-alive doesn't desync the next round.

Also trigger null_resource.test on the ko_build image digest so tests
re-run on every deploy.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 21:54:40 -04:00
ac854e7f67 git: use ref in cache key
Signed-off-by: Jason Hall <imjasonh@gmail.com>
2026-05-13 18:08:57 -04:00
2b7bb23ae2 git: annotate the checkout layer with the resolved commit, source, and ref
gitLayer now returns the commit it checked out (dereferencing annotated
tags). build records it, the clone URL, and the ref name as
me.kontain.git.{commit,source,ref} annotations on the checkout layer's
manifest descriptor, so the commit a :branch / :tag / :latest pull
resolved to is visible from the image manifest. The test now also checks
gitLayer's returned commit matches what resolveRef resolved.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 13:05:51 -04:00
d3d7e20500 git: own the checkout as the image's user so git can write to it
The layer's entries were root-owned, but cgr.dev/chainguard/git runs as
uid 65532, so `git fetch`/`git commit` inside the checkout failed with
"Permission denied" creating .git/FETCH_HEAD. Stamp the base image's
runtime uid/gid onto every layer entry, and explicitly emit the
checkout's parent directories (git/, git/<repo>/, git/<repo>/.git/) so
the image extractor doesn't auto-create them root-owned.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 12:45:50 -04:00
Claude
b00925bf9e
git: assert objects stay packed in the layer
Guards against a regression where go-git would unpack the fetched packfile
into loose objects, which would put the repo's whole decompressed contents in
memory.

https://claude.ai/code/session_01Jfhuuwb5haNaasc9hs53jw
2026-05-12 15:28:42 +00:00
Claude
61e2ace4bc
git: stream worktree into the layer instead of unpacking to disk
git.kontain.me used to clone+checkout a repo onto Cloud Run's tmpfs (memory)
and then tar the result. Now it fetches the packfile into an in-memory git dir,
walks the requested commit's tree, and streams each blob straight into the
layer tar. Only the packfile bytes (plus go-git's delta cache) are buffered, so
memory no longer scales with the size of the checked-out worktree.

The shipped .git directory is preserved (with core.bare unset and a generated
index) so the git CLI still works inside the checkout. Object SHAs change since
the tar is rebuilt differently, but the contents are the same.

https://claude.ai/code/session_01Jfhuuwb5haNaasc9hs53jw
2026-05-12 14:54:11 +00:00
2e4488f6d3 add git.kontain.me
Signed-off-by: Jason Hall <imjasonh@gmail.com>
2026-05-11 21:42:04 -04:00