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

Updating the compute env specs (new structure) #1902

Closed
wants to merge 5 commits into from
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
30 changes: 30 additions & 0 deletions docs/interfaces/ComputeEnvFees.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / ComputeEnvFees

# Interface: ComputeEnvFees

## Table of contents

### Properties

- [feeToken](ComputeEnvFees.md#feeToken)
- [prices](ComputeEnvFees.md#prices)

## Properties

### feeToken

• **feeToken**: `string`

#### Defined in

[@types/Compute.ts:42](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L42)

___

### prices

• **prices**: `ComputeResourcesPricingInfo`[]

#### Defined in

[@types/Compute.ts:43](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L43)
20 changes: 20 additions & 0 deletions docs/interfaces/ComputeEnvFeesStructure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / ComputeEnvFeesStructure

# Interface: ComputeEnvFeesStructure

## Table of contents

### Properties

- [feeToken](ComputeEnvFeesStructure.md#chainId)

## Properties

### chainId

**chainId**: `ComputeEnvFees`

#### Defined in

[@types/Compute.ts:42](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L46)

89 changes: 50 additions & 39 deletions docs/interfaces/ComputeEnvironment.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@
### Properties

- [consumerAddress](ComputeEnvironment.md#consumeraddress)
- [cpuNumber](ComputeEnvironment.md#cpunumber)
- [cpuType](ComputeEnvironment.md#cputype)
- [totalCpu](ComputeEnvironment.md#totalCpu)
- [maxCpu](ComputeEnvironment.md#maxCpu)
- [totalRam](ComputeEnvironment.md#totalRam)
- [maxRam](ComputeEnvironment.md#maxRam)
- [maxDisk](ComputeEnvironment.md#maxDisk)
- [currentJobs](ComputeEnvironment.md#currentjobs)
- [desc](ComputeEnvironment.md#desc)
- [diskGB](ComputeEnvironment.md#diskgb)
- [gpuNumber](ComputeEnvironment.md#gpunumber)
- [gpuType](ComputeEnvironment.md#gputype)
- [description](ComputeEnvironment.md#description)
- [fees](ComputeEnvironment.md#ComputeEnvFeesStructure)
- [id](ComputeEnvironment.md#id)
- [lastSeen](ComputeEnvironment.md#lastseen)
- [maxJobDuration](ComputeEnvironment.md#maxjobduration)
- [maxJobs](ComputeEnvironment.md#maxjobs)
- [priceMin](ComputeEnvironment.md#pricemin)
- [ramGB](ComputeEnvironment.md#ramgb)
- [storageExpiry](ComputeEnvironment.md#storageexpiry)
- [lastSeen](ComputeEnvironment.md#lastSeen)
- [free](ComputeEnvironment.md#free)

## Properties

Expand All @@ -30,27 +31,27 @@

#### Defined in

[@types/Compute.ts:21](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L21)
[@types/Compute.ts:68](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L68)

___

### cpuNumber
### totalCpu

• **cpuNumber**: `number`
• **totalCpu**: `number`

#### Defined in

[@types/Compute.ts:11](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L11)
[@types/Compute.ts:58](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L58)

___

### cpuType
### maxCpu

• **cpuType**: `string`
• **maxCpu**: `number`

#### Defined in

[@types/Compute.ts:12](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L12)
[@types/Compute.ts:59](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L59)

___

Expand All @@ -60,47 +61,47 @@ ___

#### Defined in

[@types/Compute.ts:19](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L19)
[@types/Compute.ts:66](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L66)

___

### desc
### description

• **desc**: `string`
• **description**: `string`

#### Defined in

[@types/Compute.ts:18](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L18)
[@types/Compute.ts:65](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L65)

___

### diskGB
### maxDisk

• **diskGB**: `number`
• **maxDisk**: `number`

#### Defined in

[@types/Compute.ts:16](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L16)
[@types/Compute.ts:62](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L62)

___

### gpuNumber
### maxRam

• **gpuNumber**: `number`
• **maxRam**: `number`

#### Defined in

[@types/Compute.ts:13](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L13)
[@types/Compute.ts:61](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L61)

___

### gpuType
### totalRam

• **gpuType**: `string`
• **totalRam**: `number`

#### Defined in

[@types/Compute.ts:14](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L14)
[@types/Compute.ts:60](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L60)

___

Expand All @@ -110,7 +111,7 @@ ___

#### Defined in

[@types/Compute.ts:10](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L10)
[@types/Compute.ts:49](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L49)

___

Expand All @@ -120,7 +121,7 @@ ___

#### Defined in

[@types/Compute.ts:24](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L24)
[@types/Compute.ts:71](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L71)

___

Expand All @@ -130,7 +131,7 @@ ___

#### Defined in

[@types/Compute.ts:23](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L23)
[@types/Compute.ts:70](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L70)

___

Expand All @@ -140,27 +141,27 @@ ___

#### Defined in

[@types/Compute.ts:20](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L20)
[@types/Compute.ts:67](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L67)

___

### priceMin
### fees

• **priceMin**: `number`
• **fees**: `ComputeEnvFeesStructure`

#### Defined in

[@types/Compute.ts:17](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L17)
[@types/Compute.ts:63](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L63)

___

### ramGB
### free

• **ramGB**: `number`
• **free**: `boolean`

#### Defined in

[@types/Compute.ts:15](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L15)
[@types/Compute.ts:72](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L72)

___

Expand All @@ -170,4 +171,14 @@ ___

#### Defined in

[@types/Compute.ts:22](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L22)
[@types/Compute.ts:69](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L69)

___

### platform

• **platform**: `RunningPlatform[]`

#### Defined in

[@types/Compute.ts:73](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L73)
30 changes: 30 additions & 0 deletions docs/interfaces/ComputeResourcesPricingInfo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / ComputeResourcesPricingInfo

# Interface: ComputeResourcesPricingInfo

## Table of contents

### Properties

- [type](ComputeResourcesPricingInfo.md#type)
- [price](ComputeResourcesPricingInfo.md#price)

## Properties

### type

• **type**: `ComputeResourceType`

#### Defined in

[@types/Compute.ts:38](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L38)

___

### price

• **price**: `number`

#### Defined in

[@types/Compute.ts:39](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L39)
30 changes: 30 additions & 0 deletions docs/interfaces/RunningPlatform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / RunningPlatform

# Interface: RunningPlatform

## Table of contents

### Properties

- [architecture](RunningPlatform.md#architecture)
- [os](RunningPlatform.md#os)

## Properties

### architecture

• **architecture**: `string`

#### Defined in

[@types/Compute.ts:31](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L31)

___

### os

• **os**: `string`

#### Defined in

[@types/Compute.ts:32](https://github.com/oceanprotocol/ocean.js/blob/c99bc5c6/src/@types/Compute.ts#L32)
64 changes: 56 additions & 8 deletions src/@types/Compute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,71 @@
| 'configrationLog'
| 'publishLog'

// OLD V1 ComputeEnvironment specs
// export interface ComputeEnvironment {
// id: string
// cpuNumber: number
// cpuType: string
// gpuNumber: number
// gpuType: string
// ramGB: number
// diskGB: number
// priceMin: number
// desc: string
// currentJobs: number
// maxJobs: number
// consumerAddress: string
// storageExpiry: number
// maxJobDuration: number
// lastSeen: number
// free: boolean
// }

// new V2 C2D Compute Environment specs
export interface RunningPlatform {
architecture: string
os: string
}

export type ComputeResourceType = 'cpu' | 'memory' | 'storage'

export interface ComputeResourcesPricingInfo {
type: ComputeResourceType
price: number
}
export interface ComputeEnvFees {
feeToken: string
prices: ComputeResourcesPricingInfo[]
}
export interface ComputeEnvFeesStructure {
[chainId: string]: ComputeEnvFees
}
export interface ComputeEnvironment {
id: string
cpuNumber: number
cpuType: string
gpuNumber: number
gpuType: string
ramGB: number
diskGB: number
priceMin: number
desc: string
// legacy
// cpuNumber: number
// cpuType: string
// gpuNumber: number
// gpuType: string
// ramGB: number
// diskGB: number
// priceMin: number
totalCpu: number // total cpu available for jobs
maxCpu: number // max cpu for a single job. Imagine a K8 cluster with two nodes, each node with 10 cpus. Total=20, but at most you can allocate 10 cpu for a job
totalRam: number // total gb of RAM
maxRam: number // max allocatable GB RAM for a single job.
maxDisk: number // max GB of disck allocatable for a single job
fees: ComputeEnvFeesStructure
// legacy
description: string
currentJobs: number
maxJobs: number
consumerAddress: string
storageExpiry: number
maxJobDuration: number
lastSeen: number
free: boolean
platform?: RunningPlatform[] // array due to k8 support
}

export interface ComputeResult {
Expand Down Expand Up @@ -61,14 +109,14 @@
}

export enum FileObjectType {
URL = 'url',

Check warning on line 112 in src/@types/Compute.ts

View workflow job for this annotation

GitHub Actions / lint

'URL' is defined but never used
IPFS = 'ipfs',

Check warning on line 113 in src/@types/Compute.ts

View workflow job for this annotation

GitHub Actions / lint

'IPFS' is defined but never used
ARWEAVE = 'arweave'

Check warning on line 114 in src/@types/Compute.ts

View workflow job for this annotation

GitHub Actions / lint

'ARWEAVE' is defined but never used
}

export enum EncryptMethod {
AES = 'AES',

Check warning on line 118 in src/@types/Compute.ts

View workflow job for this annotation

GitHub Actions / lint

'AES' is defined but never used
ECIES = 'ECIES'

Check warning on line 119 in src/@types/Compute.ts

View workflow job for this annotation

GitHub Actions / lint

'ECIES' is defined but never used
}

export interface HeadersObject {
Expand Down
Loading