Skip to content
Open
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
46 changes: 34 additions & 12 deletions site-content/angular/controllers/npkMainCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,12 @@ angular
instanceType: "?",
price: 0,
az: ''
}
},
"g4": {
instanceType: "?",
price: 0,
az: ''
},
};

// $scope.instances = {};
Expand Down Expand Up @@ -1247,7 +1252,7 @@ angular
$scope.wordlistKeyspace = 0;

$scope.gpus = {
// "g3s.xlarge": 1,
"g3s.xlarge": 1,
"g3.4xlarge": 1,
"g3.8xlarge": 2,
"g3.16xlarge": 4,
Expand All @@ -1256,10 +1261,12 @@ angular
"p2.16xlarge": 16,
"p3.2xlarge": 1,
"p3.8xlarge": 4,
"p3.16xlarge": 8
"p3.16xlarge": 8,
"g4dn.xlarge": 1
};

$scope.vcpus = {
"g3s.xlarge": 4,
"g3.4xlarge": 16,
"g3.8xlarge": 32,
"g3.16xlarge": 64,
Expand All @@ -1268,13 +1275,15 @@ angular
"p2.16xlarge": 64,
"p3.2xlarge": 8,
"p3.8xlarge": 32,
"p3.16xlarge": 64
"p3.16xlarge": 64,
"g4dn.xlarge": 4
};

$scope.view_layout = {
"g3": ["g3.4xlarge", "g3.8xlarge", "g3.16xlarge"],
"g3": ["g3s.xlarge","g3.4xlarge", "g3.8xlarge", "g3.16xlarge"],
"p2": ["p2.xlarge", "p2.8xlarge", "p2.16xlarge"],
"p3": ["p3.2xlarge", "p3.8xlarge", "p3.16xlarge"]
"p3": ["p3.2xlarge", "p3.8xlarge", "p3.16xlarge"],
"g4": ["g4dn.xlarge"]
};

$scope.quotaFor = function(instanceType) {
Expand Down Expand Up @@ -1585,7 +1594,7 @@ angular

$scope.processInstancePrices = function() {
$scope.cheapest_g3 = $scope.getLowestPrice({
// "g3s.xlarge": 1,
"g3s.xlarge": 1,
"g3.4xlarge": 1,
"g3.8xlarge": 2,
"g3.16xlarge": 4
Expand All @@ -1602,17 +1611,23 @@ angular
"p3.8xlarge": 4,
"p3.16xlarge": 8
});

$scope.cheapest_g4 = $scope.getLowestPrice({
"g4dn.xlarge": 1
});

$scope.idealInstances = {
"g3": {},
"p2": {},
"p3": {}
"p3": {},
"g4": {}
}

Promise.all([
$scope.cheapest_g3,
$scope.cheapest_p2,
$scope.cheapest_p3
$scope.cheapest_p3,
$scope.cheapest_g4
]).then((data) => {
$scope.idealInstances.g3 = {
instanceType: data[0].cheapestType,
Expand All @@ -1631,6 +1646,12 @@ angular
price: data[2].price,
az: data[2].cheapestRegion
};

$scope.idealInstances.g4 = {
instanceType: data[3].cheapestType,
price: data[3].price,
az: data[3].cheapestRegion
};

$scope.setIdealInstance();

Expand All @@ -1642,7 +1663,7 @@ angular

$scope.setIdealInstance = function() {
$scope.idealInstance = null;
["g3", "p2", "p3"].forEach(function(e) {
["g3", "p2", "p3", "g4"].forEach(function(e) {
$scope.idealInstances[e].pricePerformance = $scope.pricingSvc[e][$scope.hashType] / $scope.idealInstances[e].price;

if (!$scope.idealInstances[e].price) {
Expand Down Expand Up @@ -1832,7 +1853,8 @@ angular
$scope.gpuNames = {
"G3": "Tesla M60",
"P2": "Tesla K80",
"P3": "Tesla V100"
"P3": "Tesla V100",
"G4": "Tesla T4"
};

// Apply the tooltips after campaigns are loaded.
Expand Down Expand Up @@ -2393,4 +2415,4 @@ angular
$scope.onReady();
});
}])
;
;
Loading