diff --git a/docs/libraries/workflow/DEVELOPING.md b/docs/libraries/workflow/DEVELOPING.md new file mode 100644 index 0000000000..647fb5a4a6 --- /dev/null +++ b/docs/libraries/workflow/DEVELOPING.md @@ -0,0 +1,176 @@ +# Developing + +## View realtime logs + +```logql +{name="monolith-workflow-worker"} +``` + +## Fixing errors + +If you run in to a too many retries error on a workflow, then: + +1. Update the workflow code +2. Re-wake the workflow +3. Wait for the workflow to poll for new changes + +For a single workflow: + +```sql +UPDATE db_workflow.workflows SET wake_immediate = true WHERE workflow_id = 'MY_ID':uuid; +``` + +For all workflows of a type: + +```sql +UPDATE db_workflow.workflows SET wake_immediate = true WHERE workflow_name = 'MY_NAME'; +``` + + +# Visualize entire workflow history + +```sql +WITH workflow_events AS ( + SELECT '1db61ba2-6271-40a5-9a38-e6fa212e6f7d'::uuid AS workflow_id +) +SELECT location, 'activity' AS t, activity_name, input, output, forgotten +FROM db_workflow.workflow_activity_events, workflow_events +WHERE + workflow_activity_events.workflow_id = workflow_events.workflow_id +UNION ALL +SELECT location, 'signal' AS t, signal_name AS name, null as input, null as output, forgotten +FROM db_workflow.workflow_signal_events, workflow_events +WHERE + workflow_signal_events.workflow_id = workflow_events.workflow_id +UNION ALL +SELECT location, 'sub_workflow' AS t, sub_workflow_id::STRING AS name, null as input, null as output, forgotten +FROM db_workflow.workflow_sub_workflow_events, workflow_events +WHERE + workflow_sub_workflow_events.workflow_id = workflow_events.workflow_id +UNION ALL +SELECT location, 'signal_send' AS t, signal_name AS name, null as input, null as output, forgotten +FROM db_workflow.workflow_signal_send_events, workflow_events +WHERE + workflow_signal_send_events.workflow_id = workflow_events.workflow_id +UNION ALL +SELECT location, 'message_send' AS t, message_name AS name, null as input, null as output, forgotten +FROM db_workflow.workflow_message_send_events, workflow_events +WHERE + workflow_message_send_events.workflow_id = workflow_events.workflow_id +UNION ALL +SELECT location, 'loop' AS t, NULL AS name, null as input, null as output, forgotten +FROM db_workflow.workflow_loop_events, workflow_events +WHERE + workflow_loop_events.workflow_id = workflow_events.workflow_id +ORDER BY location ASC; +``` + +## Completely delete workflow with ID + +```sql +WITH workflow_ids AS ( + SELECT 'WORKFLOW_ID':uuid AS workflow_id +), +delete_activity_events AS ( + DELETE FROM db_workflow.workflow_activity_events + WHERE workflow_id IN (SELECT workflow_id FROM workflow_ids) + RETURNING 1 +), +delete_signal_events AS ( + DELETE FROM db_workflow.workflow_signal_events + WHERE workflow_id IN (SELECT workflow_id FROM workflow_ids) + RETURNING 1 +), +delete_sub_workflow_events AS ( + DELETE FROM db_workflow.workflow_sub_workflow_events + WHERE workflow_id IN (SELECT workflow_id FROM workflow_ids) + RETURNING 1 +), +delete_signal_send_events AS ( + DELETE FROM db_workflow.workflow_signal_send_events + WHERE workflow_id IN (SELECT workflow_id FROM workflow_ids) + RETURNING 1 +), +delete_message_send_events AS ( + DELETE FROM db_workflow.workflow_message_send_events + WHERE workflow_id IN (SELECT workflow_id FROM workflow_ids) + RETURNING 1 +), +delete_loop_events AS ( + DELETE FROM db_workflow.workflow_loop_events + WHERE workflow_id IN (SELECT workflow_id FROM workflow_ids) + RETURNING 1 +), +delete_activity_errors AS ( + DELETE FROM db_workflow.workflow_activity_errors + WHERE workflow_id IN (SELECT workflow_id FROM workflow_ids) + RETURNING 1 +) +DELETE FROM db_workflow.workflows +WHERE workflow_id IN (SELECT workflow_id FROM workflow_ids) +RETURNING 1; +``` + +## Completely delete workflow with name + +```sql +WITH workflow_ids AS ( + SELECT workflow_id + FROM db_workflow.workflows + WHERE workflow_name = 'WORKFLOW_NAME' +), +delete_activity_events AS ( + DELETE FROM db_workflow.workflow_activity_events + WHERE workflow_id IN (SELECT workflow_id FROM workflow_ids) + RETURNING 1 +), +delete_signal_events AS ( + DELETE FROM db_workflow.workflow_signal_events + WHERE workflow_id IN (SELECT workflow_id FROM workflow_ids) + RETURNING 1 +), +delete_sub_workflow_events AS ( + DELETE FROM db_workflow.workflow_sub_workflow_events + WHERE workflow_id IN (SELECT workflow_id FROM workflow_ids) + RETURNING 1 +), +delete_signal_send_events AS ( + DELETE FROM db_workflow.workflow_signal_send_events + WHERE workflow_id IN (SELECT workflow_id FROM workflow_ids) + RETURNING 1 +), +delete_message_send_events AS ( + DELETE FROM db_workflow.workflow_message_send_events + WHERE workflow_id IN (SELECT workflow_id FROM workflow_ids) + RETURNING 1 +), +delete_loop_events AS ( + DELETE FROM db_workflow.workflow_loop_events + WHERE workflow_id IN (SELECT workflow_id FROM workflow_ids) + RETURNING 1 +), +delete_activity_errors AS ( + DELETE FROM db_workflow.workflow_activity_errors + WHERE workflow_id IN (SELECT workflow_id FROM workflow_ids) + RETURNING 1 +) +DELETE FROM db_workflow.workflows +WHERE workflow_id IN (SELECT workflow_id FROM workflow_ids) +RETURNING 1; +``` + +## Misc + +```sql +select * +from db_workflow.workflows +where workflow_name = 'backend' +order by create_ts desc; +``` + +```sql +select workflow_activity_errors.* +from db_workflow.workflows +inner join db_workflow.workflow_activity_errors using (workflow_id) +where workflows.workflow_name = 'backend'; +``` diff --git a/docs/libraries/workflow/USEFUL_QUERIES.md b/docs/libraries/workflow/USEFUL_QUERIES.md deleted file mode 100644 index 5579b9198f..0000000000 --- a/docs/libraries/workflow/USEFUL_QUERIES.md +++ /dev/null @@ -1,36 +0,0 @@ -# Aggregate entire history - -```sql -SELECT location, 'activity' AS t, activity_name AS name -FROM db_workflow.workflow_activity_events -WHERE - workflow_id = $1 AND NOT forgotten -UNION ALL -SELECT location, 'signal' AS t, signal_name AS name -FROM db_workflow.workflow_signal_events -WHERE - workflow_id = $1 AND NOT forgotten -UNION ALL -SELECT location, 'sub_workflow' AS t, sub_workflow_id::STRING AS name -FROM db_workflow.workflow_sub_workflow_events -WHERE - workflow_id = $1 AND NOT forgotten -UNION ALL -SELECT location, 'signal_send' AS t, signal_name AS name -FROM db_workflow.workflow_signal_send_events -WHERE - workflow_id = $1 AND NOT forgotten -UNION ALL -SELECT location, 'message_send' AS t, message_name AS name -FROM db_workflow.workflow_message_send_events -WHERE - workflow_id = $1 AND NOT forgotten -UNION ALL -SELECT location, 'loop' AS t, NULL AS name -FROM db_workflow.workflow_loop_events -WHERE - workflow_id = $1 AND NOT forgotten -ORDER BY location ASC; -``` - -> Remove `AND NOT forgotten` to show all events, including past loop executions diff --git a/fern/definition/servers/__package__.yml b/fern/definition/servers/__package__.yml index 271ec8948f..ea7ed3cb21 100644 --- a/fern/definition/servers/__package__.yml +++ b/fern/definition/servers/__package__.yml @@ -77,7 +77,7 @@ types: CreateServerRuntimeRequest: properties: - image: uuid + build: uuid arguments: optional> environment: optional> diff --git a/fern/definition/servers/common.yml b/fern/definition/servers/common.yml index 90de29bc0d..2e10861ea1 100644 --- a/fern/definition/servers/common.yml +++ b/fern/definition/servers/common.yml @@ -21,7 +21,7 @@ types: Runtime: properties: - image: uuid + build: uuid arguments: optional> environment: optional> diff --git a/lib/bolt/core/src/dep/cargo/cli.rs b/lib/bolt/core/src/dep/cargo/cli.rs index fbe18b93cf..41f2f1bb81 100644 --- a/lib/bolt/core/src/dep/cargo/cli.rs +++ b/lib/bolt/core/src/dep/cargo/cli.rs @@ -176,10 +176,9 @@ pub async fn build<'a, T: AsRef>(ctx: &ProjectContext, opts: BuildOpts<'a, FROM rust:1.80.0-slim AS rust - RUN apt-get update && apt-get install -y protobuf-compiler pkg-config libssl-dev g++ git - - RUN apt-get install --yes libpq-dev wget - RUN wget https://github.com/mozilla/sccache/releases/download/v0.2.15/sccache-v0.2.15-x86_64-unknown-linux-musl.tar.gz \ + RUN apt-get update \ + && apt-get install --yes protobuf-compiler pkg-config libssl-dev g++ git libpq-dev wget \ + && wget https://github.com/mozilla/sccache/releases/download/v0.2.15/sccache-v0.2.15-x86_64-unknown-linux-musl.tar.gz \ && tar xzf sccache-v0.2.15-x86_64-unknown-linux-musl.tar.gz \ && mv sccache-v0.2.15-x86_64-unknown-linux-musl/sccache /usr/local/bin/sccache \ && chmod +x /usr/local/bin/sccache @@ -191,13 +190,12 @@ pub async fn build<'a, T: AsRef>(ctx: &ProjectContext, opts: BuildOpts<'a, # Build and copy all binaries from target directory into an empty image (it is not # included in the output because of cache mount) - RUN chmod +x ./build_script.sh RUN \ --mount=type=cache,target=/usr/local/cargo/git \ --mount=type=cache,target=/usr/local/cargo/registry \ --mount=type=cache,target=/usr/rivet/target \ --mount=type=cache,target=/usr/rivet/oss/target \ - sh -c ./build_script.sh && mkdir /usr/bin/rivet && find target/{optimization} -maxdepth 1 -type f ! -name "*.*" -exec mv {{}} /usr/bin/rivet/ \; + chmod +x ./build_script.sh && sh -c ./build_script.sh && mkdir /usr/bin/rivet && find target/{optimization} -maxdepth 1 -type f ! -name "*.*" -exec mv {{}} /usr/bin/rivet/ \; # Create an empty image and copy binaries + test outputs to it (this is to minimize the # size of the image) diff --git a/lib/convert/src/impls/ds.rs b/lib/convert/src/impls/ds.rs index b701324334..fbf71788b0 100644 --- a/lib/convert/src/impls/ds.rs +++ b/lib/convert/src/impls/ds.rs @@ -21,7 +21,7 @@ impl ApiTryFrom for models::ServersServer { destroyed_at: value.destroy_ts, tags: Some(to_value(value.tags).unwrap()), runtime: Box::new(models::ServersRuntime { - image: unwrap!(value.image_id).as_uuid(), + build: unwrap!(value.image_id).as_uuid(), arguments: Some(value.args), environment: Some(value.environment), }), diff --git a/sdks/full/go/servers/types.go b/sdks/full/go/servers/types.go index 6f55e8a6d2..b576d37c27 100644 --- a/sdks/full/go/servers/types.go +++ b/sdks/full/go/servers/types.go @@ -369,7 +369,7 @@ func (r *Resources) String() string { } type Runtime struct { - Image uuid.UUID `json:"image"` + Build uuid.UUID `json:"build"` Arguments []string `json:"arguments,omitempty"` Environment map[string]string `json:"environment,omitempty"` @@ -501,7 +501,7 @@ func (c *CreateServerPortRequest) String() string { } type CreateServerRuntimeRequest struct { - Image uuid.UUID `json:"image"` + Build uuid.UUID `json:"build"` Arguments []string `json:"arguments,omitempty"` Environment map[string]string `json:"environment,omitempty"` diff --git a/sdks/full/openapi/openapi.yml b/sdks/full/openapi/openapi.yml index 964e33877f..b58a84bfca 100644 --- a/sdks/full/openapi/openapi.yml +++ b/sdks/full/openapi/openapi.yml @@ -10802,7 +10802,7 @@ components: ServersCreateServerRuntimeRequest: type: object properties: - image: + build: type: string format: uuid arguments: @@ -10814,7 +10814,7 @@ components: additionalProperties: type: string required: - - image + - build ServersCreateServerNetworkRequest: type: object properties: @@ -14381,7 +14381,7 @@ components: ServersRuntime: type: object properties: - image: + build: type: string format: uuid arguments: @@ -14393,7 +14393,7 @@ components: additionalProperties: type: string required: - - image + - build ServersLifecycle: type: object properties: diff --git a/sdks/full/openapi_compat/openapi.yml b/sdks/full/openapi_compat/openapi.yml index 099e3e4dc0..cd3ef7375f 100644 --- a/sdks/full/openapi_compat/openapi.yml +++ b/sdks/full/openapi_compat/openapi.yml @@ -4528,15 +4528,15 @@ components: items: type: string type: array + build: + format: uuid + type: string environment: additionalProperties: type: string type: object - image: - format: uuid - type: string required: - - image + - build type: object ServersDestroyServerResponse: properties: {} @@ -4698,15 +4698,15 @@ components: items: type: string type: array + build: + format: uuid + type: string environment: additionalProperties: type: string type: object - image: - format: uuid - type: string required: - - image + - build type: object ServersServer: properties: diff --git a/sdks/full/rust-cli/docs/ServersCreateServerRuntimeRequest.md b/sdks/full/rust-cli/docs/ServersCreateServerRuntimeRequest.md index 6221032ad2..c23873def3 100644 --- a/sdks/full/rust-cli/docs/ServersCreateServerRuntimeRequest.md +++ b/sdks/full/rust-cli/docs/ServersCreateServerRuntimeRequest.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **arguments** | Option<**Vec**> | | [optional] +**build** | [**uuid::Uuid**](uuid::Uuid.md) | | **environment** | Option<**::std::collections::HashMap**> | | [optional] -**image** | [**uuid::Uuid**](uuid::Uuid.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/full/rust-cli/docs/ServersRuntime.md b/sdks/full/rust-cli/docs/ServersRuntime.md index b516ad72fd..78fbaa28dc 100644 --- a/sdks/full/rust-cli/docs/ServersRuntime.md +++ b/sdks/full/rust-cli/docs/ServersRuntime.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **arguments** | Option<**Vec**> | | [optional] +**build** | [**uuid::Uuid**](uuid::Uuid.md) | | **environment** | Option<**::std::collections::HashMap**> | | [optional] -**image** | [**uuid::Uuid**](uuid::Uuid.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/full/rust-cli/src/models/servers_create_server_runtime_request.rs b/sdks/full/rust-cli/src/models/servers_create_server_runtime_request.rs index 9d96922589..11f4647cf9 100644 --- a/sdks/full/rust-cli/src/models/servers_create_server_runtime_request.rs +++ b/sdks/full/rust-cli/src/models/servers_create_server_runtime_request.rs @@ -15,18 +15,18 @@ pub struct ServersCreateServerRuntimeRequest { #[serde(rename = "arguments", skip_serializing_if = "Option::is_none")] pub arguments: Option>, + #[serde(rename = "build")] + pub build: uuid::Uuid, #[serde(rename = "environment", skip_serializing_if = "Option::is_none")] pub environment: Option<::std::collections::HashMap>, - #[serde(rename = "image")] - pub image: uuid::Uuid, } impl ServersCreateServerRuntimeRequest { - pub fn new(image: uuid::Uuid) -> ServersCreateServerRuntimeRequest { + pub fn new(build: uuid::Uuid) -> ServersCreateServerRuntimeRequest { ServersCreateServerRuntimeRequest { arguments: None, + build, environment: None, - image, } } } diff --git a/sdks/full/rust-cli/src/models/servers_runtime.rs b/sdks/full/rust-cli/src/models/servers_runtime.rs index 09f44aca56..489b53a7a9 100644 --- a/sdks/full/rust-cli/src/models/servers_runtime.rs +++ b/sdks/full/rust-cli/src/models/servers_runtime.rs @@ -15,18 +15,18 @@ pub struct ServersRuntime { #[serde(rename = "arguments", skip_serializing_if = "Option::is_none")] pub arguments: Option>, + #[serde(rename = "build")] + pub build: uuid::Uuid, #[serde(rename = "environment", skip_serializing_if = "Option::is_none")] pub environment: Option<::std::collections::HashMap>, - #[serde(rename = "image")] - pub image: uuid::Uuid, } impl ServersRuntime { - pub fn new(image: uuid::Uuid) -> ServersRuntime { + pub fn new(build: uuid::Uuid) -> ServersRuntime { ServersRuntime { arguments: None, + build, environment: None, - image, } } } diff --git a/sdks/full/rust/docs/ServersCreateServerRuntimeRequest.md b/sdks/full/rust/docs/ServersCreateServerRuntimeRequest.md index 6221032ad2..c23873def3 100644 --- a/sdks/full/rust/docs/ServersCreateServerRuntimeRequest.md +++ b/sdks/full/rust/docs/ServersCreateServerRuntimeRequest.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **arguments** | Option<**Vec**> | | [optional] +**build** | [**uuid::Uuid**](uuid::Uuid.md) | | **environment** | Option<**::std::collections::HashMap**> | | [optional] -**image** | [**uuid::Uuid**](uuid::Uuid.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/full/rust/docs/ServersRuntime.md b/sdks/full/rust/docs/ServersRuntime.md index b516ad72fd..78fbaa28dc 100644 --- a/sdks/full/rust/docs/ServersRuntime.md +++ b/sdks/full/rust/docs/ServersRuntime.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **arguments** | Option<**Vec**> | | [optional] +**build** | [**uuid::Uuid**](uuid::Uuid.md) | | **environment** | Option<**::std::collections::HashMap**> | | [optional] -**image** | [**uuid::Uuid**](uuid::Uuid.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdks/full/rust/src/models/servers_create_server_runtime_request.rs b/sdks/full/rust/src/models/servers_create_server_runtime_request.rs index 9d96922589..11f4647cf9 100644 --- a/sdks/full/rust/src/models/servers_create_server_runtime_request.rs +++ b/sdks/full/rust/src/models/servers_create_server_runtime_request.rs @@ -15,18 +15,18 @@ pub struct ServersCreateServerRuntimeRequest { #[serde(rename = "arguments", skip_serializing_if = "Option::is_none")] pub arguments: Option>, + #[serde(rename = "build")] + pub build: uuid::Uuid, #[serde(rename = "environment", skip_serializing_if = "Option::is_none")] pub environment: Option<::std::collections::HashMap>, - #[serde(rename = "image")] - pub image: uuid::Uuid, } impl ServersCreateServerRuntimeRequest { - pub fn new(image: uuid::Uuid) -> ServersCreateServerRuntimeRequest { + pub fn new(build: uuid::Uuid) -> ServersCreateServerRuntimeRequest { ServersCreateServerRuntimeRequest { arguments: None, + build, environment: None, - image, } } } diff --git a/sdks/full/rust/src/models/servers_runtime.rs b/sdks/full/rust/src/models/servers_runtime.rs index 09f44aca56..489b53a7a9 100644 --- a/sdks/full/rust/src/models/servers_runtime.rs +++ b/sdks/full/rust/src/models/servers_runtime.rs @@ -15,18 +15,18 @@ pub struct ServersRuntime { #[serde(rename = "arguments", skip_serializing_if = "Option::is_none")] pub arguments: Option>, + #[serde(rename = "build")] + pub build: uuid::Uuid, #[serde(rename = "environment", skip_serializing_if = "Option::is_none")] pub environment: Option<::std::collections::HashMap>, - #[serde(rename = "image")] - pub image: uuid::Uuid, } impl ServersRuntime { - pub fn new(image: uuid::Uuid) -> ServersRuntime { + pub fn new(build: uuid::Uuid) -> ServersRuntime { ServersRuntime { arguments: None, + build, environment: None, - image, } } } diff --git a/sdks/full/typescript/archive.tgz b/sdks/full/typescript/archive.tgz index 43c45d8b08..0ea0f31dca 100644 --- a/sdks/full/typescript/archive.tgz +++ b/sdks/full/typescript/archive.tgz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9518374f3b5d31f86880a9f9f876185529bbc35244a6202d376440e73a2c545e -size 548036 +oid sha256:54b8e42fe1d533223759cf98f6c00e348e00a60f26b621e4fcb6722b7277cd2a +size 547997 diff --git a/sdks/runtime/typescript/archive.tgz b/sdks/runtime/typescript/archive.tgz index eecbc22329..4570fe5af7 100644 --- a/sdks/runtime/typescript/archive.tgz +++ b/sdks/runtime/typescript/archive.tgz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:29ca47b023e50719b7e442254a584eca680071a7a9f35794014906db863c5029 -size 282581 +oid sha256:66163bdbde5b21a1aa86ce74b4cbffe69502e29d21cec4771ccba0109b83a00d +size 282561 diff --git a/svc/api/servers/src/route/servers.rs b/svc/api/servers/src/route/servers.rs index e0d49353d4..49c1e0fb5f 100644 --- a/svc/api/servers/src/route/servers.rs +++ b/svc/api/servers/src/route/servers.rs @@ -79,7 +79,7 @@ pub async fn create( tags: tags, resources: Some((*body.resources).api_into()), kill_timeout_ms: body.lifecycle.as_ref().and_then(|x| x.kill_timeout).unwrap_or_default(), - image_id: Some(body.runtime.image.into()), + image_id: Some(body.runtime.build.into()), args: body.runtime.arguments.unwrap_or_default(), network_mode: backend::ds::NetworkMode::api_from( body.network.mode.unwrap_or_default(), diff --git a/svc/api/servers/tests/basic.rs b/svc/api/servers/tests/basic.rs index 31ab417834..021c2795b5 100644 --- a/svc/api/servers/tests/basic.rs +++ b/svc/api/servers/tests/basic.rs @@ -175,7 +175,7 @@ async fn create_http() -> GlobalResult<()> { datacenter: ctx.datacenter_id, tags: None, runtime: Box::new(models::ServersCreateServerRuntimeRequest { - image: ctx.image_id, + build: ctx.image_id, environment: Some(HashMap::new()), arguments: None, }), @@ -224,7 +224,7 @@ async fn list_builds_with_tags() -> GlobalResult<()> { datacenter: ctx.datacenter_id, tags: None, runtime: Box::new(models::ServersCreateServerRuntimeRequest { - image: ctx.image_id, + build: ctx.image_id, arguments: None, environment: Some(HashMap::new()), }), diff --git a/svc/pkg/build/ops/create/src/lib.rs b/svc/pkg/build/ops/create/src/lib.rs index a50b14c43b..e1eb4a3b89 100644 --- a/svc/pkg/build/ops/create/src/lib.rs +++ b/svc/pkg/build/ops/create/src/lib.rs @@ -122,7 +122,7 @@ async fn handle( compression ) VALUES - ($1, $2, $3, $4, $5, $6, $7, $8) + ($1, $2, $3, $4, $5, $6, $7, $8, $9) ", build_id, game_id, diff --git a/svc/pkg/ds/ops/server-create/src/lib.rs b/svc/pkg/ds/ops/server-create/src/lib.rs index 2cc441cd7e..ca869961d2 100644 --- a/svc/pkg/ds/ops/server-create/src/lib.rs +++ b/svc/pkg/ds/ops/server-create/src/lib.rs @@ -199,7 +199,7 @@ pub async fn handle( environment ) VALUES - ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) + ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13) RETURNING 1 ), @@ -214,7 +214,7 @@ pub async fn handle( $1, t.* FROM - unnest($15, $16) AS t (port_name, port_number) + unnest($14, $15) AS t (port_name, port_number) RETURNING 1 ), @@ -231,7 +231,7 @@ pub async fn handle( $1, t.* FROM - unnest($17, $18, $19, $20) AS t (port_name, port_number, protocol) + unnest($16, $17, $18, $19) AS t (port_name, port_number, protocol) RETURNING 1 ) @@ -246,17 +246,17 @@ pub async fn handle( resources.cpu_millicores, resources.memory_mib, ctx.kill_timeout_ms, - create_ts, // 10 - unwrap!(ctx.image_id).as_uuid(), + create_ts, + unwrap!(ctx.image_id).as_uuid(), // 10 &ctx.args, ctx.network_mode, serde_json::value::to_raw_value(&ctx.environment)?.to_string(), - host_unnest.port_names, // 15 - host_unnest.port_numbers, + host_unnest.port_names, + host_unnest.port_numbers, // 15 game_guard_unnest.port_names, game_guard_unnest.port_numbers, game_guard_unnest.gg_ports, - game_guard_unnest.protocols, // 20 + game_guard_unnest.protocols, ) .await } diff --git a/svc/pkg/ds/ops/server-create/tests/integration.rs b/svc/pkg/ds/ops/server-create/tests/integration.rs index a32fba5772..b2f6c631b7 100644 --- a/svc/pkg/ds/ops/server-create/tests/integration.rs +++ b/svc/pkg/ds/ops/server-create/tests/integration.rs @@ -29,7 +29,7 @@ async fn create(ctx: TestCtx) { token::create::request::KindNew { entitlements: vec![proto::claims::Entitlement { kind: Some(proto::claims::entitlement::Kind::EnvService( proto::claims::entitlement::EnvService { - env_id: game_res.env_id.clone(), + env_id: Some(env_id.clone()) } )), }]}, diff --git a/svc/pkg/ds/ops/server-create/tests/print_test_data.rs b/svc/pkg/ds/ops/server-create/tests/print_test_data.rs index 15082e4bdc..6aeaba18aa 100644 --- a/svc/pkg/ds/ops/server-create/tests/print_test_data.rs +++ b/svc/pkg/ds/ops/server-create/tests/print_test_data.rs @@ -62,7 +62,7 @@ async fn print_test_data(ctx: TestCtx) { token::create::request::KindNew { entitlements: vec![proto::claims::Entitlement { kind: Some(proto::claims::entitlement::Kind::EnvService( proto::claims::entitlement::EnvService { - env_id: game_res.env_id.clone(), + env_id: Some(env_id.clone()), } )), }]}, @@ -83,7 +83,7 @@ async fn print_test_data(ctx: TestCtx) { token::create::request::KindNew { entitlements: vec![proto::claims::Entitlement { kind: Some(proto::claims::entitlement::Kind::GameCloud( proto::claims::entitlement::GameCloud { - env_id: game_res.env_id.clone(), + game_id: game_res.game_id.clone(), } )), },proto::claims::Entitlement { diff --git a/svc/pkg/ds/worker/tests/ds_nomad_monitor_alloc_plan.rs b/svc/pkg/ds/worker/tests/ds_nomad_monitor_alloc_plan.rs deleted file mode 100644 index 1b03565b6c..0000000000 --- a/svc/pkg/ds/worker/tests/ds_nomad_monitor_alloc_plan.rs +++ /dev/null @@ -1,13 +0,0 @@ -use chirp_worker::prelude::*; -use proto::backend::pkg::*; - -#[worker_test] -async fn ds_nomad_monitor_alloc_plan(ctx: TestCtx) { - // msg!([ctx] ds::msg::ds_nomad_monitor_alloc_plan() { - - // }) - // .await - // .unwrap(); - - todo!(); -}