Skip to content

Releases

v0.20.0

Choose a tag to compare

@t09tanaka t09tanaka released this 24 Nov 07:34
6b68152
  • Add source::GitOptions and source::import_objects_with, import_objects_for_with and remove_imported_refs_with, for a caller that holds a lock of its own around these calls. GitOptions::new().hermetic() runs Git without the context's GIT_* variables (an inherited GIT_DIR no 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 with GIT_CEILING_DIRECTORIES at 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's cancel handle 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_for and 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=false too.
  • A staged capture releases the flock on 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

Choose a tag to compare

@t09tanaka t09tanaka released this 23 Nov 05:53
a5157c8
  • Add opt-in staged publication of a capture for the library. source::capture_source_staged and capture_directory_staged take a Staging { scratch_dir, before_install }, write every new file of the source store (objects, manifests, secret bundle, temporary files) under scratch_dir on the store's file system, and install them only after the capture is stable: before_install sees 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. StagedSnapshot says which destinations were installed and which reused. An unstable attempt leaves nothing in the store. An install that stops part-way returns a StagedInstallError (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 a flock on it; a second one is refused). The existing entry points and CaptureOptions are unchanged; the private Git repository under git/ and a secret bundle at CaptureOptions::secret_bundle are not staged (the caller's path is written before before_install and 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 chmod changes neither the source id nor the bundle; nothing changes for existing stores.

v0.18.5

Choose a tag to compare

@t09tanaka t09tanaka released this 22 Nov 23:28
47b2dc3
  • Record in each build cache entry what made its key. Beside the marker, an entry now holds .local-ci-inputs.json with 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 into target/. 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_GB still sets the cap.

v0.18.4

Choose a tag to compare

@t09tanaka t09tanaka released this 22 Nov 22:25
a2a80bc
  • 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 nor local-ci cache prune deleted 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. Only local-ci status reads a run, the one last names; reusing a result does not read earlier runs. A run records its worktree's path to tell when it is gone; a run directory without result.json is 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

Choose a tag to compare

@t09tanaka t09tanaka released this 18 Nov 06:22
00d483f
  • 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's timeout-minutes still 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 run is unchanged.

v0.18.2

Choose a tag to compare

@t09tanaka t09tanaka released this 17 Nov 13:13
be4a2c5
  • Post the local-ci commit status only when origin is on github.com, or on the host named by GH_HOST. Before, owner/name was 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 api error with its first line.

v0.18.1

Choose a tag to compare

@t09tanaka t09tanaka released this 17 Nov 09:49
ecc87ed
  • Fix the driver refusing to release a claim for want of state capacity. Input::Fence and Input::AbortBeforeExecution were refused with DriverStorageError when 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() is DriverCapacity, the tasks nobody claimed are InfrastructureBlocked and 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 and DRIVER_VERSION stays 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>#...), with task id is reserved for the members of a dynamic matrix, when it is built. The planner takes any key of jobs: as a job id, so a job build#0 beside a job build whose 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_ms and finished_at_ms (UNIX epoch milliseconds) to a job's time, 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

Choose a tag to compare

@t09tanaka t09tanaka released this 17 Nov 07:31
ae3892a
  • 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 returned Transition, 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 and tests/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; what local-ci run does is unchanged.
  • Add execute_git_dispatch and source_execute::execute_pinned_dispatch, which run one member of a dynamic matrix after deriving its dispatch again from verified source, and source_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_NAME from 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_workspace is unchanged.
  • Timing floats keep their exact bits across a receipt replay (serde_json's float_roundtrip).
  • Not in this version: local-ci run does 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

Choose a tag to compare

@t09tanaka t09tanaka released this 17 Nov 05:41
d0a5912
  • 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's work_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() or if: 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 as not started: the job timed out (0.1 min).

v0.17.1

Choose a tag to compare

@t09tanaka t09tanaka released this 16 Nov 02:28
78c91a8
  • 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 prune in 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 and local-ci cache prune could 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 with git worktree prune.