aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/pkg
AgeCommit message (Collapse)Author
2026-01-11internal/pkg: compare interfaces for host netOphestra
An upcoming improvement in the container init makes the current host net check return the same result for both cases. This change Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-09internal/pkg: pass context to file cureOphestra
This removes the left over embedded contexts. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-09internal/pkg: move dependency flooding to cacheOphestra
This imposes a hard upper limit to concurrency during dependency satisfaction and moves all dependency-related code out of individual implementations of Artifact. This change also includes ctx and msg as part of Cache. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-08internal/pkg: use short wait delayOphestra
The cure is condemned at the point of cancellation and all of its state is destroyed by the deferred cleanup, so it makes little sense to wait for it much. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-08internal/pkg: use correct artifact countOphestra
This updates buffer sizes and counters to use correct total artifact count. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-08internal/pkg: place ephemeral upperdir in tmpOphestra
This enables the use of directories made writable this way as scratch space. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-08internal/pkg: support explicit overlay mountOphestra
This removes all but the /work/ auto overlay behaviour and enables much greater flexibility. This also renames ExecContainerPath to ExecPath so it is easier to type. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-08internal/pkg: set container WaitDelayOphestra
This prevents a container from blocking forever after context is canceled. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-08internal/pkg: make tar temporary directory writableOphestra
This allows it to be renamed to work directory. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-08internal/pkg: reserve kind rangeOphestra
This is useful for custom implementations of Artifact. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-07internal/pkg: do not connect stdinOphestra
This introduces external state when verbose. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-07internal/pkg: tar optional fileOphestra
This allows tar to take a single-file directory Artifact as input. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-07internal/pkg: return reader for filesOphestra
This improves efficiency for cache hits. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-07internal/pkg: support tarball compressed via bzip2Ophestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-07internal/pkg: reject entry types disallowed in the cacheOphestra
These are not encoded in the format, they are rejected here to serve as a check for cache since checksum is computed for every directory. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-07internal/pkg: automatic overlay mount on workOphestra
This directly submits the upperdir to cache. It is primarily used in bootstrapping where tools are limited and should not be used unless there is a very good reason to. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-07internal/pkg: respect mount order for overlay tempOphestra
Setting it up after everything else prevents covering files in /tmp. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-07internal/pkg: implement file artifactOphestra
This is an Artifact implementing File, backed by a constant, caller-supplied byte slice. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-07internal/pkg: fail on empty output directoryOphestra
This works around the fact that execArtifact always creates the work directory when setting up the bind mount. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-06internal/pkg: automatic overlay mount on tmpOphestra
This sets up the last Artifact to target /tmp as a writable overlay mount backed by the host side temp directory. This is useful for an Artifact containing source code to be built for another Artifact for example. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-06internal/pkg: do not clear execute bitOphestra
Only write should be cleared here, clearing execute causes execArtifact to be unable to start anything since no Artifact is able to produce an executable file. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-06internal/pkg: automatic overlay mount on rootOphestra
This makes it possible to use an Artifact as root without arranging for directory creation in the Artifact ahead of time. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-06internal/pkg/testdata: check networkOphestra
This validates hostNet state. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-06internal/pkg: known checksum exec artifactOphestra
This optionally attaches an output checksum to an execArtifact and enables host networking for the resulting container. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-06internal/pkg: update http checksum signatureOphestra
This was using the old pre-KnownChecksum function signature. It did not affect correctness since httpArtifact performs internal validation to avoid the strict mode vfs roundtrip, but it prevented content-addressed cache hits. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-06internal/pkg: relocate testtool workaroundOphestra
This can be reused in other test cases. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-06internal/pkg: exec nil path check during cureOphestra
This results in os.ErrInvalid instead of a panic, which hopefully improves user experience. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-06internal/pkg: ensure parent for non-directory entriesOphestra
This works around streams containing out of order entries. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-06internal/pkg: implement exec artifactOphestra
This runs a program in a container environment. Artifacts can be made available to the container, they are cured concurrently and mounted in order. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-06internal/pkg: destroy temp during deferred cleanupOphestra
This avoids missing the cleanup when cure returns an error. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-06internal/pkg: expose cure through cure contextOphestra
This allows a curing Artifact to cure Artifact it depends on. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-06internal/pkg: pass cure context as single valueOphestra
This cleans up the function signature and makes backwards compatible API changes possible. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-05internal/pkg: verify checksum after uneventful scrubOphestra
This checks that scrub did not condemn any entry without reporting it. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-05internal/pkg: consistency check for on-disk cacheOphestra
This change adds a method to check on-disk cache consistency and destroy inconsistent entries as they are encountered. This primarily helps verify artifact implementation correctness, but can also repair a cache that got into an inconsistent state from curing a misbehaving artifact, without having to destroy the entire cache. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-05internal/pkg: override "." for directory checksumOphestra
This makes the checksum consistent with the final resting state of artifact directories without incurring the cost of an extra pair of chown syscalls. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-05internal/pkg: delete stale done channelsOphestra
There is no reason to keep these around. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-05internal/pkg: expand single directory tarballOphestra
This enables much cleaner use of their output without giving up any meaningful data. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-05internal/pkg: temporary scratch space for cureOphestra
This allows for more flexibility during implementation. The use case that required this was for expanding single directory tarballs. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-05internal/pkg: compute http identifier from urlOphestra
The previous implementation exposes arbitrary user input to the cache as an identifier, which is highly error-prone and can cause the cache to enter an inconsistent state if the user is not careful. This change replaces the implementation to compute identifier late, using url string as params. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-05internal/pkg: improve artifact interfaceOphestra
This moves all cache I/O code to Cache. Artifact now only contains methods for constructing their actual contents. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-04internal/pkg: ignore typeflag 'g'Ophestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-04internal/pkg: create symlinks for filesOphestra
These are much easier to handle than hard links and should be just as transparent for this use case. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-04internal/pkg: implement tar artifactOphestra
This is useful for unpacking tarballs downloaded from the internet. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-04internal/pkg: override working directory permsOphestra
This must be writable to enable renaming, and the final result is conventionally read-only alongside the entire directory contents. This change overrides the permission bits as part of Store. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-04internal/pkg: enable cache access during storeOphestra
This is still not ideal as it makes entry into Store sequential. This will be improved after more usage code is written. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-03internal/pkg: pass context in request wrapperOphestra
This method is for the most common use case, and in actual use there will always be an associated context. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-03internal/pkg: implement caching for directoriesOphestra
This works on any directories and should be robust against any bad state the artifact curing process might have failed at. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-03internal/pkg: wrap checksum string encodingOphestra
This wraps base64.URLEncoding.EncodeToString for cleaner call site. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-03internal/pkg: compute identifier from depsOphestra
This provides infrastructure for computing a deterministic identifier based on current artifact kind, opaque parameters data, and optional dependency kind and identifiers. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-03internal/pkg: create work directoryOphestra
This is used for artifacts that cure into directories. Signed-off-by: Ophestra <cat@gensokyo.uk>