-
Notifications
You must be signed in to change notification settings - Fork 14
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
C2D refactor #818
base: feature/c2d_docker
Are you sure you want to change the base?
C2D refactor #818
Conversation
I ran this branch with:
I got the error below when calling
|
} | ||
export interface FreeComputeStartCommand extends Command { | ||
consumerAddress: string | ||
signature: string | ||
nonce: string | ||
environment: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we make this optional? In case there is only one free compute environment, then we don't need to send the environment ID. We just use the only one available. I'm not sure exactly why someone would have multiple free environments? Seems more likely that they would have multiple paid environments and then just a single free one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would agree, now its mandatory to know the id in advance, while before it was not... and usually there is only 1 free env
algorithm: ComputeAlgorithm | ||
datasets?: ComputeAsset[] | ||
output?: ComputeOutput | ||
resources?: ComputeResourceRequest[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see why someone would use this on free compute? It's free, so everyone will just always want the maximum possible resources.
Despite the issue I'm getting when calling the |
have the same issue |
When I increase the |
ok, so for now, it only works with a directCommand... but we need to know the env id in advance.. |
|
||
export interface ComputeResource { | ||
id: ComputeResourceType | ||
type?: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the type
and kind
? it can be a bit confusing with the ComputeResourceType
type that is now the id
?
Yeah, it shows up in the logs on the node, so can be pasted from there. That's the way I got it to work |
BREAKING CHANGES
Node config
We will use DOCKER_COMPUTE_ENVIRONMENTS as a definition of Docker engines & compute envs.
The full definition is withing interface
C2DDockerConfig
free
key is optional, and used to define what resources are available for free within a compute env.There are no more free and non free compute envs. Just one for each docker engine.
When calling startFreeCompute, node will use resource restrictions from
free
config, iffree
key is defined. if not, startFreeCompute will throw an error.When calling startCompute, node will use resource restrictions and will ignore
free
config.This will give us some advantages:
Resources
Every compute env has
resources
. A resource is defined like:There are couple of hardcoded:
cpu
,ram
anddisk
, and they can be extended by node ownerDisk resource has to be specified , as for now, there is no safe method of getting the available space.
When starting jobs, user can specify the resources needed, or else, if mins are defined, they are attached automatically
Free
resources can be defined for a compute env, this is what anyone can use, for free, using startFreeCompute. They are part of compute env resources, and counted.Docker with no free compute
All other settings are detected automatically, like noOfCpus and RAM:
Docker with free compute
All other settings are detected automatically, like noOfCpus and RAM:
ComputeEnv interface & getComputeEnvironments command
see new structures above
Commands
startFreeCompute
requires environmentId nowstartFreeCompute
andstartCompute
a new optional parameterresources
is available. This will allow user to request what resources to use, instead of using all. Imagine the following scenario:- host has 16 cpus and 4 gpus exposed in a compute env
- in the current setup, if you want to run a job, you will pay for all (16 x price_per_cpu_per_min + 4 x price_per_gpu)*minutes
- by using something like
resources: [{ "type":"cpu",amount: 4}, { "type":"gpu",amount: 1}]
you will only pay for 4 cpus and gpus , because that is what you are going to get