Commit Graph
181 Commits
Author SHA1 Message Date
edi-oai a838bb0299 Worker: introduce automatic "org.cirruslabs.orchard.worker-name" label (#481)
* Worker: introduce automatic "org.cirruslabs.orchard.worker-name" label

* TestLabelsCopy: use constants to fix linter error
2026-09-03 00:24:20 +01:00
edi-oai a3e08ffcbf Support running host processes alongside VMs (#482)
* Regenerate .pb with protoc-gen-go v1.36.11

* Support running host processes alongside VMs

* Replace existing host processes when starting a set
2026-09-03 00:24:09 +01:00
edi-oai 3fe0a284c5 Add endpoint support (#478)
* Add endpoint support

* Document endpoint network exposure
2026-09-02 16:08:39 +01:00
edi-oai 62acf3c265 Support dynamically updating Softnet policy (#477)
* Support dynamically updating Softnet policy

* Use cmpopts.EquateEmpty() when comparing two VMSpecs
2026-09-02 14:19:29 +01:00
Yibo Zhuang f0bdf3a151 tart: make deletion of missing VMs idempotent (#474)
Treat tart delete exit code 2 as successful cleanup so deleting an
already-removed VM does not prevent reconciliation from continuing.
Preserve other command failures and retain the wrapped process error
so callers can inspect its exit status.

Cover repeated deletion, other exit codes, process startup failures,
and wrapped exit-status preservation.

Pin CI actions to their previously used commit SHAs so jobs can start
under the repository action-pinning policy.

Validation: vmmanager package tests and lint for changed lines pass;
CI action pins match the last successful run.
2026-09-01 17:15:40 -07:00
Yibo Zhuang 9b8365edcf worker: wait for Tart and Vetu stop completion (#472)
Share one Stop completion per run and retain Stopping until both the stop command and VM cleanup finish. Expose transition conditions to reconciliation and return after requesting Stop so it cannot apply a generation or restart the VM early.

Cover both completion orders, repeated and concurrent calls, restart, and generation acknowledgement with bounded fake-command regressions. Allow process startup under parallel test load while preserving explicit shutdown ordering.
2026-09-01 21:59:50 +01:00
Yibo Zhuang ae29e3c979 Worker: preserve configuration of suspended Tart clones (#473)
Read the cloned VM state before applying resource overrides or randomizing
its MAC address and serial. Suspended clones must retain the configuration
used to save their state.

Cover suspended and stopped clones through the command runner, including
assigned resource precedence, optional image FQN lookup, and metadata
command and JSON errors.
2026-09-01 21:59:48 +01:00
Yibo Zhuangandkroo-oai c42244f7e6 Bound worker log retention (#476)
Keep at most five rotated worker log files for up to fourteen days and
compress them. Retain the existing 100 MB rotation threshold so long-running
workers do not accumulate an unlimited number of log backups.

Co-authored-by: kroo-oai <kroo@openai.com>
2026-09-01 21:34:14 +01:00
Yibo Zhuang 28c0dd37b4 Add an option to disable Tart clipboard sharing (#475)
Expose noClipboard in VM creation, CLI inspection, and the API schema.
Pass --no-clipboard to Tart when requested. Clipboard sharing remains
enabled by default for existing VM specifications.
2026-09-01 21:32:55 +01:00
kylefuhrmanncalm cc2c0fd034 Add --no-audio support to VM spec (#460)
tart run supports --no-audio to disable host audio pass-through, but
there was no way to request it through a VM's spec - Headless, Nested,
and Suspendable all have a flag/field but audio didn't. Useful on
headless hosts with no audio hardware, where audio pass-through can
make guest CoreAudio depend on host audio services that don't exist.
2026-09-01 09:17:45 -07:00
Alex KotliarskyiandYibo Zhuang 2ce494a717 Apply backpressure to live exec output subscribers (#464)
* Apply backpressure to live exec output subscribers

* Use integer range loops in exec backpressure test

* Preserve reconnectable exec subscriber isolation

---------

Co-authored-by: Yibo Zhuang <yzhuang@openai.com>
2026-08-25 15:19:33 -07:00
Yibo Zhuang 381a8bb7e6 Prevent overcommitted workers from reporting unlimited capacity (#470) 2026-08-24 09:11:09 -07:00
Yibo Zhuang 6cbee5352e Bound VM inventory initialization before worker registration (#467) 2026-08-19 09:58:56 -07:00
Yibo Zhuang 6cdb1b78d9 Recover controller sessions without stopping active VMs (#466) 2026-08-19 09:21:32 -07:00
Yibo Zhuang 2da158908c Wait for VM shutdown before freeing worker capacity (#465) 2026-08-18 07:38:36 -07:00
edi-oai b217649ef0 Prevent failed host-dir VMs from restarting (#463) 2026-08-17 16:44:43 -07:00
edi-oai 3ec5e3e585 Disable host directory sharing by default (#462) 2026-08-17 22:45:08 +01:00
Fedor Kororkov 461af8de47 Migrate CI from Cirrus CI to GitHub Actions (#447)
* Migrate CI to GitHub Actions

* Publish Orchard through the OpenAI Homebrew tap

* Scope release secrets to GoReleaser steps

* Separate release and snapshot trust paths

* Use GitHub-hosted macOS 26 runner

* Run macOS unit tests on hosted runner

* Update Homebrew install command

* Build Docker image with GoReleaser

* Use GitHub-hosted Linux runner

* Use smaller Vetu image for Linux tests

* Run Linux tests on hosted ARM runner

* Use host architecture for Linux integration tests

* Preinstall Cloud Hypervisor for Linux tests

* Select Linux test images by architecture

* Satisfy platform image lint rules

* Format platform image errors

* Enable KVM access for Linux tests

* Honor VM wait time in WebSocket requests

* Satisfy WebSocket client lint rules

* Allow hosted Linux integration tests more time
2026-07-16 17:57:06 -04:00
Fedor Kororkov b30bb5bedf Reuse exec SSH connections per VM (#440) 2026-05-11 15:56:46 -04:00
Fedor Kororkov 324a352376 preserve worker last_seen on sparse updates (#439) 2026-05-06 15:49:35 -04:00
Fedor Kororkov 3083b541df Retry VM exec SSH setup under concurrent load (#437) 2026-05-05 15:13:29 -04:00
Fedor Kororkov 2667a01cf8 Add more options to /exec (#435)
* Add SSH exec session options

* Remove unused exec session helper
2026-05-05 08:56:18 -04:00
Fedor Kororkov e6a3314f58 Supporting reconnecting to /exec socket (#434) 2026-05-04 15:49:19 -04:00
Fedor Korotkov 88506b1adb Remove license tier validation (#428) 2026-04-12 15:27:27 -04:00
Nikolay Edigaryev 3cfa244550 create vm: introduce --{os,arch,runtime} command-line arguments (#422)
* create vm: introduce --{os,arch,runtime} command-line arguments

* v1.VM: prevent unsupported fields for "vetu" runtime
2026-03-17 19:46:00 +01:00
Nikolay Edigaryev 9092a9f172 Support Vetu virtualization on Linux in addition to Tart on macOS (#419)
* Support Vetu virtualization on Linux in addition to Tart on macOS

* api(portForward): ensure that rendezvousConn is closed

* Re-try SSH connections in integration tests

Because a VM might be still booting.
2026-03-16 11:12:28 +01:00
Matt e20a16ee8e Fix race in port-forward (#418) 2026-03-05 15:56:13 +01:00
Nikolay Edigaryev 3fffe5fb74 Replace Prometheus with OpenTelemetry (#413) 2026-02-23 19:01:10 +01:00
Nikolay Edigaryev a64f76a934 controller(api): new "GET /vms/{name}/exec" WebSocket-based endpoint (#408)
* controller(api): new "GET /vms/{name}/exec" WebSocket-based endpoint

* Split SSH connection and execution to avoid standard input handoff

* execstream: make Exit field a pointer again

To support serializing exit codes equal to 0.
2026-02-12 13:35:06 +01:00
Nikolay Edigaryev 5a0e6ed1d6 Instantiate new client for each spawned worker (#402) 2026-02-11 18:04:21 +01:00
Nikolay Edigaryev 2b4e3b6b01 Enable Gin's context fallback (#409) 2026-02-11 18:04:15 +01:00
Nikolay Edigaryev c4b7378883 controller(listVMs): avoid copy of each element when filtering (#401)
* controller(listVMs): avoid copy of each element when filtering

* Explain the change
2026-02-06 18:16:58 +01:00
Nikolay Edigaryev f3b4eb42ca Worker: decouple updateWorker() and syncVMs() to use different triggers (#403)
* Worker: decouple updateWorker() and syncVMs() to use different triggers

* Actually return an error otherwise errgroup won't terminate
2026-02-06 18:16:40 +01:00
Nikolay Edigaryev bdc2af3d58 controller(listVMs): reduce allocations (#400)
* controller(listVMs): reduce allocations

* Declare an empty, non-nil slice to return [] when no objects are found
2026-02-05 22:02:21 +01:00
Fedor KorotkovandCodex be869f10d4 Refactor listing VMs (#399)
* Removed unnesesary ListOptions

* Refactor genericList to accept string prefixes instead of byte slices

* Optimize VM listing logic with singleflight to deduplicate concurrent request

* Refactor VM listing logic: rename variables for clarity and update error messages

* fix: address PR review feedback

- use singleflight DoChan with context cancellation for list VMs

🤖 Generated with [Codex](https://chatgpt.com/codex)

Co-Authored-By: Codex <codex@openai.com>

---------

Co-authored-by: Codex <codex@openai.com>
2026-02-05 18:51:45 +01:00
Nikolay Edigaryev 230a83c740 Worker: ignore HTTP 404 when updating VM (#397) 2026-02-05 13:01:05 +01:00
Nikolay Edigaryev d1fb330d7e echoserver: do not treat client errors as fatal (#398) 2026-02-05 13:00:43 +01:00
Nikolay Edigaryev 2c0629f52b Introduce "compute:connect" role (#393)
* Introduce "compute:connect" role

* Fix message fixture in TestAuthorizeAuthenticatedNoRoles
2026-01-29 19:55:28 +01:00
Nikolay Edigaryev 688238837a Implement server-side filtering for VMs by worker (#392)
* Implement server-side filtering for VMs by worker

* Parse more than one filter but error out when more than one is provided

* Fix off-by-one

* No need to use "\n" in Debugf()
2026-01-29 17:52:24 +01:00
Nikolay Edigaryev 81a2c7b2df Support authentication and TLS in k6 load testing script (#391) 2026-01-29 09:00:32 +01:00
Nikolay Edigaryev a234ec8995 orchard worker run: introduce "--synthetic" and "--workers" hidden flags (#390)
* orchard worker run: introduce "--synthetic" and "--workers" hidden flags

* Use slices.Clone() instead of directly assigning slices

* Use errgroup's context instead of command's context
2026-01-28 16:50:25 +01:00
Nikolay Edigaryev 7775515a73 Load testing: synthetic VMs, multiple worker support and Grafana k6 test (#389)
* Load testing: synthetic VMs, multiple worker support and Grafana k6 test

* echoserver: prevent fallthrough when Accept() fails

* Move default local-dev context logic to CreateDevController()

* Synthetic: add a random delay to startup script echoing
2026-01-28 10:54:55 +01:00
6fe523ef69 Add pagination support for listing VM events (#386)
* Add pagination support for listing VM events

Introduced a paginated event listing API, added support for pagination parameters in the request, and included cursor-based navigation using headers. Relevant tests and Badger store implementations were updated to support the new logic.

* Remove support for ordering VM events

Dropped `ListOrder` type, `order` query parameter, and related logic for ordering VM events. Updated tests, API schema, and Badger store to reflect the removal.

* Remove invalid VM events ordering test

Deleted a test case for invalid VM events ordering since the `order` query parameter and related functionality have been removed.

* Add support for ordering VM events

Implemented `order` query parameter for specifying sort order (ascending/descending) of VM events. Updated API schema, Badger store, and added related tests.

* Add support for limiting and ordering VM logs

Introduced `--limit` and `--order` flags for controlling the number of log lines and their sort order (ascending/descending). Updated API client to handle new options.

* Update internal/controller/store/badger/badger_events.go

Co-authored-by: Nikolay Edigaryev <edigaryev@gmail.com>

* fix: address PR review feedback

- switch logs CLI to --tail with desc ordering
- reuse ParseLogsOrder in controller with helpful errors
- always use ListEventsPage and scope event cursors
- move events pagination coverage to integration test

🤖 Generated with [Codex](https://chatgpt.com/codex)

Co-Authored-By: Codex <codex@openai.com>

* refactor: simplify prefix trimming and improve error formatting

- Replaced manual prefix check with `bytes.TrimPrefix` in Badger store.
- Enhanced error message formatting in VM logs controller.

* fix: address PR review feedback

- use suggested reverse seek in badger events pagination
- add events pagination client helper and use it in integration test

🤖 Generated with [Codex](https://chatgpt.com/codex)

Co-Authored-By: Codex <codex@openai.com>

---------

Co-authored-by: Nikolay Edigaryev <edigaryev@gmail.com>
Co-authored-by: Codex <codex@openai.com>
2026-01-22 09:22:53 -05:00
Nikolay Edigaryev ea89d01760 Worker: define VM interface and make tart.VM conform to it (#388)
* Worker: define VM interface and make tart.VM conform to it

* Hopefully produce better diff
2026-01-21 18:57:22 +01:00
Fedor Korotkov 173a34b083 Some extra documentation for LLMs (#377) 2025-12-03 20:45:58 +01:00
Nikolay Edigaryev 5c162ce603 Power state fixes (#376)
* Do not call vm.Suspend() and vm.Stop() twice

* Do not attempt to Stop() or Suspend() the VM twice
2025-12-03 11:38:27 +01:00
Nikolay Edigaryev 76a552bade Ability to set VM's power state and retrieve backing Tart VM's name (#373)
* Ability to set VM's power state and retrieve backing Tart VM's name

* Validate user-provided "powerState" field

* Introduce TestSpecUpdatePowerStateSuspend

* Introduce TestSpecUpdatePowerStateStopped

* OpenAPI specification: add note about suspended VMs to "tartName" desc.

* Sometimes we need to wait more than 30 seconds
2025-12-02 16:43:17 -05:00
Nikolay Edigaryev 9cdfd75f79 Badger store: avoid code duplication by using generic methods (#369)
* Badger store: avoid code duplication by using generic methods

* No need to return PT, can return just *T
2025-11-17 18:34:59 +04:00
Nikolay Edigaryev 4e0dc749d0 BadgerDB: set logging level to INFO (#367) 2025-11-11 22:43:48 +04:00
Nikolay Edigaryev 60303d11dd VM specification: allow suspendable VMs (#366) 2025-11-11 21:16:28 +04:00