-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Azure Container Apps session data plane #30424
Changes from 85 commits
6ca8f57
760c1e0
228712a
9487b3c
e279dd6
6a4c61b
b01bd79
733c9a8
250ce69
ff045b7
7ea39b0
b8741f9
58f1226
03874c1
fe0475d
267850a
53ee125
dff134b
de4ddde
66fa2d0
103540f
f1450b1
1f4eb44
96bd103
0ee1785
22e0e7b
884fc67
b2eb7b0
f1a3ee4
0e6f72e
c9019d4
a6594c4
37326a1
b429c5c
924d168
6c4d3a0
c073254
947dee4
85d91f0
22d8f17
01fb04e
eda1ad2
8b686e6
acfd526
516b2b3
ae764ef
3ce7d2e
942590f
04640b8
7d7b693
212202d
f1ac679
9e6ecb9
3d2ffd4
82fa5e1
6b64576
67afdf2
59124b4
971141a
61365f2
7bf8f51
a7afaeb
63d3f1b
c8a468c
dc870f3
b8a8095
0485ce0
ac4c7cf
1bf439d
56457b4
2938054
b8d818d
71f00d6
9138c7d
fd2bda4
73808c7
7409741
edccc2b
f812bc0
18a4208
893bc84
6882280
af70c1d
1e5e724
9de2dbf
5be1a36
82d4129
ef2687e
d59f0a2
c93423f
c45470f
c658fb1
b9053d6
791b9c9
9dd555d
5c08829
bd7c55e
c258847
4fbf79e
b17ae64
3da816a
3b39369
f28e618
d7f56b5
f9d59ab
9be8208
3befeae
d1ae934
cf3b5e6
894258d
115e29a
3b48a3c
46def46
f7535e1
1cf3c94
907d071
bbeab5d
1295b6b
d380b95
8557200
5858218
3b9159e
b96100d
e3c7027
dd6b207
3995b23
60ee025
e747a0b
bffcb8d
73f15f6
3f781b6
71455f9
07c7f11
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/** | ||
* PLACEHOLDER | ||
* Add readme and sample | ||
*/ | ||
import "./main.tsp"; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"title": "CodeExecution_ExecuteCode_Result", | ||
"operationId": "CodeExecution_ExecuteCode", | ||
"parameters": { | ||
"api-version": "2024-09-01", | ||
"identifier": "testidentidier", | ||
"codeExecutionRequest": { | ||
"codeInputType": "Inline", | ||
"executionType": "Synchronous", | ||
"code": "print(7*9)", | ||
"timeoutInSeconds": 60 | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"codeInputType": "Inline", | ||
"executionType": "Synchronous", | ||
"code": "print(7*9)", | ||
"timeoutInSeconds": 60, | ||
"id": "1", | ||
"status": "Success", | ||
"stdout": "63/n", | ||
"stderr": "", | ||
"result": "", | ||
"executionTimeInMilliseconds": 4 | ||
} | ||
}, | ||
"202": { | ||
"headers": { | ||
"Operation_Id": "test-execution-id", | ||
"Operation-Location": "location" | ||
}, | ||
"body": { | ||
"codeInputType": "Inline", | ||
"executionType": "Asynchronous", | ||
"code": "7*9", | ||
"timeoutInSeconds": 60, | ||
"id": "1", | ||
"status": "", | ||
"stdout": "test-execution-id", | ||
"stderr": "", | ||
"result": null, | ||
"executionTimeInMilliseconds": 0 | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"title": "CodeExecution_GetResult", | ||
"operationId": "CodeExecution_GetResult", | ||
"parameters": { | ||
"api-version": "2024-09-01", | ||
"identifier": "testidentidier", | ||
"executionId": "testexecutionid" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"codeInputType": "Inline", | ||
"executionType": "Asynchronous", | ||
"code": "print(7*9)", | ||
"timeoutInSeconds": 60, | ||
"id": "1", | ||
"status": "Success", | ||
"stdout": "63/n", | ||
"stderr": "", | ||
"result": "", | ||
"executionTimeInMilliseconds": 4 | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"title": "SessionResourceFiles_DeleteFile", | ||
"operationId": "SessionResourceFiles_DeleteFile", | ||
"parameters": { | ||
"api-version": "2024-09-01", | ||
"fileName": "testfile", | ||
"identifier": "testidentidier" | ||
}, | ||
"responses": { | ||
"204": {} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"title": "SessionResourceFiles_GetFileContent", | ||
"operationId": "SessionResourceFiles_GetFileContent", | ||
"parameters": { | ||
"api-version": "2024-09-01", | ||
"fileName": "testfile", | ||
"identifier": "testidentidier" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": "testfilecontent" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"title": "SessionResourceFiles_GetFileMetadata", | ||
"operationId": "SessionResourceFiles_GetFileMetadata", | ||
"parameters": { | ||
"api-version": "2024-09-01", | ||
"fileName": "testfile", | ||
"identifier": "testidentidier" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"fileName": "testfile", | ||
"sizeInBytes": 4, | ||
"createdAt": "2024-05-29T00:00:00.000Z", | ||
"lastModifiedAt": "2024-05-29T02:17:25.902Z" | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"title": "SessionResourceFiles_ListFilesMetadata", | ||
"operationId": "SessionResourceFiles_ListFilesMetadata", | ||
"parameters": { | ||
"api-version": "2024-09-01", | ||
"identifier": "testidentidier" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"value": [ | ||
{ | ||
"fileName": "testfile", | ||
"sizeInBytes": 4, | ||
"createdAt": "2024-05-29T00:00:00.000Z", | ||
"lastModifiedAt": "2024-05-29T02:17:25.902Z" | ||
} | ||
], | ||
"nextLink": null | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"title": "SessionResourceFiles_UploadFile", | ||
"operationId": "SessionResourceFiles_UploadFile", | ||
"parameters": { | ||
"api-version": "2024-09-01", | ||
"identifier": "testidentidier", | ||
"path": "/", | ||
"file": "101010101" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"fileName": "testfile", | ||
"sizeInBytes": 4, | ||
"createdAt": "2024-05-29T00:00:00.000Z", | ||
"lastModifiedAt": "2024-05-29T02:17:25.902Z" | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import "@typespec/rest"; | ||
import "@typespec/versioning"; | ||
import "@azure-tools/typespec-azure-core"; | ||
import "./routes.tsp"; | ||
|
||
using TypeSpec.Http; | ||
using TypeSpec.Rest; | ||
using TypeSpec.Versioning; | ||
using Azure.Core; | ||
|
||
@useAuth(AadOauth2Auth<["https://dynamicsessions.io/.default"]>) | ||
@service({ | ||
title: "Microsoft.App Dynamic Sessions service", | ||
}) | ||
@server( | ||
"{endpoint}", | ||
"Session pool management endpoint.", | ||
{ | ||
@doc("The management endpoint of the session pool.") | ||
endpoint: string, | ||
} | ||
) | ||
@versioned(Microsoft.App.DynamicSessions.Versions) | ||
namespace Microsoft.App.DynamicSessions; | ||
|
||
@doc("The Microsoft.App Dynamic Sessions service versions.") | ||
enum Versions { | ||
@useDependency(Azure.Core.Versions.v1_0_Preview_2) | ||
@doc("The 2024-09-01 version of the Microsoft.App Dynamic Sessions service.") | ||
`2024-09-01`, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import "./common.tsp"; | ||
using TypeSpec.Http; | ||
using TypeSpec.Rest; | ||
|
||
namespace Microsoft.App.DynamicSessions; | ||
|
||
@doc("Code execution file resource collection.") | ||
model SessionResourceFileCollection { | ||
@doc("The files uploaded.") | ||
value: SessionResourceFile[]; | ||
} | ||
|
||
@doc("Code execution file resource.") | ||
@resource("files") | ||
model SessionResourceFile { | ||
@key("fileName") | ||
@segment("files") | ||
@doc("The name of the file.") | ||
@visibility("read", "query", "create", "update", "delete") | ||
fileName: string; | ||
|
||
@doc("The size of the file.") | ||
sizeInBytes: int64; | ||
|
||
@doc("The date time in RFC3339 format when the file was uploaded.") | ||
createdAt: utcDateTime; | ||
|
||
@doc("The date time in RFC3339 format when the file was last modified.") | ||
lastModifiedAt: utcDateTime; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
import "./common.tsp"; | ||
using Azure.Core; | ||
using TypeSpec.Http; | ||
using TypeSpec.Rest; | ||
|
||
namespace Microsoft.App.DynamicSessions; | ||
|
||
@doc("The request to execute code.") | ||
model SessionCodeExecutionRequest { | ||
@doc("The code input type of the code execution request.") | ||
codeInputType: CodeInputType; | ||
|
||
@doc("The execution type of the code execution request.") | ||
executionType: ExecutionType; | ||
|
||
@doc("The string of the code to execute, based on CodeInputType.") | ||
code: string; | ||
|
||
@doc("Code execution timeout in seconds.") | ||
timeoutInSeconds: int64; | ||
} | ||
|
||
@doc("The response containing the result of the code execution.") | ||
model SessionCodeExecutionResponse { | ||
...SessionCodeExecutionRequest; | ||
|
||
@visibility("read") | ||
@doc("Session code execution id.") | ||
id: string; | ||
|
||
@doc("The status of the code execution, indicates whether succeeded or not.") | ||
status: CodeExecutionStatus; | ||
|
||
@doc("The standard output of the code execution.") | ||
stdout: string; | ||
|
||
@doc("The standard error of the code execution.") | ||
stderr: string; | ||
|
||
#suppress "@azure-tools/typespec-azure-core/no-unknown" "" | ||
@doc("The result of the code execution.") | ||
result: unknown; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What exactly is this? A JSON object? You had to tell customer how to parse it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, added more information in the doc. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you mean by "after being Json serialized"? Could code execution return nothing or return some text without structure? I couldn't find an meaningful "result" value in your examples. |
||
|
||
@doc("The execution time of the code in milliseconds.") | ||
executionTimeInMilliseconds: int64; | ||
} | ||
|
||
@doc("The response of the async code execution.") | ||
model SessionCodeExecutionAsyncResponse { | ||
...SessionCodeExecutionResponse; | ||
|
||
@header | ||
@doc("The async code execution operation id.") | ||
operationId: string; | ||
|
||
...Foundations.LongRunningStatusLocation; | ||
} | ||
|
||
@doc("Code input type.") | ||
union CodeInputType { | ||
string, | ||
|
||
@doc("Inline.") | ||
inline: "Inline", | ||
|
||
@doc("InlineBase64.") | ||
inlineBase64: "InlineBase64", | ||
|
||
@doc("InlineText.") | ||
inlineText: "InlineText", | ||
} | ||
|
||
@doc("Execution Type") | ||
union ExecutionType { | ||
string, | ||
|
||
@doc("Synchronous") | ||
synchronous: "Synchronous", | ||
|
||
@doc("Asynchronous") | ||
asynchronous: "Asynchronous", | ||
} | ||
|
||
@doc("Code execution status.") | ||
union CodeExecutionStatus { | ||
string, | ||
|
||
@doc("The code execution succeeded.") | ||
Success: "Success", | ||
|
||
@doc("The code execution failed.") | ||
Failure: "Failure", | ||
|
||
@doc("The code execution canceled.") | ||
Canceled: "Canceled", | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import "@azure-tools/typespec-azure-resource-manager"; | ||
|
||
using Azure.Core; | ||
using TypeSpec.Http; | ||
using TypeSpec.Rest; | ||
|
||
namespace Microsoft.App.DynamicSessions; | ||
using OpenAPI; | ||
|
||
@doc("The session resource file name parameter.") | ||
model SessionResourceFileNameParameter { | ||
@doc("The name of the file.") | ||
@path | ||
fileName: string; | ||
} | ||
|
||
@doc("Session identifier query parameter.") | ||
model SessionIdentifier { | ||
@doc("The identifier of the session.") | ||
@query | ||
identifier: string; | ||
} | ||
|
||
@doc("Session code execution identifier query parameter.") | ||
model CodeExecutionIdentifier { | ||
@doc("The identifier of code execution.") | ||
@path | ||
executionId: string; | ||
} | ||
|
||
@doc("The session resource file path parameter.") | ||
model SessionResourceFilePathParameter { | ||
@doc("The path of the file after uploaded.") | ||
@query | ||
path: string; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mimeType property is missing from here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add contentType string property for session file ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved