Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[pull] main from coder:main #76

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 10, 2025
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
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ indent_style = tab
indent_style = space
indent_size = 2

[*.proto]
indent_style = space
indent_size = 2

[coderd/database/dump.sql]
indent_style = space
indent_size = 4
1 change: 1 addition & 0 deletions coderd/database/db2sdk/db2sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ func WorkspaceAgent(derpMap *tailcfg.DERPMap, coordinator tailnet.Coordinator,

workspaceAgent := codersdk.WorkspaceAgent{
ID: dbAgent.ID,
ParentID: dbAgent.ParentID,
CreatedAt: dbAgent.CreatedAt,
UpdatedAt: dbAgent.UpdatedAt,
ResourceID: dbAgent.ResourceID,
Expand Down
270 changes: 135 additions & 135 deletions provisionerd/proto/provisionerd.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,173 +11,173 @@ message Empty {}

// AcquiredJob is returned when a provisioner daemon has a job locked.
message AcquiredJob {
message WorkspaceBuild {
reserved 3;

string workspace_build_id = 1;
string workspace_name = 2;
repeated provisioner.RichParameterValue rich_parameter_values = 4;
repeated provisioner.VariableValue variable_values = 5;
repeated provisioner.ExternalAuthProvider external_auth_providers = 6;
provisioner.Metadata metadata = 7;
bytes state = 8;
string log_level = 9;
// previous_parameter_values is used to pass the values of the previous
// workspace build. Omit these values if the workspace is being created
// for the first time.
repeated provisioner.RichParameterValue previous_parameter_values = 10;
}
message TemplateImport {
provisioner.Metadata metadata = 1;
repeated provisioner.VariableValue user_variable_values = 2;
}
message TemplateDryRun {
reserved 1;

repeated provisioner.RichParameterValue rich_parameter_values = 2;
repeated provisioner.VariableValue variable_values = 3;
provisioner.Metadata metadata = 4;
}

string job_id = 1;
int64 created_at = 2;
string provisioner = 3;
string user_name = 4;
bytes template_source_archive = 5;
oneof type {
WorkspaceBuild workspace_build = 6;
TemplateImport template_import = 7;
TemplateDryRun template_dry_run = 8;
}
// trace_metadata is currently used for tracing information only. It allows
// jobs to be tied to the request that created them.
map<string, string> trace_metadata = 9;
message WorkspaceBuild {
reserved 3;

string workspace_build_id = 1;
string workspace_name = 2;
repeated provisioner.RichParameterValue rich_parameter_values = 4;
repeated provisioner.VariableValue variable_values = 5;
repeated provisioner.ExternalAuthProvider external_auth_providers = 6;
provisioner.Metadata metadata = 7;
bytes state = 8;
string log_level = 9;
// previous_parameter_values is used to pass the values of the previous
// workspace build. Omit these values if the workspace is being created
// for the first time.
repeated provisioner.RichParameterValue previous_parameter_values = 10;
}
message TemplateImport {
provisioner.Metadata metadata = 1;
repeated provisioner.VariableValue user_variable_values = 2;
}
message TemplateDryRun {
reserved 1;

repeated provisioner.RichParameterValue rich_parameter_values = 2;
repeated provisioner.VariableValue variable_values = 3;
provisioner.Metadata metadata = 4;
}

string job_id = 1;
int64 created_at = 2;
string provisioner = 3;
string user_name = 4;
bytes template_source_archive = 5;
oneof type {
WorkspaceBuild workspace_build = 6;
TemplateImport template_import = 7;
TemplateDryRun template_dry_run = 8;
}
// trace_metadata is currently used for tracing information only. It allows
// jobs to be tied to the request that created them.
map<string, string> trace_metadata = 9;
}

message FailedJob {
message WorkspaceBuild {
bytes state = 1;
repeated provisioner.Timing timings = 2;
}
message TemplateImport {}
message TemplateDryRun {}

string job_id = 1;
string error = 2;
oneof type {
WorkspaceBuild workspace_build = 3;
TemplateImport template_import = 4;
TemplateDryRun template_dry_run = 5;
}
string error_code = 6;
message WorkspaceBuild {
bytes state = 1;
repeated provisioner.Timing timings = 2;
}
message TemplateImport {}
message TemplateDryRun {}

string job_id = 1;
string error = 2;
oneof type {
WorkspaceBuild workspace_build = 3;
TemplateImport template_import = 4;
TemplateDryRun template_dry_run = 5;
}
string error_code = 6;
}

// CompletedJob is sent when the provisioner daemon completes a job.
message CompletedJob {
message WorkspaceBuild {
bytes state = 1;
repeated provisioner.Resource resources = 2;
repeated provisioner.Timing timings = 3;
repeated provisioner.Module modules = 4;
repeated provisioner.ResourceReplacement resource_replacements = 5;
}
message TemplateImport {
repeated provisioner.Resource start_resources = 1;
repeated provisioner.Resource stop_resources = 2;
repeated provisioner.RichParameter rich_parameters = 3;
repeated string external_auth_providers_names = 4;
repeated provisioner.ExternalAuthProviderResource external_auth_providers = 5;
repeated provisioner.Module start_modules = 6;
repeated provisioner.Module stop_modules = 7;
repeated provisioner.Preset presets = 8;
bytes plan = 9;
bytes module_files = 10;
}
message TemplateDryRun {
repeated provisioner.Resource resources = 1;
repeated provisioner.Module modules = 2;
}

string job_id = 1;
oneof type {
WorkspaceBuild workspace_build = 2;
TemplateImport template_import = 3;
TemplateDryRun template_dry_run = 4;
}
message WorkspaceBuild {
bytes state = 1;
repeated provisioner.Resource resources = 2;
repeated provisioner.Timing timings = 3;
repeated provisioner.Module modules = 4;
repeated provisioner.ResourceReplacement resource_replacements = 5;
}
message TemplateImport {
repeated provisioner.Resource start_resources = 1;
repeated provisioner.Resource stop_resources = 2;
repeated provisioner.RichParameter rich_parameters = 3;
repeated string external_auth_providers_names = 4;
repeated provisioner.ExternalAuthProviderResource external_auth_providers = 5;
repeated provisioner.Module start_modules = 6;
repeated provisioner.Module stop_modules = 7;
repeated provisioner.Preset presets = 8;
bytes plan = 9;
bytes module_files = 10;
}
message TemplateDryRun {
repeated provisioner.Resource resources = 1;
repeated provisioner.Module modules = 2;
}

string job_id = 1;
oneof type {
WorkspaceBuild workspace_build = 2;
TemplateImport template_import = 3;
TemplateDryRun template_dry_run = 4;
}
}

// LogSource represents the sender of the log.
enum LogSource {
PROVISIONER_DAEMON = 0;
PROVISIONER = 1;
PROVISIONER_DAEMON = 0;
PROVISIONER = 1;
}

// Log represents output from a job.
message Log {
LogSource source = 1;
provisioner.LogLevel level = 2;
int64 created_at = 3;
string stage = 4;
string output = 5;
LogSource source = 1;
provisioner.LogLevel level = 2;
int64 created_at = 3;
string stage = 4;
string output = 5;
}

// This message should be sent periodically as a heartbeat.
message UpdateJobRequest {
reserved 3;

string job_id = 1;
repeated Log logs = 2;
repeated provisioner.TemplateVariable template_variables = 4;
repeated provisioner.VariableValue user_variable_values = 5;
bytes readme = 6;
map<string,string> workspace_tags = 7;
reserved 3;

string job_id = 1;
repeated Log logs = 2;
repeated provisioner.TemplateVariable template_variables = 4;
repeated provisioner.VariableValue user_variable_values = 5;
bytes readme = 6;
map<string,string> workspace_tags = 7;
}

message UpdateJobResponse {
reserved 2;
reserved 2;

bool canceled = 1;
repeated provisioner.VariableValue variable_values = 3;
bool canceled = 1;
repeated provisioner.VariableValue variable_values = 3;
}

message CommitQuotaRequest {
string job_id = 1;
int32 daily_cost = 2;
string job_id = 1;
int32 daily_cost = 2;
}

message CommitQuotaResponse {
bool ok = 1;
int32 credits_consumed = 2;
int32 budget = 3;
bool ok = 1;
int32 credits_consumed = 2;
int32 budget = 3;
}

message CancelAcquire {}

service ProvisionerDaemon {
// AcquireJob requests a job. Implementations should
// hold a lock on the job until CompleteJob() is
// called with the matching ID.
rpc AcquireJob(Empty) returns (AcquiredJob) {
option deprecated = true;
};
// AcquireJobWithCancel requests a job, blocking until
// a job is available or the client sends CancelAcquire.
// Server will send exactly one AcquiredJob, which is
// empty if a cancel was successful. This RPC is a bidirectional
// stream since both messages are asynchronous with no implied
// ordering.
rpc AcquireJobWithCancel(stream CancelAcquire) returns (stream AcquiredJob);

rpc CommitQuota(CommitQuotaRequest) returns (CommitQuotaResponse);

// UpdateJob streams periodic updates for a job.
// Implementations should buffer logs so this stream
// is non-blocking.
rpc UpdateJob(UpdateJobRequest) returns (UpdateJobResponse);

// FailJob indicates a job has failed.
rpc FailJob(FailedJob) returns (Empty);

// CompleteJob indicates a job has been completed.
rpc CompleteJob(CompletedJob) returns (Empty);
// AcquireJob requests a job. Implementations should
// hold a lock on the job until CompleteJob() is
// called with the matching ID.
rpc AcquireJob(Empty) returns (AcquiredJob) {
option deprecated = true;
};
// AcquireJobWithCancel requests a job, blocking until
// a job is available or the client sends CancelAcquire.
// Server will send exactly one AcquiredJob, which is
// empty if a cancel was successful. This RPC is a bidirectional
// stream since both messages are asynchronous with no implied
// ordering.
rpc AcquireJobWithCancel(stream CancelAcquire) returns (stream AcquiredJob);

rpc CommitQuota(CommitQuotaRequest) returns (CommitQuotaResponse);

// UpdateJob streams periodic updates for a job.
// Implementations should buffer logs so this stream
// is non-blocking.
rpc UpdateJob(UpdateJobRequest) returns (UpdateJobResponse);

// FailJob indicates a job has failed.
rpc FailJob(FailedJob) returns (Empty);

// CompleteJob indicates a job has been completed.
rpc CompleteJob(CompletedJob) returns (Empty);
}
Loading
Loading