Commit Graph

25 Commits

Author SHA1 Message Date
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 2b4e3b6b01
Enable Gin's context fallback (#409) 2026-02-11 18:04:15 +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 bafcf6fac2
Simplify state reconciliation and support changing Softnet settings (#364)
* Simplify state reconciliation and support changing Softnet settings

* Remove unused "updateFunc" parameter from syncOnDiskVMs()

* Don't take an address of a loop variable

* ensure → ensures

* updateVMState(): don't forget to update VMState

* Introduce TestSpecUpdateSoftnet integration test

* Update OpenAPI specification to include generation/observedGeneration
2025-11-06 20:56:31 +04:00
Nikolay Edigaryev af221cf3c1
Support for prefixed Orchard Controller API URLs (#355)
* Support for prefixed Orchard Controller API URLs

* Fix Swagger UI

* Remove spurious "fmt" import

* Use url.URL in order to correctly calculate API path for Swagger UI
2025-10-06 20:04:47 +04:00
Nikolay Edigaryev c5e0d68a3d
API: introduce ability to watch a VM (#351)
* API: introduce ability to watch a VM

* Document ?watch=true for GET /vms/{name} in the OpenAPI specification

* WatchVM: ensure that goroutine is terminated on early return with error

* WatchVM: close channels on goroutine exit

* WatchVM: ensure that we wait for the goroutine after additional barriers

* WatchVM: ignore unexpected keys instead of throwing an error

* WatchVM: perform context-aware writes to a bounded channel

* WatchVM: don't forget to close errCh on goroutine exit too

* WatchVM: don't close readyCh in goroutine to avoid ambiguity

* WatchVM: filter out spurious KVs that signify VM deletion
2025-10-03 21:34:53 +04:00
Nikolay Edigaryev 88fba8004d
Introduce WebSocket-based RPC v2 (#239)
* Introduce WebSocket-based RPC v2

* go test: add -ldflags="-B gobuildid"

* No need to change the "controller.workerNotifier.Notify()" error message

* No need to modify Protocol Buffers/gRPC generated code

* rpcWatch(): explain that connection shouldn't be normally be closed

* Avoid "port forwarding failed: " repetition in error messages

* Improve comments and avoid repetition in IP resolution errors
2025-01-30 17:33:32 +04:00
Nikolay Edigaryev 1730eaf67c
orchard controller: make sure that output goes through the logger (#207)
...which emits JSON on the production for easier processing.
2024-09-17 22:54:43 +04:00
Nikolay Edigaryev 76f192bdb0
API endpoint and associated RPC changes to resolve VMs IP's (#188)
* API endpoint and associated RPC changes to resolve VMs IP's

* Fix "Missing expected argument '<name>'" error when doing "tart set"

* Implement TestIPEndpoint() and IP() method in controller HTTP client
2024-07-03 22:56:43 +04:00
Nikolay Edigaryev 13b4e192f0
Introduce "orchard {port-forward, vnc} worker WORKER_NAME" (#140)
* Fix potential NPE in Client.wsRequest()

* Introduce "orchard {port-forward, vnc} worker WORKER_NAME"

* portspec.go: simplify logic and respect [LOCAL_PORT]:REMOTE_PORT format
2023-10-09 18:51:34 +04:00
Nikolay Edigaryev 036eb954be
Retry DB transactions on badger.ErrConflict (#114)
* Log HTTP 500 errors in more detail

* Log errors in storeView and storeUpdate

* Retry on badger.ErrConflict
2023-08-15 15:18:47 +04:00
Nikolay Edigaryev d57d18d380
Support for sharing files with the host system (#103)
* Support for sharing files with the host system

* Integration tests

* Added back TestVMGarbageCollection comment
2023-07-04 18:10:53 +04:00
Fedor Korotkov 010df300a3
Add basic Prometheus metrics (#82)
Fixes #71
2023-04-21 10:05:01 +04:00
Nikolay Edigaryev 77656517fd
Controller info endpoint and API integration examples (#75)
* Controller API: introduce controller's information endpoint

* Prevent generation of empty events after channel closure

* Allow events to be buffered in the events channel

* Controller API: introduce controller's information endpoint[1]

* IntegrationGuide.md: a couple of Python and Golang examples

* Rephrase a sentence

Co-authored-by: Fedor Korotkov <fedor.korotkov@gmail.com>

---------

Co-authored-by: Fedor Korotkov <fedor.korotkov@gmail.com>
2023-04-11 07:28:46 +00:00
Nikolay Edigaryev 357a042937
REST API: provide error messages in error responses (#66)
* REST API: provide error messages in error responses

* Fix role checking logic and add tests

* Ignore testpackage linter error

* Rename NewError() to NewErrorResponse()
2023-03-27 14:12:03 -04:00
Nikolay Edigaryev cb39836ee0
Resources support (#63)
* Resources support

* Ability to provide VM and worker resources via the CLI

* orchard dev: always listen on :6120

* orchard dev: support --resources

* REST API: provide resource defaults when creating VM

* OpenAPI: document "resources" field

* orchard dev: serve Swagger API documentation on /v1/

* Integration guide
2023-03-27 17:30:54 +04:00
Fedor Korotkov 9b5ad09841
Consolidate controller bootstrap login in `run` command (#38) 2023-03-21 15:36:55 -04:00
Fedor Korotkov fb3056d3ae
Refactorings for simplify readability (#35) 2023-03-17 06:11:28 -04:00
Nikolay Edigaryev 47fef47d1c
Port forwarding support (#30)
* Port forwarding support

* .golangci.yml: remove and replace deprecated and archived linters

* Client: pass credentials when calling WebSocket API methods

* API: require ServiceAccountRoleComputeWrite role for port forwarding

* Use Buf

* Rename Poll() RPC method to Watch()

* Split Rendezvous into two parts: Watcher and Proxy (#32)

* Split Rendezvous into two parts: Watcher and Proxy

* Implement Proxy cancellation

* Use Protocol Buffers structure directly in Watcher

* Fix TestWatcher after switching to Protocol Buffers structure

* portForwardVM(): ensure we also check for gin's context
2023-03-14 11:31:13 -04:00
Fedor Korotkov 0582108ea6
Events Entity (#28)
* Generic Events

We can try to use these generic events for script execution and storing of the output logs in events with `log` kind.

* Lint issues

* Cleanup events upon VM deletion

* Basic integration test

* Run an actual VM in tests

* Apply suggestions from code review

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

* Use POST

* Make newEventKey private

* Append events in batches

* Lint issues

* Private `scopePrefix`

---------

Co-authored-by: Nikolay Edigaryev <edigaryev@gmail.com>
2023-03-13 08:04:17 -04:00
Nikolay Edigaryev 8df31f7c2d
Introduce service accounts and bootstrap tokens (#22) 2023-02-21 11:34:12 -05:00
Fedor Korotkov edb9b3d693
Refactored working with a storage (#20) 2023-02-08 19:36:30 -05:00
Nikolay Edigaryev 0b9b96b8c9
Introduce "orchard context" (#18) 2023-02-07 19:48:31 +04:00
Nikolay Edigaryev 92e8732d46
Initial version of the Orchard orchestration system (#3)
* Initial version of the Orchard orchestration system

* Update README.md

Co-authored-by: Fedor Korotkov <fedor.korotkov@gmail.com>

Co-authored-by: Fedor Korotkov <fedor.korotkov@gmail.com>
2023-01-26 23:46:23 +04:00