Repository navigation
feat(runners): a coder runner created from the console (runners 17d, #309) - #960
Merged
Merged
Conversation
…309) Adds Adapters::Coder and its seam to the Coder services, registers coder (not creatable until 17e), the minutely reconciler for platform-made environments, and the integration removal rules for deleted runners. Signed-off-by: Alex <[email protected]>
Signed-off-by: Alex <[email protected]>
Signed-off-by: Alex <[email protected]>
Signed-off-by: Alex <[email protected]>
Signed-off-by: Alex <[email protected]>
Signed-off-by: Alex <[email protected]>
Signed-off-by: Alex <[email protected]>
Signed-off-by: Alex <[email protected]>
Signed-off-by: Alex <[email protected]>
…er sweep Signed-off-by: Alex <[email protected]>
… hold; name the health and integration writes on Runner Signed-off-by: Alex <[email protected]>
…cts the removal Signed-off-by: Alex <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Row 17d of
docs/design/agent-runtimes/runner-coder.md§14: thecoderrunner type end to end, behind the console. Sessions run on Coder workspaces that the platform provisions, installsaixle-runneron, and deletes after each session (fresh). Nobody can create the type from the UI yet (17e):Adapter::UNRELEASED_TYPES = %w[coder]refuses creation inCore::Management.saveand keeps the type out ofavailable_types.Runners::Adapters::Coder < Provisionedand its seamAdapters::Coder::Workspaces(names only::Coder::Interface,Holder,Errors). Hooks:provision/prepare(allocate(wait: false)),inject_bootstrap(VM, sudo and systemd checks, then the install over SSH withSettings.runners.install_timeout),teardown!,check_health(§7.3, Coder asked at most every 5 min),observe,launch_refusal,new_environment,listed_environments,machine_counts. Coder errors map asExhaustedErrortoCapacityError,OperationError/QuotaErrortoProvisionError.coderinAdapter::REGISTRYandConfigSchemawithout the template keys,on_releaseand theif/thenrule.Core::Allocation.reconcile!(+Interface.reconcile!,RunnerHealth::ReconcileActivityscheduled after the health check): overdue build under a session that no longer retries,failedtotearing_down,tearing_downretried (longest-waiting first), sweep of the holds ofgoneenvironments (delete first, release on:gone).Settings.runners.max_teardowns_per_runcaps its own retries and sweeps, not a session's own cleanup.runners_coder_integrationfor deleted runners,has_many :runnerscounts only runners not deleted, removal nulls deleted runners' reference and is refused while one has an environment that is notgone.Coder::Core::Commands.exec!gainsstdin_data:(the install script is piped tosh);Interfacedelegates it unchanged.docs/architecture/runtime-layers.md: guarantee 13, guarantee 11 forcoder, "Adding a runtime or a runner type".Design deviations
Adapter#advance!(nowadvance!(env, now:)on the base andmanual) to fail an overdue environment, andAdapter#teardown!for the sweep ofgoneenvironments (window: one day), so no adapter method is added. Retries go to the environment attempted longest ago (touchper attempt), so a refused delete cannot starve the others.Checks of runner-coder.md §17
coderCLI: yes, the application image (Dockerfile,CODER_CLI_VERSION).Tests
Adapter (
coder_test.rb), reconciler (reconcile_test.rb), sessions on a coder runner with Coder behind WebMock (runner_coder_session_test.rb), integration removal, registry. Run on a Coder workspace: the runner, coder, container-runtime, model, state-machine, temporal and db suites pass, with the layering tests. rubocop and brakeman are clean.