Commit Graph

21 Commits

Author SHA1 Message Date
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
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 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 ed7921ce16
Fix websocket.(*Conn).timeoutLoop goroutine leak (#329) 2025-07-11 15:23:50 +04:00
Nikolay Edigaryev a37a8914cd
orchard controller run: introduce --experimental-ping-interval (#316)
* orchard controller run: introduce --experimental-ping-interval

* Ensure that --experimental-ping-interval is always larger than 5s
2025-05-15 21:14:17 +04:00
Nikolay Edigaryev d52aa91927
Controller: periodically send PINGs on all WebSocket connections (#315) 2025-05-15 18:43:52 +04:00
Nikolay Edigaryev 61d7d34ea4
RPC v2: fix Ping() hanging due to PONG not being processed (#247) 2025-02-07 22:05:09 +04:00
Nikolay Edigaryev 8dd74db446
Worker notification improvements (#246)
* OpenAPI: document all default "wait" values

* Re-use waitContext instead of instantiating it anew
2025-02-07 00:38:04 +04:00
Fedor Korotkov 86f0afb5a3
Small timout for worker notification (#242)
* Small timout for worker notification

It seems at the moment if a worker re-establishes notify stream (for example, if network flips or proxy breaks the connection) then we can see "no worker registered with this name" errors.

This change makes Notifier to wait for 30 seconds before failing, at the time of calling `Notifier#Notify` we know such worker exists.

PS not sure if we need to make the timeout configurable.

* Wait via context

* Make sure all `context`s for `Notify` is time bounded

* Lint issues
2025-02-06 17:30:09 +00: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 077252f6d4
Prevent goroutine leak when Close()'ing *grpc_net_conn.Conn (#237) 2025-01-23 18:17:14 +04:00
Nikolay Edigaryev 4df43e6432
Default ?wait= to 0 seconds (#190) 2024-07-03 23:07:14 +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 a52c205c34
API(port forward endpoint): handle normal WebSocket closure gracefully (#108) 2023-07-20 20:55:42 +00:00
Nikolay Edigaryev 6a325daf74
Switch from golang.org/x/net/websocket to nhooyr.io/websocket and handle NotFound errors (#105)
* Switch from golang.org/x/net/websocket to nhooyr.io/websocket

* Do not attach errors that we can handle to the Gin's context

* Add missing newline to "no credentials specified or found, ..." message

* Fix potential NPE in ChooseUsernameAndPassword()

* Fix type in PortForward() error message in "orchard ssh vm"

* Fix potential NPE in Connections()

* Use header.Set() for consistency's sake for Authorization header
2023-07-04 18:10:41 +04:00
Fedor Korotkov 5eaf6b24d4
Make port-forward endpoint to wait for the VM (#65)
* Make port-forward endpoint to wait for the VM

Fixes #62

* Fixes after rebase
2023-03-27 23:52:21 +04: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 af074f499d
Remove UID for now and use machine ID to differentiate workers (#48)
* Remove UID for now and use machine ID to differentiate workers

* Rename MetadataWorkerKey back to MetadataWorkerNameKey
2023-03-23 23:38:54 +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