-
Notifications
You must be signed in to change notification settings - Fork 1
V1 #63
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
Closed
Closed
V1 #63
Changes from 25 commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
23b7a08
wip: update
raksiv 625b191
wip resources namespace.
tjholm 7357406
wip topics
jyecusch a270b37
wip: secrets
raksiv b8f71f2
wip: workers and schedule workers
HomelessDinosaur 2b0b6c7
working schedule implementation
HomelessDinosaur d0b3ac0
wip: update proto and implement other workers
HomelessDinosaur c98749c
add kv stores, update topics, secrets, storage, and queues. Update tests
HomelessDinosaur b4999c2
add kv store tests
HomelessDinosaur 4b46828
add worker graceful exiting
HomelessDinosaur 5cc3e83
stop attempting response to registration request
HomelessDinosaur df0bb8e
add license files
HomelessDinosaur d44609d
update websocket tests
HomelessDinosaur bb24115
wip improve testing
HomelessDinosaur 7f3c732
update proto, tests, and API interface
HomelessDinosaur 4f3f6b4
wip: issues with api.route("/test");
raksiv 33e1331
add middlewares when creating api route
HomelessDinosaur a114a1a
minor fix to route.all
raksiv 8c4b8d7
Fix/routes (#64)
raksiv a2a03ed
add sql support
HomelessDinosaur 9dc3246
add batch resources
HomelessDinosaur c7cce17
add generic to batch jobs
HomelessDinosaur f6901c5
remove API overloads with params to reduce typing issues
HomelessDinosaur b1c5b47
fix the order that middleware is executed.
raksiv c055263
fix route.all by assigning correct HttpMethods
raksiv 5258030
remove wrapper clients
HomelessDinosaur a0a81ad
format fix and update workflow files
HomelessDinosaur 8208b5c
update tests
HomelessDinosaur 69fd9f0
add to string and test cases, as well as job worker tests
HomelessDinosaur c916c7f
add missing license headers
HomelessDinosaur da5d71c
format
HomelessDinosaur f56f12c
remove synchronous code for API routes and resource calls
HomelessDinosaur c3d75c3
remove onmessage, onconnect, and ondisconnect from websocket
HomelessDinosaur bcfc507
remove all synchronous tests
HomelessDinosaur 885b9f7
stop versioning proto files
HomelessDinosaur File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -330,4 +330,5 @@ ASALocalRun/ | |
| **/obj/ | ||
| **/bin/ | ||
| .idea | ||
| .vs | ||
| .vs | ||
| dotCover.* | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,36 @@ | ||
| .PHONY: test | ||
|
|
||
| # the version of of https://github.com/nitrictech/nitric to use in base client generation. | ||
| NITRIC_VERSION := 0.33.0 | ||
| NITRIC_VERSION := 1.17.0 | ||
|
|
||
| generate: clean download build | ||
|
|
||
| test: | ||
| dotnet test tests/Nitric.Sdk.Test | ||
| @dotnet test test/Nitric.Sdk.Test | ||
|
|
||
| build: | ||
| dotnet build src/Nitric.Sdk/Nitric.Sdk.csproj | ||
| @dotnet build src/Nitric.Sdk/Nitric.Sdk.csproj | ||
| @mv src/Nitric.Sdk/Proto/nitric/proto/* src/Nitric.Sdk/Proto/ | ||
| @rm -rf nitric | ||
| @rm -rf src/Nitric.Sdk/Proto/nitric | ||
|
|
||
| clean: | ||
| rm -rf src/Nitric.Sdk/bin | ||
| rm -rf src/Nitric.Sdk/obj | ||
| rm -rf src/Nitric.Sdk/Proto | ||
| @rm -rf src/Nitric.Sdk/bin | ||
| @rm -rf src/Nitric.Sdk/obj | ||
| @rm -rf src/Nitric.Sdk/Proto | ||
|
|
||
| download: | ||
| curl -L https://github.com/nitrictech/nitric/releases/download/v${NITRIC_VERSION}/contracts.tgz -o contracts.tgz | ||
| tar xvzf contracts.tgz | ||
| rm contracts.tgz | ||
| @curl -L https://github.com/nitrictech/nitric/releases/download/v${NITRIC_VERSION}/proto.tgz -o nitric.tgz | ||
| @tar xvzf nitric.tgz | ||
| @rm nitric.tgz | ||
|
|
||
| pack: clean download | ||
| dotnet build src/Nitric.Sdk/Nitric.Sdk.csproj -c Release | ||
| mkdir -p __out | ||
| dotnet pack -c Release -o __out | ||
| @dotnet build src/Nitric.Sdk/Nitric.Sdk.csproj -c Release | ||
| @mkdir -p __out | ||
| @dotnet pack -c Release -o __out | ||
|
|
||
| coverage: | ||
| @echo "Using dotcover tool... Install using: 'dotnet tool install --global JetBrains.dotCover.GlobalTool'" | ||
| @rm -f coverage.xml dotCover.Output.html | ||
| @dotnet dotcover test --dcReportType=HTML --dcFilters="+:Nitric.Sdk;-:type=Nitric.Proto.*" | ||
| @open dotCover.Output.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,120 @@ | ||
| syntax = "proto3"; | ||
| package nitric.proto.apis.v1; | ||
|
|
||
| // protoc plugin options for code generation | ||
| option go_package = "github.com/nitrictech/nitric/core/pkg/proto/apis/v1;apispb"; | ||
| option java_package = "io.nitric.proto.apis.v1"; | ||
| option java_multiple_files = true; | ||
| option java_outer_classname = "ApisService"; | ||
| option php_namespace = "Nitric\\Proto\\Apis\\V1"; | ||
| option csharp_namespace = "Nitric.Proto.Apis.v1"; | ||
|
|
||
| // Service for API routing and handlers | ||
| service Api { | ||
| // Serve a route on an API | ||
| rpc Serve(stream ClientMessage) returns (stream ServerMessage); | ||
|
|
||
| // Retrieve details about an API | ||
| rpc ApiDetails(ApiDetailsRequest) returns (ApiDetailsResponse); | ||
| } | ||
|
|
||
| message ApiDetailsRequest { | ||
| string api_name = 1; | ||
| } | ||
|
|
||
| message ApiDetailsResponse { | ||
| string url = 1; | ||
| } | ||
|
|
||
| // ClientMessage sent by the service to the nitric server | ||
| message ClientMessage { | ||
| // globally unique ID of the request/response pair | ||
| string id = 1; | ||
|
|
||
| oneof content { | ||
| // Register an API route handler | ||
| RegistrationRequest registration_request = 2; | ||
|
|
||
| // Response to an HTTP request | ||
| HttpResponse http_response = 3; | ||
| } | ||
| } | ||
|
|
||
| message HeaderValue { | ||
| repeated string value = 1; | ||
| } | ||
|
|
||
| message QueryValue { | ||
| repeated string value = 1; | ||
| } | ||
|
|
||
| message HttpRequest { | ||
| // The request method | ||
| string method = 1; | ||
|
|
||
| // The path of the request | ||
| string path = 2; | ||
|
|
||
| // HTTP request headers | ||
| map<string, HeaderValue> headers = 3; | ||
|
|
||
| // HTTP Query params | ||
| map<string, QueryValue> query_params = 4; | ||
|
|
||
| // HTTP Path parameters | ||
| map<string, string> path_params = 5; | ||
|
|
||
| // HTTP Request body | ||
| bytes body = 6; | ||
| } | ||
|
|
||
| // HttpResponseMessage | ||
| message HttpResponse { | ||
| // The HTTP response status code | ||
| int32 status = 1; | ||
|
|
||
| // HTTP response headers | ||
| map<string, HeaderValue> headers = 2; | ||
|
|
||
| // HTTP response body | ||
| bytes body = 3; | ||
| } | ||
|
|
||
| // ServerMessage sent by the nitric server to the service | ||
| message ServerMessage { | ||
| // globally unique ID of the request/response pair | ||
| string id = 1; | ||
|
|
||
| oneof content { | ||
| // Response to an API serve request | ||
| RegistrationResponse registration_response = 2; | ||
|
|
||
| // HTTP request to be routed to the service (handler) | ||
| HttpRequest http_request = 3; | ||
| } | ||
| } | ||
|
|
||
| message RegistrationResponse { | ||
| } | ||
|
|
||
| message ApiWorkerScopes { | ||
| repeated string scopes = 1; | ||
| } | ||
|
|
||
| message ApiWorkerOptions { | ||
| // Apply security definitions to this operation | ||
| // This will be mapped to named ApiSecurityDefinitionResource(s) | ||
| map<string, ApiWorkerScopes> security = 1; | ||
| // explicitly disable security for this endpoint | ||
| // We need to do this as the default value of a repeated field | ||
| // is always empty so there is no way of knowing if security is explicitly | ||
| // disabled | ||
| bool security_disabled = 2; | ||
| } | ||
|
|
||
| message RegistrationRequest { | ||
| string api = 1; | ||
| string path = 2; | ||
| repeated string methods = 3; | ||
| ApiWorkerOptions options = 4; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| syntax = "proto3"; | ||
| package nitric.proto.batch.v1; | ||
|
|
||
| import "google/protobuf/struct.proto"; | ||
|
|
||
| // protoc plugin options for code generation | ||
| option go_package = "github.com/nitrictech/nitric/core/pkg/proto/batch/v1;batchpb"; | ||
| option java_package = "io.nitric.proto.batch.v1"; | ||
| option java_multiple_files = true; | ||
| option java_outer_classname = "BatchService"; | ||
| option php_namespace = "Nitric\\Proto\\Batch\\V1"; | ||
| option csharp_namespace = "Nitric.Proto.Batch.v1"; | ||
|
|
||
| // Service for processing jobs | ||
| service Job { | ||
| rpc HandleJob(stream ClientMessage) returns (stream ServerMessage); | ||
| } | ||
|
|
||
| // Service for submitting jobs to be processed | ||
| service Batch { | ||
| rpc SubmitJob(JobSubmitRequest) returns (JobSubmitResponse); | ||
| } | ||
|
|
||
| message ClientMessage { | ||
| // globally unique ID of the request/response pair | ||
| string id = 1; | ||
|
|
||
| oneof content { | ||
| // Register a handler for a job | ||
| RegistrationRequest registration_request = 2; | ||
|
|
||
| // Handle a job submission | ||
| JobResponse job_response = 3; | ||
| } | ||
| } | ||
|
|
||
| message JobRequest { | ||
| string job_name = 1; | ||
|
|
||
| JobData data = 2; | ||
| } | ||
|
|
||
| message JobData { | ||
| oneof data { | ||
| google.protobuf.Struct struct = 1; | ||
| } | ||
| } | ||
|
|
||
| message JobResponse { | ||
| // Mark if the job was successfully processed | ||
| bool success = 1; | ||
| } | ||
|
|
||
| message RegistrationRequest { | ||
| string job_name = 1; | ||
|
|
||
| // Register with default requirements | ||
| JobResourceRequirements requirements = 2; | ||
| } | ||
|
|
||
| message RegistrationResponse { | ||
| } | ||
|
|
||
| message JobResourceRequirements { | ||
| // The number of CPUs to allocate for the job | ||
| float cpus = 1; | ||
| // The amount of memory to allocate for the job | ||
| int64 memory = 2; | ||
| // The number of GPUs to allocate for the job | ||
| int64 gpus = 3; | ||
| } | ||
|
|
||
| // ServerMessage is the message sent from the nitric server to the service | ||
| message ServerMessage { | ||
| // globally unique ID of the request/response pair | ||
| string id = 1; | ||
|
|
||
| oneof content { | ||
| // | ||
| RegistrationResponse registration_response = 2; | ||
|
|
||
| // Request to a job handler | ||
| JobRequest job_request = 3; | ||
| } | ||
| } | ||
|
|
||
| message JobSubmitRequest { | ||
| // The name of the job that should handle the data | ||
| string job_name = 1; | ||
|
|
||
| // The data to be processed by the job | ||
| JobData data = 2; | ||
| } | ||
|
|
||
| message JobSubmitResponse { | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.