Repository navigation
Releases
Releases · t09tanaka/local-ci
v0.20.0
- Add
source::GitOptionsandsource::import_objects_with,import_objects_for_withandremove_imported_refs_with, for a caller that holds a lock of its own around these calls.GitOptions::new().hermetic()runs Git without the context'sGIT_*variables (an inheritedGIT_DIRno longer points Git at another repository), without system or global configuration (GIT_CONFIG_NOSYSTEM=1,GIT_CONFIG_GLOBAL=/dev/null), without hooks (core.hooksPath=/dev/null), and withGIT_CEILING_DIRECTORIESat the clone's parent..deadline(at)bounds each Git process. Under these functions each Git process runs in a process group of its own and is ended on the deadline or when the context'scancelhandle is cancelled: SIGTERM to that group, SIGKILL after two seconds, then it is reaped, and the call fails. No other process or group is signalled. The existing functions are unchanged. - The fetch of an import (
import_objects,import_objects_forand the new ones) passes-c gc.auto=0 -c maintenance.auto=false. An auto gc could detach and go on packing refs in the clone after the import returned, outside any lock the caller held. - The capture's own writes into the private repository, the fetch of HEAD's history and the unpack of staged blobs, pass
-c gc.auto=0 -c maintenance.auto=falsetoo. - A staged capture releases the
flockon its scratch directory explicitly when it ends. Closing the descriptor alone left the directory locked while a child that any thread of the process had forked in the meantime was still between fork and exec, so the next capture in the same directory could be refused as "in use by another capture".
v0.19.0
- Add opt-in staged publication of a capture for the library.
source::capture_source_stagedandcapture_directory_stagedtake aStaging { scratch_dir, before_install }, write every new file of the source store (objects, manifests, secret bundle, temporary files) underscratch_diron the store's file system, and install them only after the capture is stable:before_installsees the full list once, and each file is installed by a link that never replaces; an existing destination is verified in full and reused, different content is an error.StagedSnapshotsays which destinations were installed and which reused. An unstable attempt leaves nothing in the store. An install that stops part-way returns aStagedInstallError(downcastable) with the destinations it installed and reused, and undoes nothing. The objects and the secret bundle are synced to disk before the manifests are linked. One scratch directory serves one capture at a time (a capture holds aflockon it; a second one is refused). The existing entry points andCaptureOptionsare unchanged; the private Git repository undergit/and a secret bundle atCaptureOptions::secret_bundleare not staged (the caller's path is written beforebefore_installand removed if the capture fails). - The HMAC of a secret file stays over the path and the content. The bundle's mode is the constant 0600, not read from the file, so a
chmodchanges neither the source id nor the bundle; nothing changes for existing stores.
v0.18.5
- Record in each build cache entry what made its key. Beside the marker, an entry now holds
.local-ci-inputs.jsonwith the SHA-256 of each part of the key (schema, toolchain, OS, job, each lock, each build-affecting variable by name, each config file, the matrix), never the values, which can hold secrets. When a run saves an entry that an earlier run could have reused, two such files show which input made the keys differ. The file is for reading only: listing, pruning and restoring ignore it, an entry without it is as good, and it is not copied intotarget/. The key itself is unchanged. - Raise the default cap of the build cache from 20 GB to 50 GB. An entry for a mid-sized Rust workspace is 2 to 3 GB and one run of such a workspace needs about eight of them (test legs, an MSRV job, mutation shards), so the old cap was the whole of what one run needed and the entries were evicted by the run that needed them and saved again on the next.
LOCAL_CI_BUILD_CACHE_MAX_GBstill sets the cap.
v0.18.4
- Fix the build cache's entries never being deleted from the trash. An entry that the cache evicts, or a temporary one it gives up, is moved to
<cache>/trash, but the trash was emptied only of the names a worktree gets there, so neither a run norlocal-ci cache prunedeleted them and they piled up (on one machine to over a hundred GB). They are now deleted like the rest, and what is already there goes at the start of the next run. Nothing else in the trash is touched. - Expire the reusable results of every worktree, not only the one being run. A run removed the results older than a day only for its own worktree, so those of a worktree that was gone stayed for good. A run now removes them for every worktree, and the directory of one that saved nothing for a day. The first run after the upgrade removes what has piled up.
- Keep only the last run of each worktree under
runs/, instead of the last 20, and drop the runs of a worktree that is gone. Onlylocal-ci statusreads a run, the onelastnames; reusing a result does not read earlier runs. A run records its worktree's path to tell when it is gone; a run directory withoutresult.jsonis left for a day, as another run may still be writing it, and the runs an earlier version recorded no path for go once unused for a week.
v0.18.3
- Fix a step's clock starting while it still waited for task-traffic-controller, so that a step that runs for seconds timed out with only the controller's "waiting" lines in its log (
timed out after 599s (what was left of the job's 10 min)). The log was read up to its end, and task-traffic-controller writes a line and its newline apart: a read that came between them left a bare newline for the next one, and that blank line was taken for the command's output. A line is now read again from its start until it is finished, and a line not finished yet is the command's output unless it is, or may still become, one of task-traffic-controller's (so a progress line with no newline still starts the clock). A job'stimeout-minutesstill counts only the running of its setup and steps, as since 0.17.2. - For distributed step executors (library API, additive): an optional synchronous artifact action hook, whose default still uses the local artifact store; per-test shard timings kept in receipts; and a check of the runner's version at the shard step before dispatch.
local-ci runis unchanged.
v0.18.2
- Post the
local-cicommit status only when origin is on github.com, or on the host named byGH_HOST. Before,owner/namewas taken from any origin URL, so a GitLab, GitHub Enterprise or local-path origin could post to an unrelated repository on github.com. Any other origin is skipped with the reason, not a failure of the run. - A failed status post says "not on GitHub yet" only for GitHub's "No commit found" reply. Any other HTTP 422 is reported as a
gh apierror with its first line.
v0.18.1
- Fix the driver refusing to release a claim for want of state capacity.
Input::FenceandInput::AbortBeforeExecutionwere refused withDriverStorageErrorwhen the jobs they made ready (each with a copy of the outputs it needs) did not fit the driver's bounded state, so the claim kept its permit and the host could not end it. Such a release now commits like a settlement that does not fit: the claim is released with its host failure,infrastructure_failure()isDriverCapacity, the tasks nobody claimed areInfrastructureBlockedand nothing more is made ready. A release that fits is decided exactly as before, so the records of a 0.18.0 journal replay unchanged andDRIVER_VERSIONstays 8; a journal that holds such a release cannot be replayed by 0.18.0, which refuses that record. - The driver refuses a plan that holds a task named where the members of a dynamic matrix are named (
<the id of the matrix job's task>#...), withtask id is reserved for the members of a dynamic matrix, when it is built. The planner takes any key ofjobs:as a job id, so a jobbuild#0beside a jobbuildwhose matrix is an expression made such a plan; the matrix job then failed in the middle of the run. GitHub does not accept#in a job id, so no workflow that runs there is affected. A journal that 0.18.0 wrote for such a plan cannot be loaded again: the plan itself is refused. - Add
requested_at_ms,started_at_msandfinished_at_ms(UNIX epoch milliseconds) to a job'stime, so that a reader can tell whether a job was slow because it waited or because it ran long, and line jobs up against other runs and the task-traffic-controller ledger. Additive: a result without them still reads (as 0); the human report is unchanged.
v0.18.0
- Add
local_ci::driver::Driver, a host-neutral state machine that advances a run over a frozen plan: the order of the job graph, the members of a matrix (static, or named by another job's output and derived from verified source),max-parallel,fail-fast, matrix and shard joins, and run cancellation. A host proposes each input, stores the returnedTransition, then applies it; replaying the stored records gives the same state. The driver keeps its state within a fixed size and settles a result it cannot hold as a typed infrastructure failure, never as invented outputs. See "Driving a run from another host" in the README andtests/driver_host.rs. - A claimed task holds a permit until its real result (
Input::Settle), a host abort before dispatch (Input::AbortBeforeExecution), or a host fence (Input::Fence). A fence releases a claim whose worker will not answer, fails the job with no outputs, and makes the driver refuse a result that arrives later under that token. A cancel request or its acknowledgement never releases a permit. - The Runner and the driver evaluate a job (
if:, the matrix, names) with the same code. The Runner alone decides which legs of another OS a leg of the host's OS stands in for; whatlocal-ci rundoes is unchanged. - Add
execute_git_dispatchandsource_execute::execute_pinned_dispatch, which run one member of a dynamic matrix after deriving its dispatch again from verified source, andsource_execute::git_evaluation_source, which reads the scheduling facts of a plan from its exact commit with bounded reads. - Planning from Git keeps the exact bytes of a workflow (the trailing newline of a block scalar is no longer trimmed), needs a Git with
--no-lazy-fetch, and reads at most 4096 workflows and 4 MiB of them. A plan frozen by an earlier version from a workflow that ends in a block scalar has to be frozen again. - Native steps stay owned until their matrix entry ends, and are drained before the entry's services and Compose projects are removed. A Compose project named by
COMPOSE_PROJECT_NAMEfrom outside, or by a script local-ci did not rewrite, is no longer brought down by cleanup. A container is removed by the full id its creation returned. - Add
PinnedExecution::verify_workspace_with_overlay, which binds a workspace the host has already put files into. The host declares the paths (WorkspaceOverlay: files or directories, and secret files the manifest declares); they and what lies below them are left out, every other byte must match the captured source, and the bound workspace lists what was left out (PinnedWorkspace::unverified_paths). A declared path that is not a normalized relative path, is or leads through a symbolic link, or touches a submodule is refused.verify_workspaceis unchanged. - Timing floats keep their exact bits across a receipt replay (
serde_json'sfloat_roundtrip). - Not in this version:
local-ci rundoes not schedule through the driver yet; retrying a shard under a new attempt and moving artifacts between workers remain the host's work, with no driver API.
v0.17.2
- Fix a job's
timeout-minutes(and--job-timeout) being used up by its steps waiting for task-traffic-controller. The time left for a step was the job's limit minus the wall-clock time since the job started, so on a busy machine the steps of a job could wait longer than the job may run, and the next step was started with nothing left and stopped at once (timed out after 0s, no output). The time left is now the limit minus the time since the job started without the waits for task-traffic-controller (the job'swork_secs); a job whose setup and steps really run for longer than its limit times out as before. - A step that is stopped at the job's limit, not at its own
timeout-minutes, says so:timed out after 4.0s (what was left of the job's 0.1 min)(under 10 seconds the figure has a decimal). - A step that would start when the job's time is used up (a step with
if: always()orif: failure()after the one that timed out) is no longer started with a timeout of 0 seconds, where it ran only if it was over within a fraction of a second. It is not started, and reported asnot started: the job timed out (0.1 min).
v0.17.1
- Fix worktree registrations left in the repository when the checkout a run was started from (a linked worktree) is removed while the run goes on. The run ran
git worktree prunein that checkout, which failed once it was gone, and the failure was not reported; the files were deleted, so nothing in the cache said whose the registration was andlocal-ci cache prunecould not drop it. A run now unregisters each worktree in the repository the worktree itself is registered in. local-ci cache prune, run in a repository, also drops the registrations there of local-ci worktrees under the cache directory whose files are gone (left by an earlier version, or by a run killed between deleting and unregistering), and says how many. Locked registrations are left alone; like a run, it does so withgit worktree prune.