Skip to content
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

Merged
merged 133 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from 85 commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
6ca8f57
Project init
yitaopan May 21, 2024
760c1e0
Test
yitaopan May 23, 2024
228712a
Test
yitaopan May 23, 2024
9487b3c
Finished draft apis
yitaopan May 28, 2024
e279dd6
Finished draft apis
yitaopan May 28, 2024
6a4c61b
Merge branch 'main' into app-data-plane-session
yitaopan May 28, 2024
b01bd79
Delete sample files
yitaopan May 29, 2024
733c9a8
Generate and add examples
yitaopan May 29, 2024
250ce69
:Merge branch 'main' into app-data-plane-session
yitaopan May 29, 2024
ff045b7
Fix spell check
yitaopan May 29, 2024
7ea39b0
Fix example
yitaopan May 29, 2024
b8741f9
Add readme.md
yitaopan May 29, 2024
58f1226
Fix
yitaopan May 29, 2024
03874c1
Fix
yitaopan May 29, 2024
fe0475d
Prettier
yitaopan May 29, 2024
267850a
Prettier
yitaopan May 29, 2024
53ee125
Prettier
yitaopan May 29, 2024
dff134b
Prettier
yitaopan May 29, 2024
de4ddde
Auth
yitaopan May 29, 2024
66fa2d0
Auth
yitaopan May 29, 2024
103540f
Fix
yitaopan May 29, 2024
f1450b1
Fix
yitaopan May 29, 2024
1f4eb44
Parameterize some variables
yitaopan May 30, 2024
96bd103
Merge branch 'main' into app-data-plane-session
yitaopan May 30, 2024
0ee1785
Fix
yitaopan May 30, 2024
22e0e7b
Merge branch 'main' into app-data-plane-session
yitaopan Jun 3, 2024
884fc67
Merge branch 'main' into app-data-plane-session
yitaopan Jun 21, 2024
b2eb7b0
Merge branch 'main' into app-data-plane-session
yitaopan Jun 26, 2024
f1a3ee4
Merge branch 'Azure:main' into app-data-plane-session
yitaopan Aug 26, 2024
0e6f72e
Merge branch 'main' into app-data-plane-session
yitaopan Aug 29, 2024
c9019d4
Update with breaking change
yitaopan Aug 29, 2024
a6594c4
Include compiled swagger
yitaopan Aug 30, 2024
37326a1
Merge branch 'main' into app-data-plane-session-breaking-change
yitaopan Aug 30, 2024
b429c5c
Merge branch 'main' into app-data-plane-session
yitaopan Aug 30, 2024
924d168
Merge branch 'main' into app-data-plane-session
yitaopan Aug 30, 2024
6c4d3a0
Merge branch 'app-data-plane-session' of https://github.com/yitaopan/…
yitaopan Aug 30, 2024
c073254
Merge branch 'app-data-plane-session' into app-data-plane-session-bre…
yitaopan Aug 30, 2024
947dee4
Add list files
yitaopan Aug 30, 2024
85d91f0
Merge and resolve conflicts
yitaopan Aug 30, 2024
22d8f17
Update route
yitaopan Aug 30, 2024
01fb04e
Fix
yitaopan Sep 1, 2024
eda1ad2
Fix
yitaopan Sep 3, 2024
8b686e6
Fix
yitaopan Sep 4, 2024
acfd526
Fix api version
yitaopan Sep 5, 2024
516b2b3
Fix api version
yitaopan Sep 5, 2024
ae764ef
Fix examples
yitaopan Sep 5, 2024
3ce7d2e
Merge branch 'main' into app-data-plane-session-breaking-change
yitaopan Sep 5, 2024
942590f
Restore readme.md
yitaopan Sep 5, 2024
04640b8
Merge branch 'app-data-plane-session-breaking-change' of https://gith…
yitaopan Sep 5, 2024
7d7b693
Fix examples
yitaopan Sep 5, 2024
212202d
Fix examples
yitaopan Sep 5, 2024
f1ac679
Fix examples
yitaopan Sep 5, 2024
9e6ecb9
Fix examples
yitaopan Sep 5, 2024
3d2ffd4
Fix examples
yitaopan Sep 5, 2024
82fa5e1
Fix
yitaopan Sep 5, 2024
6b64576
Fix
yitaopan Sep 5, 2024
67afdf2
Fix
yitaopan Sep 5, 2024
59124b4
Use session pool management endpoint
yitaopan Sep 9, 2024
971141a
Update namespace to Microsoft.App.DynamicSessions
yitaopan Sep 12, 2024
61365f2
Merge branch 'main' into app-data-plane-session-breaking-change
yitaopan Sep 12, 2024
7bf8f51
Add LRO accepted response for execute code
yitaopan Sep 12, 2024
a7afaeb
Merge branch 'main' into app-data-plane-session-breaking-change
yitaopan Sep 18, 2024
63d3f1b
Review
yitaopan Sep 18, 2024
c8a468c
Review
yitaopan Sep 18, 2024
dc870f3
Review
yitaopan Sep 18, 2024
b8a8095
Update route
yitaopan Sep 19, 2024
0485ce0
Upload file
yitaopan Sep 19, 2024
ac4c7cf
Download file
yitaopan Sep 19, 2024
1bf439d
Merge branch 'main' into app-data-plane-session-breaking-change
yitaopan Sep 24, 2024
56457b4
Fix TypeSpec validation
yitaopan Sep 24, 2024
2938054
Fix SpellCheck
yitaopan Sep 24, 2024
b8d818d
Fix SpellCheck
yitaopan Sep 24, 2024
71f00d6
Fix LintDiff
yitaopan Sep 24, 2024
9138c7d
Fix examples
yitaopan Sep 24, 2024
fd2bda4
Fix examples
yitaopan Sep 24, 2024
73808c7
Fix examples
yitaopan Sep 24, 2024
7409741
Fix LinkDiff
yitaopan Sep 24, 2024
edccc2b
Fix
yitaopan Sep 24, 2024
f812bc0
Fix
yitaopan Sep 24, 2024
18a4208
Fix
yitaopan Sep 24, 2024
893bc84
Fix LRO
yitaopan Sep 24, 2024
6882280
Add example
yitaopan Sep 24, 2024
af70c1d
Fix examples
yitaopan Sep 24, 2024
1e5e724
Fix examples
yitaopan Sep 24, 2024
9de2dbf
Remove NetworkStatus
yitaopan Sep 24, 2024
5be1a36
Update doc
yitaopan Sep 25, 2024
82d4129
Update path
yitaopan Sep 29, 2024
ef2687e
Update code execution resposne
yitaopan Sep 29, 2024
d59f0a2
Update path
yitaopan Sep 29, 2024
c93423f
Change api version from 2024-09-01 to 2024-10-02-preview
yitaopan Oct 1, 2024
c45470f
Fix readme
yitaopan Oct 1, 2024
c658fb1
Fix example
yitaopan Oct 1, 2024
b9053d6
Fix LRO status
yitaopan Oct 8, 2024
791b9c9
identifier to sessionId
yitaopan Oct 8, 2024
9dd555d
Add error response to code execution
yitaopan Oct 8, 2024
5c08829
Update SessionResourceFile:
yitaopan Oct 8, 2024
bd7c55e
Update code execute
yitaopan Oct 8, 2024
c258847
Update code execute
yitaopan Oct 8, 2024
4fbf79e
Use Foundations.OperationState
yitaopan Oct 8, 2024
b17ae64
Update code execute
yitaopan Oct 8, 2024
3da816a
Fix
yitaopan Oct 8, 2024
3b39369
Fix
yitaopan Oct 8, 2024
f28e618
Fix
yitaopan Oct 10, 2024
d7f56b5
Fix
yitaopan Oct 10, 2024
f9d59ab
Fix
yitaopan Oct 10, 2024
9be8208
Use query param for file path
yitaopan Oct 10, 2024
3befeae
Use query param for file path
yitaopan Oct 10, 2024
d1ae934
Fix tests
yitaopan Oct 10, 2024
cf3b5e6
Fix
yitaopan Oct 14, 2024
894258d
Fix
yitaopan Oct 14, 2024
115e29a
Fix
yitaopan Oct 14, 2024
3b48a3c
Fix
yitaopan Oct 14, 2024
46def46
Fix
yitaopan Oct 14, 2024
f7535e1
Fix doc
yitaopan Oct 14, 2024
1cf3c94
Fix
yitaopan Oct 14, 2024
907d071
Fix
yitaopan Oct 14, 2024
bbeab5d
Fix
yitaopan Oct 14, 2024
1295b6b
Add content type
yitaopan Oct 14, 2024
d380b95
Fix
yitaopan Oct 15, 2024
8557200
Fix
yitaopan Oct 15, 2024
5858218
Fix
yitaopan Oct 15, 2024
3b9159e
Fix
yitaopan Oct 15, 2024
b96100d
Fix example
yitaopan Oct 15, 2024
e3c7027
Fix
yitaopan Oct 15, 2024
dd6b207
Fix
yitaopan Oct 15, 2024
3995b23
Fix
yitaopan Oct 15, 2024
60ee025
Fix
yitaopan Oct 16, 2024
e747a0b
Fix examples
yitaopan Oct 17, 2024
bffcb8d
Fix naming
yitaopan Oct 22, 2024
73f15f6
Model code execution as resource
yitaopan Oct 22, 2024
3f781b6
Record unknown type
yitaopan Oct 22, 2024
71455f9
Use standard operation in GetFileContent action
yitaopan Oct 25, 2024
07c7f11
Fix
yitaopan Nov 1, 2024
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
5 changes: 5 additions & 0 deletions specification/app/Microsoft.App.DynamicSessions/client.tsp
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"
}
}
}
}
31 changes: 31 additions & 0 deletions specification/app/Microsoft.App.DynamicSessions/main.tsp
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.")
Copy link
Member

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

Copy link
Member

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 ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved

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;
Copy link
Member

@weidongxu-microsoft weidongxu-microsoft Sep 25, 2024

Choose a reason for hiding this comment

The 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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, added more information in the doc.

Choose a reason for hiding this comment

The 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;
}
Loading