feat: allow specifying devcontainer on agent in terraform (#16997)

This change allows specifying devcontainers in terraform and plumbs it
through to the agent via agent manifest.

This will be used for autostarting devcontainers in a workspace.

Depends on coder/terraform-provider-coder#368
Updates #16423
This commit is contained in:
Mathias Fredriksson
2025-03-20 19:09:39 +02:00
committed by GitHub
parent 287e3198d8
commit 69ba27e347
49 changed files with 2615 additions and 1253 deletions

View File

@ -0,0 +1 @@
DROP TABLE workspace_agent_devcontainers;

View File

@ -0,0 +1,19 @@
CREATE TABLE workspace_agent_devcontainers (
id UUID PRIMARY KEY,
workspace_agent_id UUID NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
workspace_folder TEXT NOT NULL,
config_path TEXT NOT NULL,
FOREIGN KEY (workspace_agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE
);
COMMENT ON TABLE workspace_agent_devcontainers IS 'Workspace agent devcontainer configuration';
COMMENT ON COLUMN workspace_agent_devcontainers.id IS 'Unique identifier';
COMMENT ON COLUMN workspace_agent_devcontainers.workspace_agent_id IS 'Workspace agent foreign key';
COMMENT ON COLUMN workspace_agent_devcontainers.created_at IS 'Creation timestamp';
COMMENT ON COLUMN workspace_agent_devcontainers.workspace_folder IS 'Workspace folder';
COMMENT ON COLUMN workspace_agent_devcontainers.config_path IS 'Path to devcontainer.json.';
CREATE INDEX workspace_agent_devcontainers_workspace_agent_id ON workspace_agent_devcontainers (workspace_agent_id);
COMMENT ON INDEX workspace_agent_devcontainers_workspace_agent_id IS 'Workspace agent foreign key and query index';

View File

@ -0,0 +1,15 @@
INSERT INTO
workspace_agent_devcontainers (
workspace_agent_id,
created_at,
id,
workspace_folder,
config_path
)
VALUES (
'45e89705-e09d-4850-bcec-f9a937f5d78d',
'2021-09-01 00:00:00',
'489c0a1d-387d-41f0-be55-63aa7c5d7b14',
'/workspace',
'/workspace/.devcontainer/devcontainer.json'
)