Skip to content

Commit

Permalink
titus - gpu field
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaslin committed Mar 16, 2018
1 parent 971400c commit 0a058b1
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 4 deletions.
1 change: 1 addition & 0 deletions help/titus.help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const helpContents: {[key: string]: string} = {
'titus.deploy.iamProfile': 'AWS IAM instance profile to assign to this service',
'titus.deploy.capacityGroup': 'Used by Titus to ensure capacity guarantees, defaults to the application name if not provided',
'titus.deploy.network': 'Amount of networking bandwidth to allocate in Mbps',
'titus.deploy.gpu': 'Number of GPUs to use. WARNING: only use if directed by Titus team, otherwise leave at 0',
'titus.deploy.allocateIP': 'If selected, specifies an IP to be allocated for each of your job’s containers',
'titus.deploy.softConstraints': 'Soft constraints are enforced on a best efforts basis. For example, if tasks can’t be perfectly balanced across zones, the best available balance is achieved without keeping the tasks pending for execution.',
'titus.deploy.hardConstraints': 'Constraints must be met and tasks will not be launched if constraint can’t be perfectly met',
Expand Down
2 changes: 2 additions & 0 deletions instance/details/instanceDetails.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ <h3 select-on-dbl-click>
<dd>{{instance.resources.disk}} MB</dd>
<dt>Network</dt>
<dd>{{instance.resources.networkMbps}} Mbps</dd>
<dt>GPU(s)</dt>
<dd>{{instance.resources.gpu}}</dd>
</dl>
</collapsible-section>
<collapsible-section heading="Status" expanded="true">
Expand Down
4 changes: 4 additions & 0 deletions pipeline/stages/runJob/runJobStage.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
<input type="number" class="form-control input-sm" name="networkMbps" ng-model="stage.cluster.resources.networkMbps" required/>
</stage-config-field>

<stage-config-field label="GPU(s)" help-key="titus.deploy.gpu">
<input type="number" class="form-control input-sm" name="cpu" ng-model="stage.cluster.resources.gpu" required/>
</stage-config-field>

<stage-config-field label="Entrypoint">
<input type="text" class="form-control input-sm" name="command" ng-model="stage.cluster.entryPoint"
required/>
Expand Down
10 changes: 10 additions & 0 deletions pipeline/stages/runJob/titusRunJobStage.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module.exports = angular.module('spinnaker.titus.pipeline.stage.runJobStage', [
{type: 'requiredField', fieldName: 'credentials'},
{type: 'requiredField', fieldName: 'cluster.region'},
{type: 'requiredField', fieldName: 'cluster.resources.cpu'},
{type: 'requiredField', fieldName: 'cluster.resources.gpu'},
{type: 'requiredField', fieldName: 'cluster.resources.memory'},
{type: 'requiredField', fieldName: 'cluster.resources.disk'},
{type: 'requiredField', fieldName: 'cluster.runtimeLimitSecs'}
Expand Down Expand Up @@ -123,6 +124,10 @@ module.exports = angular.module('spinnaker.titus.pipeline.stage.runJobStage', [
stage.cluster.securityGroups = [];
}

if (!stage.cluster.resources) {
stage.cluster.resources = {};
}

if (!stage.cluster.capacity) {
stage.cluster.capacity = {
min: 1,
Expand All @@ -132,6 +137,11 @@ module.exports = angular.module('spinnaker.titus.pipeline.stage.runJobStage', [
}

stage.cluster.runtimeLimitSecs = stage.cluster.runtimeLimitSecs || 3600;
stage.cluster.resources.gpu = stage.cluster.resources.gpu || 0;
stage.cluster.resources.cpu = stage.cluster.resources.cpu || 1;
stage.cluster.resources.disk = stage.cluster.resources.disk || 512;
stage.cluster.resources.memory = stage.cluster.resources.memory || 512;
stage.cluster.resources.networkMbps = stage.cluster.resources.networkMbps || 128;

stage.deferredInitialization = true;
$q.all({
Expand Down
4 changes: 3 additions & 1 deletion serverGroup/configure/ServerGroupCommandBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ module.exports = angular.module('spinnaker.titus.serverGroupCommandBuilder.servi
cpu: 1,
networkMbps: 128,
disk: 512,
memory: 512
memory: 512,
gpu: 0,
},
efs: {
mountPerm: 'RW'
Expand Down Expand Up @@ -99,6 +100,7 @@ module.exports = angular.module('spinnaker.titus.serverGroupCommandBuilder.servi
},
resources: {
cpu: serverGroup.resources.cpu,
gpu: serverGroup.resources.gpu,
memory: serverGroup.resources.memory,
disk: serverGroup.resources.disk,
networkMbps: serverGroup.resources.networkMbps,
Expand Down
12 changes: 9 additions & 3 deletions serverGroup/configure/wizard/resources.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,25 @@
<div class="form-group">
<div class="col-md-3 sm-label-right"><b>Memory (MB)</b></div>
<div class="col-md-3">
<input type="number" class="form-control input-sm" name="cpu" ng-model="command.resources.memory" required/>
<input type="number" class="form-control input-sm" name="memory" ng-model="command.resources.memory" required/>
</div>
</div>
<div class="form-group">
<div class="col-md-3 sm-label-right"><b>Disk (MB)</b></div>
<div class="col-md-3">
<input type="number" class="form-control input-sm" name="cpu" ng-model="command.resources.disk" required/>
<input type="number" class="form-control input-sm" name="disk" ng-model="command.resources.disk" required/>
</div>
</div>
<div class="form-group">
<div class="col-md-3 sm-label-right"><b>Network (Mbps)</b><help-field key="titus.deploy.network"></help-field></div>
<div class="col-md-3">
<input type="number" class="form-control input-sm" name="cpu" ng-model="command.resources.networkMbps" required/>
<input type="number" class="form-control input-sm" name="network" ng-model="command.resources.networkMbps" required/>
</div>
</div>
<div class="form-group">
<div class="col-md-3 sm-label-right"><b>Gpu</b><help-field key="titus.deploy.gpu"></help-field></div>
<div class="col-md-3">
<input type="number" class="form-control input-sm" name="gpu" ng-model="command.resources.gpu" required/>
</div>
</div>
<div class="form-group">
Expand Down

0 comments on commit 0a058b1

Please sign in to comment.