* 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.
* 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
* 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
* Allow creating VMs with implicit CPU and memory
* Clarify why cpu/memory can be 0 a bit better
* Controller(API): don't forget to update DefaultCPU and DefaultMemory
* Add an integration test for implicit CPU and memory
* POST /v1/workers: do not list workers in a single update txn
* schedulingLoopIteration(): do not list workers in a single update txn
* .golangci.yml: remove mentions of fully deprecated linters
* Schedule opportunistically and more granularly
To avoid transaction conflicts.
* Measure scheduling loop iteration duration and log it at debugging level
* Use "continue NextWorker" instead of just "continue" for clarity
* Controller: emit lifecycle events when the VM gets restarted or deleted
* vm_{scheduling,run}_time → vm_{scheduling,run}_duration for clarity
* Update VM endpoint: only update VM started time when zero
* Implement restart policy for VMs
* Do not update VM.Resource, we only use it as a read-only specification
* Err()/setErr(): use atomic.Pointer instead of sync.Mutex
* Fail VMs if the worker had crashed/is unhealthy
* OnDiskName: properly handle cases when VM's name contains hyphens
* Worker: introduce Offline() method and check it before scheduling
* tart.List(): use Tart's JSON output
* OnDiskName: remove empty parts check
* Scheduler: move health-checking logic to a separate function
* Only fail "running" VMs
* Only fail orphaned VMs if they're in terminal state
* Integration tests
* Run healthCheckingLoopIteration() before schedulingLoopIteration()
* Worker: sync on-disk VMs only once at start
Before we had two main loops: controller loop to assign VMs and worker loop to start VMs. Each of the loops was performed upon an interval every N seconds.
This change introduces a mechanism for reactively requesting loop execution:
1. Controller loop will be executed upon VM creation to try to immediately schedule.
2. A worker will be notified upon a VM assigment and worker loop will be requested to sync immediately.
Fixes#31
* 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