Devsy
Developing Providers

Provider Agent

When Devsy connects to an environment through a provider, it injects itself there. This counterpart is the Devsy agent. It is the same binary, run as devsy agent. The agent deploys the container, forwards credentials, runs the SSH server and stops idle environments.

The agent section of provider.yaml controls how Devsy works with it.

agent:
  path: ${DEVSY}
  local: true
  driver: docker
  inactivityTimeout: 10m
  containerInactivityTimeout: 10m
  injectGitCredentials: ${INJECT_GIT_CREDENTIALS}
  injectDockerCredentials: ${INJECT_DOCKER_CREDENTIALS}
  binaries:
    MY_BINARY:
      - os: linux
        arch: amd64
        path: https://example.com/my-binary
        checksum: <sha256 of the file>
  exec:
    shutdown: |-
      ${MY_BINARY} stop

Option values can be used in this section.

  • path: where the agent is placed on the remote machine.
  • local: set to true when Devsy runs directly on this machine instead of reaching a remote one. The built-in providers do this.
  • driver: how the container is deployed. One of docker (default), kubernetes, apple, microsandbox, custom or external. See Drivers.
  • inactivityTimeout: how long to wait before stopping an idle machine. For machine providers.
  • containerInactivityTimeout: how long to wait before stopping an idle container. For non-machine providers.
  • injectGitCredentials, injectDockerCredentials: whether to copy those credentials into the environment.
  • exec.shutdown: the command that stops the machine once it is idle. Option values are available in it.
  • binaries: helper binaries for exec.shutdown. Same format as provider binaries.

Stopping idle environments

Devsy tracks whether anyone is connected and stops the environment after the timeout. Devsy starts it again when the user returns. State persists only if the provider preserves the storage. A shutdown command that deletes the machine must keep workspace data separately, for example on a persistent volume.

Non-machine providers

The agent ends the container's main process, which stops the container. Set the timeout with containerInactivityTimeout.

Machine providers

Stopping only the container would leave the VM running and billed. Define agent.exec.shutdown with the command that stops or deletes the machine on the cloud side. Set the timeout with inactivityTimeout. The official cloud providers each do this their own way, for example with a cloud API call using a token saved in an option.

On this page