diff --git a/api/golang/http_rest/api_types/api_types.gen.go b/api/golang/http_rest/api_types/api_types.gen.go index 4c09c02e09..3d92ea53b1 100644 --- a/api/golang/http_rest/api_types/api_types.gen.go +++ b/api/golang/http_rest/api_types/api_types.gen.go @@ -111,6 +111,14 @@ const ( // ApiContainerStatus defines model for ApiContainerStatus. type ApiContainerStatus string +// AsyncStarlarkExecutionLogs Use it to asynchronously retrieve the execution logs via Websockets or http streaming +type AsyncStarlarkExecutionLogs struct { + // AsyncStarlarkExecutionLogs Execution UUID to asynchronously retrieve the execution logs + AsyncStarlarkExecutionLogs struct { + StarlarkExecutionUuid string `json:"starlark_execution_uuid"` + } `json:"async_starlark_execution_logs"` +} + // Connect 0 - CONNECT // Best effort port forwarding // 1 - NO_CONNECT // Port forwarding disabled type Connect string @@ -487,11 +495,14 @@ type StarlarkInterpretationError struct { // StarlarkRunFinishedEvent defines model for StarlarkRunFinishedEvent. type StarlarkRunFinishedEvent struct { RunFinishedEvent struct { - IsRunSuccessful bool `json:"is_run_successful"` - SerializedOutput string `json:"serialized_output"` + IsRunSuccessful bool `json:"is_run_successful"` + SerializedOutput *string `json:"serialized_output,omitempty"` } `json:"run_finished_event"` } +// StarlarkRunLogs Starlark Execution Logs +type StarlarkRunLogs = []StarlarkRunResponseLine + // StarlarkRunProgress defines model for StarlarkRunProgress. type StarlarkRunProgress struct { ProgressInfo struct { @@ -501,6 +512,11 @@ type StarlarkRunProgress struct { } `json:"progress_info"` } +// StarlarkRunResponse defines model for StarlarkRunResponse. +type StarlarkRunResponse struct { + union json.RawMessage +} + // StarlarkRunResponseLine Starlark Execution Response type StarlarkRunResponseLine struct { union json.RawMessage @@ -591,6 +607,9 @@ type Retries = int32 // RetriesDelayMilliseconds defines model for retries_delay_milliseconds. type RetriesDelayMilliseconds = int32 +// RetrieveLogsAsync defines model for retrieve_logs_async. +type RetrieveLogsAsync = bool + // ReturnAllLogs defines model for return_all_logs. type ReturnAllLogs = bool @@ -600,6 +619,9 @@ type ServiceIdentifier = string // ServiceUuidSet defines model for service_uuid_set. type ServiceUuidSet = []string +// StarlarkExecutionUuid defines model for starlark_execution_uuid. +type StarlarkExecutionUuid = string + // AsStarlarkInterpretationError returns the union data inside the StarlarkError_Error as a StarlarkInterpretationError func (t StarlarkError_Error) AsStarlarkInterpretationError() (StarlarkInterpretationError, error) { var body StarlarkInterpretationError @@ -688,6 +710,68 @@ func (t *StarlarkError_Error) UnmarshalJSON(b []byte) error { return err } +// AsAsyncStarlarkExecutionLogs returns the union data inside the StarlarkRunResponse as a AsyncStarlarkExecutionLogs +func (t StarlarkRunResponse) AsAsyncStarlarkExecutionLogs() (AsyncStarlarkExecutionLogs, error) { + var body AsyncStarlarkExecutionLogs + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAsyncStarlarkExecutionLogs overwrites any union data inside the StarlarkRunResponse as the provided AsyncStarlarkExecutionLogs +func (t *StarlarkRunResponse) FromAsyncStarlarkExecutionLogs(v AsyncStarlarkExecutionLogs) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAsyncStarlarkExecutionLogs performs a merge with any union data inside the StarlarkRunResponse, using the provided AsyncStarlarkExecutionLogs +func (t *StarlarkRunResponse) MergeAsyncStarlarkExecutionLogs(v AsyncStarlarkExecutionLogs) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JsonMerge(b, t.union) + t.union = merged + return err +} + +// AsStarlarkRunLogs returns the union data inside the StarlarkRunResponse as a StarlarkRunLogs +func (t StarlarkRunResponse) AsStarlarkRunLogs() (StarlarkRunLogs, error) { + var body StarlarkRunLogs + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromStarlarkRunLogs overwrites any union data inside the StarlarkRunResponse as the provided StarlarkRunLogs +func (t *StarlarkRunResponse) FromStarlarkRunLogs(v StarlarkRunLogs) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeStarlarkRunLogs performs a merge with any union data inside the StarlarkRunResponse, using the provided StarlarkRunLogs +func (t *StarlarkRunResponse) MergeStarlarkRunLogs(v StarlarkRunLogs) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JsonMerge(b, t.union) + t.union = merged + return err +} + +func (t StarlarkRunResponse) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *StarlarkRunResponse) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + // AsStarlarkInstruction returns the union data inside the StarlarkRunResponseLine as a StarlarkInstruction func (t StarlarkRunResponseLine) AsStarlarkInstruction() (StarlarkInstruction, error) { var body StarlarkInstruction @@ -883,69 +967,73 @@ func (t *StarlarkRunResponseLine) UnmarshalJSON(b []byte) error { // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+w8XW/jNrZ/hdC9wLQLTWb2AxcXeUsTZ8bYiW3YzqaLZqClpWObHYrUkpQz7iL//YIU", - "KVMSJctzd9uXvrSNeHh4vnh4vtx/RSnPC86AKRld/ysqsMA5KBDmLywU2eJUJSQDpsiWgNCfM5CpIIUi", - "nEXX0XoPyAEihnNAXKCyJFkUR0QDFFjtozjSS9F1EGccCfhnSQRk0bUSJcSRTPeQY32YOhZ6m1SCsF30", - "+hpHKWc/lyxV5ADJllBHrDnrnyWI4+mwEKiPnCjIzeb/FrCNrqP/encSx7sKTL77xHefCIN7sz96jR1J", - "WAh8NBQBSyk+wKCYHh+ndzGSey4UMMhQ9TcXVmRbpPaALKKw5AKnXCY4+FpAqiBLBMiCMwldKqeOjqzg", - "hCkkQJWCSaT2RKIDpiXEBkCCOJAU0AuhFG0A5Vh8gQxhifABE4o3FNB3cLW7Qh+BUo6euKDZ91eOsZaa", - "uoQNM7LllPKXhPJdr+Z9kACyDecUMDPY9koVSQ5qz7OwdX9crxeoAkClhAwpjtI9pF8cs4QSdbxCd7DF", - "JVWISPRhsu5j1j/Op2zIBD8qVTyYLTfeiYZ6wogimCYZUHxMckIpkZBylskwM6zMNyC0wfm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ha3vL1vpzeXjnke", + "6gG/z8HQWX/IJBweHR5fzrwYz/7phLMCuKXDfHMBpmHR9SveCZ7bzE5/o/NwWajdRRjM+/FSpNVdvecX", + "bTaS01IBqkZWv8fgZXWrp9VCdUsDL4htaTifGvQYGOhKNPA8wqaFUMi1cAHoETao3fs5sp5yOX6lCDQB", + "PCw/I8WRKwVWP0jgulBHoaLJDqCx9rsG69Mqwwre2hb8DqPd/q5gnnB9s7A5wtXNeuEShLcLLzm4vtF/", + "6ddRHOlXX+LQ18fu/FZEUf3uejFF62NhMjt1s3v0/uqPV+81f7wAhgsSfYj+fPX+6n1U/SaI3qvX1/8L", + "AAD//6YRv9ydSQAA", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/http_rest/core_rest_api/api_container_server.gen.go b/api/golang/http_rest/core_rest_api/api_container_server.gen.go index 3ef2171331..897a8f3dae 100644 --- a/api/golang/http_rest/core_rest_api/api_container_server.gen.go +++ b/api/golang/http_rest/core_rest_api/api_container_server.gen.go @@ -63,6 +63,18 @@ type GetEnclavesEnclaveIdentifierServicesServiceIdentifierEndpointsPortNumberAva // PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartBody defines parameters for PostEnclavesEnclaveIdentifierStarlarkPackages. type PostEnclavesEnclaveIdentifierStarlarkPackagesMultipartBody = openapi_types.File +// PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdParams defines parameters for PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId. +type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdParams struct { + // RetrieveLogsAsync If false, block http response until all logs are available. Default is true + RetrieveLogsAsync *externalRef0.RetrieveLogsAsync `form:"retrieve_logs_async,omitempty" json:"retrieve_logs_async,omitempty"` +} + +// PostEnclavesEnclaveIdentifierStarlarkScriptsParams defines parameters for PostEnclavesEnclaveIdentifierStarlarkScripts. +type PostEnclavesEnclaveIdentifierStarlarkScriptsParams struct { + // RetrieveLogsAsync If false, block http response until all logs are available. Default is true + RetrieveLogsAsync *externalRef0.RetrieveLogsAsync `form:"retrieve_logs_async,omitempty" json:"retrieve_logs_async,omitempty"` +} + // PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartRequestBody defines body for PostEnclavesEnclaveIdentifierArtifactsLocalFile for multipart/form-data ContentType. type PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartRequestBody = PostEnclavesEnclaveIdentifierArtifactsLocalFileMultipartBody @@ -133,10 +145,10 @@ type ServerInterface interface { PostEnclavesEnclaveIdentifierStarlarkPackages(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error // (POST /enclaves/{enclave_identifier}/starlark/packages/{package_id}) - PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, packageId externalRef0.PackageId) error + PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, packageId externalRef0.PackageId, params PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdParams) error // (POST /enclaves/{enclave_identifier}/starlark/scripts) - PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error + PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, params PostEnclavesEnclaveIdentifierStarlarkScriptsParams) error } // ServerInterfaceWrapper converts echo contexts to parameters. @@ -503,8 +515,17 @@ func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierStarlarkPackagesPa return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter package_id: %s", err)) } + // Parameter object where we will unmarshal all parameters from the context + var params PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdParams + // ------------- Optional query parameter "retrieve_logs_async" ------------- + + err = runtime.BindQueryParameter("form", true, false, "retrieve_logs_async", ctx.QueryParams(), ¶ms.RetrieveLogsAsync) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter retrieve_logs_async: %s", err)) + } + // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx, enclaveIdentifier, packageId) + err = w.Handler.PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx, enclaveIdentifier, packageId, params) return err } @@ -519,8 +540,17 @@ func (w *ServerInterfaceWrapper) PostEnclavesEnclaveIdentifierStarlarkScripts(ct return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter enclave_identifier: %s", err)) } + // Parameter object where we will unmarshal all parameters from the context + var params PostEnclavesEnclaveIdentifierStarlarkScriptsParams + // ------------- Optional query parameter "retrieve_logs_async" ------------- + + err = runtime.BindQueryParameter("form", true, false, "retrieve_logs_async", ctx.QueryParams(), ¶ms.RetrieveLogsAsync) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter retrieve_logs_async: %s", err)) + } + // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PostEnclavesEnclaveIdentifierStarlarkScripts(ctx, enclaveIdentifier) + err = w.Handler.PostEnclavesEnclaveIdentifierStarlarkScripts(ctx, enclaveIdentifier, params) return err } @@ -992,6 +1022,7 @@ func (response PostEnclavesEnclaveIdentifierStarlarkPackagesdefaultJSONResponse) type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdRequestObject struct { EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` PackageId externalRef0.PackageId `json:"package_id"` + Params PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdParams Body *PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdJSONRequestBody } @@ -999,7 +1030,7 @@ type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponseObject interf VisitPostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponse(w http.ResponseWriter) error } -type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200JSONResponse []externalRef0.StarlarkRunResponseLine +type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200JSONResponse externalRef0.StarlarkRunResponse func (response PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200JSONResponse) VisitPostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -1008,25 +1039,6 @@ func (response PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200JSONResp return json.NewEncoder(w).Encode(response) } -type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200ApplicationoctetStreamResponse struct { - Body io.Reader - ContentLength int64 -} - -func (response PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200ApplicationoctetStreamResponse) VisitPostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/octet-stream") - if response.ContentLength != 0 { - w.Header().Set("Content-Length", fmt.Sprint(response.ContentLength)) - } - w.WriteHeader(200) - - if closer, ok := response.Body.(io.ReadCloser); ok { - defer closer.Close() - } - _, err := io.Copy(w, response.Body) - return err -} - type PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIddefaultJSONResponse struct { Body externalRef0.ResponseInfo StatusCode int @@ -1041,6 +1053,7 @@ func (response PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIddefaultJSON type PostEnclavesEnclaveIdentifierStarlarkScriptsRequestObject struct { EnclaveIdentifier externalRef0.EnclaveIdentifier `json:"enclave_identifier"` + Params PostEnclavesEnclaveIdentifierStarlarkScriptsParams Body *PostEnclavesEnclaveIdentifierStarlarkScriptsJSONRequestBody } @@ -1048,7 +1061,7 @@ type PostEnclavesEnclaveIdentifierStarlarkScriptsResponseObject interface { VisitPostEnclavesEnclaveIdentifierStarlarkScriptsResponse(w http.ResponseWriter) error } -type PostEnclavesEnclaveIdentifierStarlarkScripts200JSONResponse []externalRef0.StarlarkRunResponseLine +type PostEnclavesEnclaveIdentifierStarlarkScripts200JSONResponse externalRef0.StarlarkRunResponse func (response PostEnclavesEnclaveIdentifierStarlarkScripts200JSONResponse) VisitPostEnclavesEnclaveIdentifierStarlarkScriptsResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") @@ -1057,25 +1070,6 @@ func (response PostEnclavesEnclaveIdentifierStarlarkScripts200JSONResponse) Visi return json.NewEncoder(w).Encode(response) } -type PostEnclavesEnclaveIdentifierStarlarkScripts200ApplicationoctetStreamResponse struct { - Body io.Reader - ContentLength int64 -} - -func (response PostEnclavesEnclaveIdentifierStarlarkScripts200ApplicationoctetStreamResponse) VisitPostEnclavesEnclaveIdentifierStarlarkScriptsResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/octet-stream") - if response.ContentLength != 0 { - w.Header().Set("Content-Length", fmt.Sprint(response.ContentLength)) - } - w.WriteHeader(200) - - if closer, ok := response.Body.(io.ReadCloser); ok { - defer closer.Close() - } - _, err := io.Copy(w, response.Body) - return err -} - type PostEnclavesEnclaveIdentifierStarlarkScriptsdefaultJSONResponse struct { Body externalRef0.ResponseInfo StatusCode int @@ -1549,11 +1543,12 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkPackages(ctx echo. } // PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId operation middleware -func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, packageId externalRef0.PackageId) error { +func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, packageId externalRef0.PackageId, params PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdParams) error { var request PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdRequestObject request.EnclaveIdentifier = enclaveIdentifier request.PackageId = packageId + request.Params = params var body PostEnclavesEnclaveIdentifierStarlarkPackagesPackageIdJSONRequestBody if err := ctx.Bind(&body); err != nil { @@ -1581,10 +1576,11 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId( } // PostEnclavesEnclaveIdentifierStarlarkScripts operation middleware -func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier) error { +func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, params PostEnclavesEnclaveIdentifierStarlarkScriptsParams) error { var request PostEnclavesEnclaveIdentifierStarlarkScriptsRequestObject request.EnclaveIdentifier = enclaveIdentifier + request.Params = params var body PostEnclavesEnclaveIdentifierStarlarkScriptsJSONRequestBody if err := ctx.Bind(&body); err != nil { @@ -1614,60 +1610,60 @@ func (sh *strictHandler) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx echo.C // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+xba2/btvr/KoT+f6Db4MbZBcNB3vWStMbpUiNJ0QMshUdLjyyuFKmRVBIv8Hc/4M2i", - "LMqW0zTJdvamaSJensvvuZK8TVJeVpwBUzI5uk0qLHAJCoT5DQtFcpyqGcmAKZITEPrPGchUkEoRzpKj", - "5KIA5AcihktAXKC6JlkySogeUGFVJKNEf0qOomuOEgF/1ERAlhwpUcMokWkBJdabqWWlp0klCFskq9Uo", - "AZZSfAVbifrwYfJ6hGTBhQIGGbK/c+EIzJEqALmF4nRGdtmTzJsKUgXZTICsOJPQpXLi6cgqTphCAlQt", - "mESqIBJdYVrDyAyQIK5ICuiaUIrmgEosPkOGsET4ChOK5xTQN3CwOEBvgVKOPnJBs28PPGN/1CCWAWcd", - "wrYzUihVzUpQBc/i2n97cTFFdgCqJWRIcZQWkH725BFK1PIAvYYc11QhItGb44s+8sLtQsL+X0CeHCX/", - "N24QO7Zf5fitUtUvZsqLYEdDPWFEEUxnGVC8nJWEUiIh5SyTcWZYXc5BaIiE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diyKP9u6K3ML5qurfmS9vmgnV/7R230TudW86k7MpkyVkans1C5gbk+xe", + "0rhDqub/8+B6GbvZ/vA5X9jgeKJZX1RXJj4SdyqNn47Inlg9yM3dUY38+X8ddeKZAvVcKgG4uPXFwcfT", + "FB8pA00YLkAfne5LSjtMAKr9lsdQR9clKNMs1gy1Y6jYrVdZoxUx7n33AT8/Qh0QjlKeVva/zaQye3nU", + "93Lj5aMEUctr5+ro7TIgr1ov62OfcOrub9YOz1IeXZ4rIhUX684IcOLeRwXmhvCcV7bRA9dEmknOeXVw", + "8MPPyEIjGaYosL7be5J3Dqu/TAsoMpx+UpnA3krozk7/yZUkX6kUaPjmJyvKSVbfmo87ZzvSAFvfLskl", + "sO2zDDf6xn7cW5e+d3PaLdUILu3/vYrW8L1CRDl2Xiw8XP3afqXwhFXXv8mVk5vgId9m0nj31xWnXpin", + "U/axVK3Z5mlb663v9v3UaHt9mOjCWPBquULY7vKsGN2HT3ztSZtxoewjtaPma8bHMoj9u8JHlQOWh2+J", + "h0DHajVkXc9T3gG7/YO/4UvveFD7ofegI4MnnV1BLGqzA83OzaU7jectKESxVPV1P1Gx22m+P+IpZGxD", + "ZvSNns2j+kSH0MTdspBDxnK71zLH6GxFJJIKSnvFywYY/5YhfPmQYdZ4eGkefkdemNwu4jc3yyc+zOuw", + "pQcS8OSmvlCzGZCoBeK23xG3V90rCeKZRHNYYbr4MoG5n9OHys2CK0WDfXLz/fLXSuUipvDAQ4fY9aWn", + "4aLs8fKRdfbUYfEwmvpIuufehfzNVW+z+W8AAAD//1aISs4OSQAA", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/golang/http_rest/websocket_api/websocket_server.gen.go b/api/golang/http_rest/websocket_api/websocket_server.gen.go index a488333d55..259b50c29d 100644 --- a/api/golang/http_rest/websocket_api/websocket_server.gen.go +++ b/api/golang/http_rest/websocket_api/websocket_server.gen.go @@ -19,6 +19,9 @@ import ( "github.com/labstack/echo/v4" ) +// NotOk defines model for NotOk. +type NotOk = externalRef0.ResponseInfo + // GetEnclavesEnclaveIdentifierLogsParams defines parameters for GetEnclavesEnclaveIdentifierLogs. type GetEnclavesEnclaveIdentifierLogsParams struct { ServiceUuidSet externalRef0.ServiceUuidSet `form:"service_uuid_set" json:"service_uuid_set"` @@ -44,6 +47,9 @@ type ServerInterface interface { // Get Service Logs // (GET /enclaves/{enclave_identifier}/services/{service_identifier}/logs) GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogs(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, serviceIdentifier externalRef0.ServiceIdentifier, params GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogsParams) error + + // (GET /enclaves/{enclave_identifier}/starlark/executions/{starlark_execution_uuid}/logs) + GetEnclavesEnclaveIdentifierStarlarkExecutionsStarlarkExecutionUuidLogs(ctx echo.Context, enclaveIdentifier externalRef0.EnclaveIdentifier, starlarkExecutionUuid externalRef0.StarlarkExecutionUuid) error } // ServerInterfaceWrapper converts echo contexts to parameters. @@ -158,6 +164,30 @@ func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierServicesServiceIden return err } +// GetEnclavesEnclaveIdentifierStarlarkExecutionsStarlarkExecutionUuidLogs converts echo context to params. +func (w *ServerInterfaceWrapper) GetEnclavesEnclaveIdentifierStarlarkExecutionsStarlarkExecutionUuidLogs(ctx echo.Context) error { + var err error + // ------------- Path parameter "enclave_identifier" ------------- + var enclaveIdentifier externalRef0.EnclaveIdentifier + + err = runtime.BindStyledParameterWithLocation("simple", false, "enclave_identifier", runtime.ParamLocationPath, ctx.Param("enclave_identifier"), &enclaveIdentifier) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter enclave_identifier: %s", err)) + } + + // ------------- Path parameter "starlark_execution_uuid" ------------- + var starlarkExecutionUuid externalRef0.StarlarkExecutionUuid + + err = runtime.BindStyledParameterWithLocation("simple", false, "starlark_execution_uuid", runtime.ParamLocationPath, ctx.Param("starlark_execution_uuid"), &starlarkExecutionUuid) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter starlark_execution_uuid: %s", err)) + } + + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.GetEnclavesEnclaveIdentifierStarlarkExecutionsStarlarkExecutionUuidLogs(ctx, enclaveIdentifier, starlarkExecutionUuid) + return err +} + // This is a simple interface which specifies echo.Route addition functions which // are present on both echo.Echo and echo.Group, since we want to allow using // either of them for path registration @@ -188,23 +218,29 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL router.GET(baseURL+"/enclaves/:enclave_identifier/logs", wrapper.GetEnclavesEnclaveIdentifierLogs) router.GET(baseURL+"/enclaves/:enclave_identifier/services/:service_identifier/logs", wrapper.GetEnclavesEnclaveIdentifierServicesServiceIdentifierLogs) + router.GET(baseURL+"/enclaves/:enclave_identifier/starlark/executions/:starlark_execution_uuid/logs", wrapper.GetEnclavesEnclaveIdentifierStarlarkExecutionsStarlarkExecutionUuidLogs) } // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "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", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/api/openapi/specs/api_types.yaml b/api/openapi/specs/api_types.yaml index 0ed532b06a..91c21a4c65 100644 --- a/api/openapi/specs/api_types.yaml +++ b/api/openapi/specs/api_types.yaml @@ -41,6 +41,14 @@ components: description: The service identifier of the container that the command should be executed in required: true + starlark_execution_uuid: + name: starlark_execution_uuid + in: path + schema: + type: string + description: The unique identifier to track the execution of a Starlark script or package + required: true + service_uuid_set: name: service_uuid_set in: query @@ -49,6 +57,14 @@ components: type: array items: type: string + + retrieve_logs_async: + name: retrieve_logs_async + in: query + required: false + description: If false, block http response until all logs are available. Default is true + schema: + type: boolean remove_all: name: remove_all @@ -537,6 +553,13 @@ components: description: |- 0 - NO_INSTRUCTIONS_CACHING + StarlarkRunLogs: + type: array + items: + $ref: "#/components/schemas/StarlarkRunResponseLine" + description: |- + Starlark Execution Logs + StarlarkRunResponseLine: oneOf: - $ref: "#/components/schemas/StarlarkInstruction" @@ -729,10 +752,29 @@ components: type: string required: - is_run_successful - - serialized_output required: - run_finished_event + AsyncStarlarkExecutionLogs: + type: object + properties: + async_starlark_execution_logs: + type: object + properties: + starlark_execution_uuid: + type: string + description: Execution UUID to asynchronously retrieve the execution logs + required: + - starlark_execution_uuid + description: Use it to asynchronously retrieve the execution logs via Websockets or http streaming + required: + - async_starlark_execution_logs + + StarlarkRunResponse: + oneOf: + - $ref: "#/components/schemas/AsyncStarlarkExecutionLogs" + - $ref: "#/components/schemas/StarlarkRunLogs" + ServiceIdentifiers: type: object properties: diff --git a/api/openapi/specs/core_service.yaml b/api/openapi/specs/core_service.yaml index d4b04095aa..bdfdad7a97 100644 --- a/api/openapi/specs/core_service.yaml +++ b/api/openapi/specs/core_service.yaml @@ -41,6 +41,7 @@ paths: parameters: - $ref: './api_types.yaml#/components/parameters/enclave_identifier' - $ref: './api_types.yaml#/components/parameters/package_id' + - $ref: './api_types.yaml#/components/parameters/retrieve_logs_async' requestBody: content: application/json: @@ -53,21 +54,16 @@ paths: "200": description: Successful request content: - application/octet-stream: - schema: - type: string - format: binary application/json: schema: - type: array - items: - $ref: "./api_types.yaml#/components/schemas/StarlarkRunResponseLine" + $ref: "./api_types.yaml#/components/schemas/StarlarkRunResponse" /enclaves/{enclave_identifier}/starlark/scripts: post: description: Executes a Starlark script on the user's behalf parameters: - $ref: './api_types.yaml#/components/parameters/enclave_identifier' + - $ref: './api_types.yaml#/components/parameters/retrieve_logs_async' requestBody: content: application/json: @@ -80,15 +76,9 @@ paths: "200": description: Successful request content: - application/octet-stream: - schema: - type: string - format: binary application/json: schema: - type: array - items: - $ref: "./api_types.yaml#/components/schemas/StarlarkRunResponseLine" + $ref: "./api_types.yaml#/components/schemas/StarlarkRunResponse" /enclaves/{enclave_identifier}/services/{service_identifier}: get: diff --git a/api/openapi/specs/websocket_service.yaml b/api/openapi/specs/websocket_service.yaml index 0eef058677..2bc0ed6200 100644 --- a/api/openapi/specs/websocket_service.yaml +++ b/api/openapi/specs/websocket_service.yaml @@ -40,3 +40,33 @@ paths: application/json: schema: $ref: "./api_types.yaml#/components/schemas/ServiceLogs" + + /enclaves/{enclave_identifier}/starlark/executions/{starlark_execution_uuid}/logs: + get: + description: Executes a Starlark script on the user's behalf + parameters: + - $ref: './api_types.yaml#/components/parameters/enclave_identifier' + - $ref: './api_types.yaml#/components/parameters/starlark_execution_uuid' + responses: + default: + $ref: '#/components/responses/NotOk' + "200": + description: Successful request + content: + application/json: + schema: + type: array + items: + $ref: "./api_types.yaml#/components/schemas/StarlarkRunResponseLine" + +components: + + responses: + + NotOk: + description: Unexpected error + content: + application/json: + schema: + $ref: './api_types.yaml#/components/schemas/ResponseInfo' + required: true \ No newline at end of file diff --git a/engine/server/engine/server/enclave_rest_api_handler.go b/engine/server/engine/server/enclave_rest_api_handler.go index fecacbd173..00380943c4 100644 --- a/engine/server/engine/server/enclave_rest_api_handler.go +++ b/engine/server/engine/server/enclave_rest_api_handler.go @@ -2,8 +2,6 @@ package server import ( "context" - "crypto/sha1" - "encoding/hex" "encoding/json" "fmt" "io" @@ -582,34 +580,63 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkPackagesPack CloudUserId: request.Body.CloudUserId, ImageDownloadMode: utils.MapPointer(request.Body.ImageDownloadMode, toGrpcImageDownloadMode), } - client, err := (*apiContainerClient).RunStarlarkPackage(ctx, &runStarlarkPackageArgs) + + ctxWithCancel, cancelCtxFunc := context.WithCancel(ctx) + stream, err := (*apiContainerClient).RunStarlarkPackage(ctxWithCancel, &runStarlarkPackageArgs) if err != nil { + cancelCtxFunc() logrus.Errorf("Can't run Starlark package using gRPC call with enclave %s, error: %s", enclave_identifier, err) - return nil, stacktrace.NewError("Can't run Starlark package using gRPC call with enclave %s", enclave_identifier) + return nil, stacktrace.Propagate(err, "Can't run Starlark package using gRPC call with enclave %s", enclave_identifier) } - clientStream := grpc_file_streaming.NewClientStream[rpc_api.StreamedDataChunk, []byte](client) - // TODO: Why the gRPC is not sending the previous hash??? and we need to calc it manually - hasher := sha1.New() - previousBlockHash := "" - blockHash := "" - pipeReader := clientStream.PipeReader( - package_id, - func(dataChunk *rpc_api.StreamedDataChunk) ([]byte, string, error) { - blockHash = previousBlockHash - hasher.Reset() - hasher.Write(dataChunk.Data) - previousBlockHash = hex.EncodeToString(hasher.Sum(nil)) - return dataChunk.Data, blockHash, nil - }, - ) + asyncLogs := NewAsyncStarlarkLogs(cancelCtxFunc) + go asyncLogs.RunAsyncStarlarkLogs(stream) - response := api.PostEnclavesEnclaveIdentifierStarlarkScripts200ApplicationoctetStreamResponse{ - Body: pipeReader, - ContentLength: 0, // No file size is provided since we are streaming it directly + var response api_type.StarlarkRunResponse + response.FromStarlarkRunLogs(utils.MapList(asyncLogs.WaitAndConsumeAll(), toHttpApiStarlarkRunResponseLine)) + + return api.PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200JSONResponse(response), nil +} + +type AsyncStarlarkLogs struct { + cancelCtxFunc context.CancelFunc + starlarkRunResponseLineChan chan *rpc_api.StarlarkRunResponseLine +} + +func NewAsyncStarlarkLogs(cancelCtxFunc context.CancelFunc) AsyncStarlarkLogs { + starlarkResponseLineChan := make(chan *rpc_api.StarlarkRunResponseLine) + return AsyncStarlarkLogs{ + cancelCtxFunc: cancelCtxFunc, + starlarkRunResponseLineChan: starlarkResponseLineChan, } +} - return api.PostEnclavesEnclaveIdentifierStarlarkPackagesPackageId200ApplicationoctetStreamResponse(response), nil +func (async AsyncStarlarkLogs) RunAsyncStarlarkLogs(stream grpc.ClientStream) { + defer func() { + close(async.starlarkRunResponseLineChan) + async.cancelCtxFunc() + }() + for { + responseLine := new(rpc_api.StarlarkRunResponseLine) + err := stream.RecvMsg(responseLine) + if err == io.EOF { + logrus.Debugf("Successfully reached the end of the response stream. Closing.") + return + } + if err != nil { + logrus.Errorf("Unexpected error happened reading the stream. Client might have cancelled the stream\n%v", err.Error()) + return + } + async.starlarkRunResponseLineChan <- responseLine + } +} + +func (async AsyncStarlarkLogs) WaitAndConsumeAll() []rpc_api.StarlarkRunResponseLine { + var logs []rpc_api.StarlarkRunResponseLine + for elem := range async.starlarkRunResponseLineChan { + logs = append(logs, *elem) + } + return logs } // (POST /enclaves/{enclave_identifier}/starlark/scripts) @@ -641,24 +668,22 @@ func (manager *enclaveRuntime) PostEnclavesEnclaveIdentifierStarlarkScripts(ctx CloudUserId: request.Body.CloudUserId, ImageDownloadMode: utils.MapPointer(request.Body.ImageDownloadMode, toGrpcImageDownloadMode), } - client, err := (*apiContainerClient).RunStarlarkScript(ctx, &runStarlarkScriptArgs) + + ctxWithCancel, cancelCtxFunc := context.WithCancel(ctx) + stream, err := (*apiContainerClient).RunStarlarkScript(ctxWithCancel, &runStarlarkScriptArgs) if err != nil { - logrus.Errorf("Can't run Starlark script using gRPC call with enclave %s, error: %s", enclave_identifier, err) - return nil, stacktrace.NewError("Can't run Starlark script using gRPC call with enclave %s", enclave_identifier) - } - clientStream := grpc_file_streaming.NewClientStream[rpc_api.StreamedDataChunk, []byte](client) - pipeReader := clientStream.PipeReader( - "__RunStarlarkScript__", - func(dataChunk *rpc_api.StreamedDataChunk) ([]byte, string, error) { - return dataChunk.Data, dataChunk.PreviousChunkHash, nil - }, - ) - response := api.PostEnclavesEnclaveIdentifierStarlarkScripts200ApplicationoctetStreamResponse{ - Body: pipeReader, - ContentLength: 0, // No file size is provided since we are streaming it directly + cancelCtxFunc() + logrus.Errorf("Can't run Starlark package using gRPC call with enclave %s, error: %s", enclave_identifier, err) + return nil, stacktrace.Propagate(err, "Can't run Starlark script package using gRPC call with enclave %s", enclave_identifier) } - return api.PostEnclavesEnclaveIdentifierStarlarkScripts200ApplicationoctetStreamResponse(response), nil + asyncLogs := NewAsyncStarlarkLogs(cancelCtxFunc) + go asyncLogs.RunAsyncStarlarkLogs(stream) + + var response api_type.StarlarkRunResponse + response.FromStarlarkRunLogs(utils.MapList(asyncLogs.WaitAndConsumeAll(), toHttpApiStarlarkRunResponseLine)) + + return api.PostEnclavesEnclaveIdentifierStarlarkScripts200JSONResponse(response), nil } // =============================================================================================================== @@ -855,3 +880,109 @@ func toGrpcImageDownloadMode(flag api_type.ImageDownloadMode) rpc_api.ImageDownl panic(fmt.Sprintf("Missing conversion of Image Download Mode Enum value: %s", flag)) } } + +func toHttpApiStarlarkRunResponseLine(line rpc_api.StarlarkRunResponseLine) api_type.StarlarkRunResponseLine { + if runError := line.GetError(); runError != nil { + var http_type api_type.StarlarkRunResponseLine + http_type.FromStarlarkError(toHttpStarlarkError(*runError)) + return http_type + } + + if runInfo := line.GetInfo(); runInfo != nil { + var http_type api_type.StarlarkRunResponseLine + http_type.FromStarlarkInfo(toHttpStarlarkInfo(*runInfo)) + return http_type + } + + if runInstruction := line.GetInstruction(); runInstruction != nil { + var http_type api_type.StarlarkRunResponseLine + http_type.FromStarlarkInstruction(toHttpStarlarkInstruction(*runInstruction)) + return http_type + } + + if runInstructionResult := line.GetInstructionResult(); runInstructionResult != nil { + var http_type api_type.StarlarkRunResponseLine + http_type.FromStarlarkInstructionResult(toHttpStarlarkInstructionResult(*runInstructionResult)) + return http_type + } + + if runProgressInfo := line.GetProgressInfo(); runProgressInfo != nil { + var http_type api_type.StarlarkRunResponseLine + http_type.FromStarlarkRunProgress(toHttpStarlarkProgressInfo(*runProgressInfo)) + return http_type + } + + if runWarning := line.GetWarning(); runWarning != nil { + var http_type api_type.StarlarkRunResponseLine + http_type.FromStarlarkWarning(toHttpStarlarkWarning(*runWarning)) + return http_type + } + + if runFinishedEvent := line.GetRunFinishedEvent(); runFinishedEvent != nil { + var http_type api_type.StarlarkRunResponseLine + http_type.FromStarlarkRunFinishedEvent(toHttpStarlarkRunFinishedEvent(*runFinishedEvent)) + return http_type + } + + return api_type.StarlarkRunResponseLine{} +} + +func toHttpStarlarkError(rpc_value rpc_api.StarlarkError) api_type.StarlarkError { + return api_type.StarlarkError{ + // Error: rpc_value.Error, + } + +} +func toHttpStarlarkInfo(rpc_value rpc_api.StarlarkInfo) api_type.StarlarkInfo { + var info api_type.StarlarkInfo + info.Info.Instruction.InfoMessage = "" + return info +} + +func toHttpStarlarkInstruction(rpc_value rpc_api.StarlarkInstruction) api_type.StarlarkInstruction { + return api_type.StarlarkInstruction{ + Arguments: utils.MapList( + utils.FilterListNils(rpc_value.Arguments), + toHttpStarlarkInstructionArgument, + ), + } +} + +func toHttpStarlarkInstructionResult(rpc_value rpc_api.StarlarkInstructionResult) api_type.StarlarkInstructionResult { + var instructionResult api_type.StarlarkInstructionResult + instructionResult.InstructionResult.SerializedInstructionResult = rpc_value.SerializedInstructionResult + return instructionResult +} + +func toHttpStarlarkProgressInfo(rpc_value rpc_api.StarlarkRunProgress) api_type.StarlarkRunProgress { + var progress api_type.StarlarkRunProgress + progress.ProgressInfo.CurrentStepInfo = rpc_value.CurrentStepInfo + progress.ProgressInfo.CurrentStepNumber = int32(rpc_value.CurrentStepNumber) + progress.ProgressInfo.TotalSteps = int32(rpc_value.TotalSteps) + return progress +} + +func toHttpStarlarkWarning(rpc_value rpc_api.StarlarkWarning) api_type.StarlarkWarning { + var warning api_type.StarlarkWarning + warning.Warning.WarningMessage = rpc_value.WarningMessage + return warning +} + +func toHttpStarlarkRunResponseLine(rpc_value rpc_api.StarlarkRunResponseLine) api_type.StarlarkRunResponseLine { + return api_type.StarlarkRunResponseLine{} + +} +func toHttpStarlarkRunFinishedEvent(rpc_value rpc_api.StarlarkRunFinishedEvent) api_type.StarlarkRunFinishedEvent { + var event api_type.StarlarkRunFinishedEvent + event.RunFinishedEvent.IsRunSuccessful = rpc_value.IsRunSuccessful + event.RunFinishedEvent.SerializedOutput = rpc_value.SerializedOutput + return event +} + +func toHttpStarlarkInstructionArgument(rpc_value rpc_api.StarlarkInstructionArg) api_type.StarlarkInstructionArgument { + return api_type.StarlarkInstructionArgument{ + ArgName: rpc_value.ArgName, + IsRepresentative: rpc_value.IsRepresentative, + SerializedArgValue: rpc_value.SerializedArgValue, + } +} diff --git a/engine/server/engine/server/websocket_api_handler.go b/engine/server/engine/server/websocket_api_handler.go index 3fd6e64561..45269a0ece 100644 --- a/engine/server/engine/server/websocket_api_handler.go +++ b/engine/server/engine/server/websocket_api_handler.go @@ -109,6 +109,11 @@ func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierServicesServiceIdenti } } +// (GET /enclaves/{enclave_identifier}/starlark/executions/{starlark_execution_uuid}/logs) +func (engine WebSocketRuntime) GetEnclavesEnclaveIdentifierStarlarkExecutionsStarlarkExecutionUuidLogs(ctx echo.Context, enclaveIdentifier api_type.EnclaveIdentifier, starlarkExecutionUuid api_type.StarlarkExecutionUuid) error { + return nil +} + func (engine WebSocketRuntime) getLogStreamer( ctx echo.Context, enclaveIdentifier api_type.EnclaveIdentifier, diff --git a/engine/server/engine/utils/list.go b/engine/server/engine/utils/list.go index 344945329f..656f270322 100644 --- a/engine/server/engine/utils/list.go +++ b/engine/server/engine/utils/list.go @@ -19,3 +19,13 @@ func MapListStopOnError[T, U any](data []T, f func(T) (U, error)) ([]U, error) { } return res, nil } + +func FilterListNils[T any](data []*T) []T { + filterList := make([]T, len(data)) + for _, elem := range data { + if elem != nil { + filterList = append(filterList, *elem) + } + } + return filterList +}