Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .vscode/rivet.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@
{
"path": "../lib/bolt",
},
{
"path": "../svc",
}
],
}
9 changes: 9 additions & 0 deletions errors/servers/servers/servers_multiple_port_routers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name = "SERVERS_MULTIPLE_PORT_ROUTERS"
description = "Multiple server port routers were provided."
http_status = 400
---

# Multiple Server Port Routers

Multiple server port routers were provided.
9 changes: 9 additions & 0 deletions errors/servers/servers/servers_multiple_runtimes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name = "SERVERS_MULTIPLE_RUNTIMES"
description = "Multiple server runtimes were provided."
http_status = 400
---

# Multiple Server Runtimes

Multiple server runtimes were provided.
9 changes: 9 additions & 0 deletions errors/servers/servers/servers_no_port_routers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name = "SERVERS_NO_PORT_ROUTERS"
description = "No port routers were provided."
http_status = 400
---

# No Port Routers

No port routers were provided.
9 changes: 9 additions & 0 deletions errors/servers/servers/servers_no_runtime.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name = "SERVERS_NO_RUNTIME"
description = "No server runtime were provided."
http_status = 400
---

# No Server Runtime

No server runtime were provided.
14 changes: 14 additions & 0 deletions fern/definition/cloud/games/tokens.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ service:
game_id:
type: uuid
response: CreateCloudTokenResponse
createServiceToken:
path: /games/{game_id}/tokens/service
method: POST
docs: Creates a new game service token.
path-parameters:
game_id:
type: uuid
response: CreateCloudTokenResponse

types:
CreateCloudTokenResponse:
Expand All @@ -22,3 +30,9 @@ types:
Slightly modified to include a description prefix and use Protobufs of
JSON.
type: string
CreateServiceTokenResponse:
properties:
token:
docs: |-
A JSON Web Token.
type: string
84 changes: 84 additions & 0 deletions fern/definition/servers/common.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json

types:
Server:
properties:
server_id: uuid
game_id: uuid
datacenter_id: uuid
cluster_id: uuid
metadata: unknown
resources: Resources
kill_timeout:
docs: >-
The duration to wait for in milliseconds before killing the server.
This should be set to a safe default, and can be overridden during a
DELETE request if needed.
type: optional<long>
runtime: Runtime
create_ts: long
destroy_ts: optional<long>

Resources:
properties:
cpu:
docs: |
The number of CPU cores in millicores, or 1/1000 of a core. For example,
1/8 of a core would be 125 millicores, and 1 core would be 1000
millicores.
type: integer
memory:
docs: The amount of memory in megabytes
type: integer

Runtime:
properties:
docker: optional<DockerRuntime>

DockerRuntime:
properties:
image_id: uuid
args: optional<list<string>>
environment: optional<map<string, string>>
network: DockerNetwork

DockerNetwork:
properties:
mode: optional<DockerNetworkMode>
ports: map<string, DockerPort>

DockerNetworkMode:
enum:
- bridge
- host

DockerPort:
properties:
port: optional<integer>
routing: DockerPortRouting

DockerPortRouting:
properties:
game_guard: optional<DockerGameGuardRouting>
host: optional<DockerHostRouting>

DockerGameGuardRouting:
properties:
protocol: optional<GameGuardProtocol>

GameGuardProtocol:
enum:
- http
- https
- tcp
- tcp_tls
- udp

DockerHostRouting:
properties:
protocol: optional<HostProtocol>

HostProtocol:
enum:
- tcp
- udp
59 changes: 59 additions & 0 deletions fern/definition/servers/servers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json

imports:
commons: common.yml

service:
auth: true
base-path: /servers/servers
endpoints:
create:
path: ""
method: POST
docs: Create a new dynamic server.
request:
body: CreateServerRequest
response: CreateServerResponse
destroy:
path: "/{server_id}"
method: DELETE
docs: Destroy a dynamic server.
path-parameters:
server_id:
docs: The id of the server to destroy
type: uuid
request:
name: DestroyServerRequest
query-parameters:
override_kill_timeout:
docs: >-
The duration to wait for in milliseconds before killing the server.
This should be used to override the default kill timeout if a faster
time is needed, say for ignoring a graceful shutdown.
type: optional<long>
response: DestroyServerResponse

types:
CreateServerRequest:
properties:
datacenter:
docs: The name ID of the datacenter
type: string
metadata: unknown
resources: commons.Resources
kill_timeout:
docs: >-
The duration to wait for in milliseconds before killing the server.
This should be set to a safe default, and can be overridden during a
DELETE request if needed.
type: optional<long>
runtime: commons.Runtime
CreateServerResponse:
properties:
server:
docs: The server that was created
type: commons.Server
DestroyServerResponse:
properties:
server_id:
type: uuid
25 changes: 25 additions & 0 deletions infra/default-builds/dockerfiles/test-ds-echo/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Created by https://www.toptal.com/developers/gitignore/api/rust
# Edit at https://www.toptal.com/developers/gitignore?templates=rust

### Rust ###
# Generated by Cargo
# will have compiled files and executables
debug/
target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

# End of https://www.toptal.com/developers/gitignore/api/rust

.dockerignore
.gitignore
Dockerfile

21 changes: 21 additions & 0 deletions infra/default-builds/dockerfiles/test-ds-echo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Created by https://www.toptal.com/developers/gitignore/api/rust
# Edit at https://www.toptal.com/developers/gitignore?templates=rust

### Rust ###
# Generated by Cargo
# will have compiled files and executables
debug/
target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

# End of https://www.toptal.com/developers/gitignore/api/rust

Loading