-
Notifications
You must be signed in to change notification settings - Fork 78
Feat: Adding the option to provide cpu count and memory size for the … #413
base: main
Are you sure you want to change the base?
Changes from 1 commit
e6ad46a
df06b26
eeda242
48e327c
e723969
4c9ad65
7d28f6b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,3 +26,6 @@ contexts: | |
| engines: | ||
| - type: nextflow | ||
| engine: nextflow | ||
| resourceRequirements: | ||
| vcpus: 1 | ||
| memoryLimit: 2048 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,6 +87,14 @@ export class ContextAppParameters { | |
| * The types of EC2 instances that may be launched in the compute environment. | ||
| */ | ||
| public readonly instanceTypes?: InstanceType[]; | ||
| /** | ||
| * The maximum number of Amazon EC2 vCPUs that an environment can reach for the nextflow engine. | ||
| */ | ||
| public readonly vCpus?: number; | ||
| /** | ||
| * The maximum memory limit that an environment can reach for the nextflow engine. | ||
|
Contributor
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. Is this NextFlow specific? How it will affect other supported engines? Have we tested this change with other engines?
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. No, changes got updated to support all engines
Contributor
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. Should you update comments than? |
||
| */ | ||
| public readonly memoryLimitMiB?: number; | ||
| /** | ||
| * If true, put EC2 instances into public subnets instead of private subnets. | ||
| * This allows you to obtain significantly lower ongoing costs if used in conjunction with the usePublicSubnets option | ||
|
|
@@ -133,6 +141,9 @@ export class ContextAppParameters { | |
| this.requestSpotInstances = getEnvBoolOrDefault(node, "REQUEST_SPOT_INSTANCES", false)!; | ||
| this.instanceTypes = instanceTypeStrings ? instanceTypeStrings.map((instanceType) => new InstanceType(instanceType.trim())) : undefined; | ||
|
|
||
| this.vCpus = getEnvNumber(node, "V_CPUS"); | ||
| this.memoryLimitMiB = getEnvNumber(node, "MEMORY_LIMIT_MIB"); | ||
|
|
||
| this.usePublicSubnets = getEnvBoolOrDefault(node, "PUBLIC_SUBNETS", false); | ||
| this.agcVersion = getEnvString(node, "AGC_VERSION"); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,10 +10,17 @@ type Filesystem struct { | |
| Configuration FSConfig `yaml:"configuration,omitempty"` | ||
| } | ||
| type Engine struct { | ||
| Type string `yaml:"type"` | ||
| Engine string `yaml:"engine"` | ||
| Filesystem Filesystem `yaml:"filesystem,omitempty"` | ||
| Type string `yaml:"type"` | ||
| Engine string `yaml:"engine"` | ||
| ResourceRequirements ResourceRequirement `yaml:"resourceRequirements,omitempty"` | ||
| Filesystem Filesystem `yaml:"filesystem,omitempty"` | ||
| } | ||
|
|
||
| type ResourceRequirement struct { | ||
| VCpus int `yaml:"vcpus,omitempty"` | ||
| MemoryLimitMiB int `yaml:"memoryLimit,omitempty"` | ||
|
Contributor
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. I don't think it will work as you might expect. "omitempty" means not to include values that absent. In your case values always present. Here is the test:
Contributor
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. I would suggest a unit test for that. |
||
| } | ||
|
|
||
| type Context struct { | ||
| InstanceTypes []string `yaml:"instanceTypes,omitempty"` | ||
| RequestSpotInstances bool `yaml:"requestSpotInstances,omitempty"` | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -110,6 +110,10 @@ schemaVersion: 0 | |
| { | ||
| Type: "nextflow", | ||
| Engine: "nextflow", | ||
| ResourceRequirements: ResourceRequirement{ | ||
| VCpus: 2, | ||
| MemoryLimitMiB: 4048, | ||
| }, | ||
| Filesystem: Filesystem{ | ||
| FSType: "S3", | ||
| }, | ||
|
|
@@ -122,6 +126,10 @@ schemaVersion: 0 | |
| { | ||
| Type: "nextflow", | ||
| Engine: "nextflow", | ||
| ResourceRequirements: ResourceRequirement{ | ||
| VCpus: 2, | ||
|
Contributor
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. Lets add tests with partial configuration. e.g. either VCpus or MemoryLimitMiB is set, but not both. |
||
| MemoryLimitMiB: 4048, | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
|
|
@@ -161,13 +169,19 @@ contexts: | |
| engines: | ||
| - type: nextflow | ||
| engine: nextflow | ||
| resourceRequirements: | ||
| vcpus: 2 | ||
| memoryLimit: 4048 | ||
| filesystem: | ||
| fsType: S3 | ||
| ctx3: | ||
| maxVCpus: 256 | ||
| engines: | ||
| - type: nextflow | ||
| engine: nextflow | ||
| resourceRequirements: | ||
| vcpus: 2 | ||
| memoryLimit: 4048 | ||
| `, | ||
| }, | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.