Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ linters:
# Not all errors need to be checked
- errcheck

# It's OK to have "magic" numbers in things like time.Sleep()
- mnd

# This is not a library, so it's OK to use dynamic errors
- err113

# It's OK to not initialize some struct fields
- exhaustruct
- exhaustruct_v5
Expand Down
121 changes: 3 additions & 118 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -439,33 +439,11 @@ paths:
parameters:
- in: query
name: command
description: |
Command to execute.

Required when starting a new exec session. May be omitted when reconnecting to an
existing session identified by the `session` parameter.
schema:
type: string
minLength: 1
required: false
- in: query
name: session
description: |
Optional stable exec session identifier. When present, websocket disconnects detach
from the command instead of terminating it, and later requests with the same VM name
and session id may reconnect and request buffered history.
description: Command to execute.
schema:
type: string
minLength: 1
required: false
- in: query
name: cmux_session_id
description: |
Compatibility alias for `session`. Prefer `session` for new Orchard clients.
schema:
type: string
minLength: 1
required: false
required: true
- in: query
name: interactive
description: |
Expand Down Expand Up @@ -568,9 +546,7 @@ paths:
'400':
description: Invalid parameters were supplied
'404':
description: VM resource with the given name or reconnectable exec session doesn't exist
'409':
description: Reconnectable exec session already exists with different options
description: VM resource with the given name doesn't exist
'503':
description: Controller failed to establish a connection with the VM
/vms/{name}/ip:
Expand Down Expand Up @@ -1059,19 +1035,11 @@ components:
oneOf:
- $ref: '#/components/schemas/ExecClientFrameStdin'
- $ref: '#/components/schemas/ExecClientFrameResize'
- $ref: '#/components/schemas/ExecClientFrameHistory'
- $ref: '#/components/schemas/ExecClientFrameAck'
- $ref: '#/components/schemas/ExecClientFrameDetach'
- $ref: '#/components/schemas/ExecClientFrameClose'
discriminator:
propertyName: type
mapping:
stdin: '#/components/schemas/ExecClientFrameStdin'
resize: '#/components/schemas/ExecClientFrameResize'
history: '#/components/schemas/ExecClientFrameHistory'
ack: '#/components/schemas/ExecClientFrameAck'
detach: '#/components/schemas/ExecClientFrameDetach'
close: '#/components/schemas/ExecClientFrameClose'
ExecClientFrameStdin:
description: Send bytes to the process standard input
type: object
Expand Down Expand Up @@ -1105,72 +1073,20 @@ components:
terminal:
rows: 40
cols: 120
ExecClientFrameHistory:
description: Request buffered output strictly newer than the supplied watermark
type: object
required: [ type, watermark ]
properties:
type:
type: string
enum: [ history ]
watermark:
type: integer
format: int64
minimum: 0
example:
type: history
watermark: 42
ExecClientFrameAck:
description: Acknowledge that output has been durably consumed through the supplied watermark
type: object
required: [ type, watermark ]
properties:
type:
type: string
enum: [ ack ]
watermark:
type: integer
format: int64
minimum: 0
example:
type: ack
watermark: 42
ExecClientFrameDetach:
description: Detach this websocket while leaving the remote command running
type: object
required: [ type ]
properties:
type:
type: string
enum: [ detach ]
example:
type: detach
ExecClientFrameClose:
description: Close the reconnectable exec session and terminate the remote command
type: object
required: [ type ]
properties:
type:
type: string
enum: [ close ]
example:
type: close
ExecControllerFrame:
description: WebSocket frame from Orchard Controller to the Orchard Client
oneOf:
- $ref: '#/components/schemas/ExecControllerFrameStdout'
- $ref: '#/components/schemas/ExecControllerFrameStderr'
- $ref: '#/components/schemas/ExecControllerFrameExit'
- $ref: '#/components/schemas/ExecControllerFrameError'
- $ref: '#/components/schemas/ExecControllerFrameNoMoreHistory'
discriminator:
propertyName: type
mapping:
stdout: '#/components/schemas/ExecControllerFrameStdout'
stderr: '#/components/schemas/ExecControllerFrameStderr'
exit: '#/components/schemas/ExecControllerFrameExit'
error: '#/components/schemas/ExecControllerFrameError'
no_more_history: '#/components/schemas/ExecControllerFrameNoMoreHistory'
ExecControllerFrameStdout:
description: Standard output from the process
type: object
Expand All @@ -1183,10 +1099,6 @@ components:
type: string
format: byte
description: Base64-encoded standard output bytes from the process
watermark:
type: integer
format: int64
description: Monotonic output watermark present on reconnectable sessions
example:
type: stdout
data: aGVsbG8K
Expand All @@ -1202,10 +1114,6 @@ components:
type: string
format: byte
description: Base64-encoded standard error bytes from the process
watermark:
type: integer
format: int64
description: Monotonic output watermark present on reconnectable sessions
example:
type: stderr
data: aGVsbG8K
Expand All @@ -1225,10 +1133,6 @@ components:
type: integer
format: int32
description: Process exit code
watermark:
type: integer
format: int64
description: Monotonic output watermark present on reconnectable sessions
example:
type: exit
exit:
Expand All @@ -1244,28 +1148,9 @@ components:
error:
type: string
description: Error message text
watermark:
type: integer
format: int64
description: Monotonic output watermark present on reconnectable sessions
example:
type: error
error: Failed to establish SSH connection to a VM
ExecControllerFrameNoMoreHistory:
description: Marker indicating that the requested replay range has been fully sent
type: object
required: [ type, watermark ]
properties:
type:
type: string
enum: [ no_more_history ]
watermark:
type: integer
format: int64
description: Highest watermark known to the exec session at the time of replay
example:
type: no_more_history
watermark: 42
ExecTerminalSize:
description: Pseudo-terminal size
type: object
Expand Down
4 changes: 0 additions & 4 deletions internal/command/controller/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ var noExperimentalRPCV2 bool
var experimentalPingInterval time.Duration
var experimentalDisableDBCompression bool
var workerOfflineTimeout time.Duration
var execSessionRetentionTTL time.Duration
var execSSHConnectionKeepaliveInterval time.Duration
var synthetic bool

Expand Down Expand Up @@ -92,8 +91,6 @@ func newRunCommand() *cobra.Command {
"duration (e.g. 60s or 5m30s) after which a worker is considered offline for the purposes "+
"of scheduling (no new VMs will be scheduled on such worker and already assigned VMs will be "+
"marked as failed)")
cmd.Flags().DurationVar(&execSessionRetentionTTL, "exec-session-retention-ttl", 10*time.Minute,
"duration to retain reconnectable exec session history after the command exits")
cmd.Flags().DurationVar(&execSSHConnectionKeepaliveInterval, "exec-ssh-connection-keepalive-interval", 30*time.Second,
"interval between SSH keepalive requests sent by the controller for shared exec connections")

Expand Down Expand Up @@ -156,7 +153,6 @@ func runController(cmd *cobra.Command, args []string) (err error) {
controller.WithListenAddr(address),
controller.WithDataDir(dataDir),
controller.WithWorkerOfflineTimeout(workerOfflineTimeout),
controller.WithExecSessionRetentionTTL(execSessionRetentionTTL),
controller.WithExecSSHConnectionKeepaliveInterval(execSSHConnectionKeepaliveInterval),
controller.WithLogger(logger),
}
Expand Down
Loading