feat: supported simple deployments and worker node types

This commit is contained in:
Konrad Geletey 2024-09-08 21:09:48 +03:00
parent 9b9776f9ac
commit 684b5b511a
No known key found for this signature in database
GPG key ID: 862B98E2204889CE
5 changed files with 39 additions and 14 deletions

View file

@ -1,9 +1,19 @@
import type { Compose } from "./compose.d.ts"
import type { Unit } from "./unit.d.ts"
type Spec = string | Compose
type Spec = string | Compose | Simple
type Simple = {
container: string
cpu?: Unit
ram?: Unit
name?: string
envs?: string[]
volumes?: string[]
}
export type Deployment = {
kind: string
kind: "compose" | "simple" | "deployment"
spec: Spec
promocode?: string
}

View file

@ -2,3 +2,4 @@ export * from "./account.d.ts"
export * from "./compose.d.ts"
export * from "./provider.d.ts"
export * from "./deployment.d.ts"
export * from "./worked.d.ts"

View file

@ -1,3 +1,5 @@
import type { Unit } from "./unit.d.ts"
export type Provider = {
uuid: string
name: string
@ -8,18 +10,6 @@ export type Provider = {
address: string
}
type Unit = {
unit: string
count: number
}
type ComputingUnit = {
cpu: number | Unit
mem: number | Unit
persistence: number | Unit
bandwitch: number | Unit
}
type PriceTable = {
[x: string]: ComputingUnit | Unit
}

13
entities/unit.d.ts vendored Normal file
View file

@ -0,0 +1,13 @@
export type Unit = {
unit: string
count: number
}
export type ComputingUnit = {
cpu: number | Unit
mem: number | Unit
persistence: number | Unit
bandwitch: number | Unit
}

11
entities/worker.d.ts vendored Normal file
View file

@ -0,0 +1,11 @@
import type { ComputingUnit } from "./unit.d.ts"
export type Worker = {
uuid: string
/* address for receive payments */
address?: string
name?: string
price?: ComputingUnit
/* address to node server */
node?: string
}