-
Notifications
You must be signed in to change notification settings - Fork 134
feat(svc): add dynamic server create op #756
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
AngelOnFira
wants to merge
1
commit into
04-26-feat_api_dynamic_servers_endpoint_handlers
from
04-30-feat_svc_add_dynamic_server_create_op
Closed
Changes from all commits
Commits
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 |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package rivet.backend.servers; | ||
|
|
||
| import "google/protobuf/struct.proto"; | ||
| import "proto/common.proto"; | ||
|
|
||
| message Server { | ||
| rivet.common.Uuid cluster_id = 1; | ||
| rivet.common.Uuid datacenter_id = 2; | ||
| int32 kill_timeout = 3; | ||
|
Contributor
Author
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. specify ms |
||
| map<string, MetadataJson> metadata = 4; | ||
AngelOnFira marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Runtime runtime = 5; | ||
| } | ||
|
|
||
| message MetadataJson { | ||
AngelOnFira marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| string value = 1; | ||
| } | ||
|
|
||
| message Runtime { | ||
AngelOnFira marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| optional DockerRuntime docker = 1; | ||
| } | ||
|
|
||
| message DockerRuntime { | ||
| repeated string args = 1; | ||
| map<string, string> environment = 2; | ||
| string image_id = 3; | ||
AngelOnFira marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| DockerNetwork network = 4; | ||
| } | ||
|
|
||
| message DockerNetwork { | ||
| DockerNetworkMode mode = 1; | ||
| map<string, DockerPort> ports = 2; | ||
| } | ||
|
|
||
| enum DockerNetworkMode { | ||
| HOST = 0; | ||
| BRIDGE = 1; | ||
AngelOnFira marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| message DockerPort { | ||
| optional int32 port = 1; | ||
AngelOnFira marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| DockerPortRouting routing = 2; | ||
| } | ||
|
|
||
| message DockerPortRouting { | ||
AngelOnFira marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| optional GameGuardProtocol game_guard = 1; | ||
| optional DockerHostRouting host = 2; | ||
| } | ||
|
|
||
| enum GameGuardProtocol { | ||
| HTTP = 0; | ||
| HTTPS = 1; | ||
| TCP = 2; | ||
| TCP_TLS = 3; | ||
| UDP = 4; | ||
| } | ||
|
|
||
| message DockerHostRouting { | ||
| google.protobuf.Value null = 1; | ||
AngelOnFira marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,24 @@ | ||
| [package] | ||
| name = "servers-server-create" | ||
| version = "0.0.1" | ||
| edition = "2021" | ||
| authors = ["Rivet Gaming, LLC <developer@rivet.gg>"] | ||
| license = "Apache-2.0" | ||
|
|
||
| [dependencies] | ||
| chirp-client = { path = "../../../../../lib/chirp/client" } | ||
| rivet-operation = { path = "../../../../../lib/operation/core" } | ||
| nomad-client = "0.0.9" | ||
| lazy_static = "1.4.0" | ||
|
|
||
| [dependencies.nomad_client_new] | ||
| package = "nomad_client" | ||
| git = "https://github.com/rivet-gg/nomad-client" | ||
| rev = "abb66bf0c30c7ff5b0c695dae952481c33e538b5" # pragma: allowlist secret | ||
|
|
||
| [dependencies.sqlx] | ||
| version = "0.7" | ||
| default-features = false | ||
|
|
||
| [dev-dependencies] | ||
| chirp-worker = { path = "../../../../../lib/chirp/worker" } |
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,7 @@ | ||
| [service] | ||
| name = "servers-server-create" | ||
|
|
||
| [runtime] | ||
| kind = "rust" | ||
|
|
||
| [operation] |
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,12 @@ | ||
| use std::collections::HashMap; | ||
|
|
||
| use proto::backend::{self, pkg::*}; | ||
| use rivet_operation::prelude::*; | ||
| // use chirp_worker::prelude::*; | ||
|
|
||
| #[operation(name = "servers-server-create")] | ||
| pub async fn handle( | ||
| ctx: OperationContext<servers::server_create::Request>, | ||
| ) -> GlobalResult<servers::server_create::Response> { | ||
| todo!(); | ||
| } |
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,6 @@ | ||
| use chirp_worker::prelude::*; | ||
|
|
||
| #[worker_test] | ||
| async fn basic(ctx: TestCtx) { | ||
| // TODO: | ||
| } |
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,14 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package rivet.backend.pkg.servers.server_create; | ||
|
|
||
| import "proto/common.proto"; | ||
| import "proto/backend/servers.proto"; | ||
|
|
||
| message Request { | ||
| repeated rivet.backend.servers.Server servers = 1; | ||
| } | ||
|
|
||
| message Response { | ||
| repeated rivet.common.Uuid server_ids = 1; | ||
| } |
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.