Skip to content

Commit

Permalink
Merge branch 'main' into task/DES-2559--node-version-bump
Browse files Browse the repository at this point in the history
  • Loading branch information
jarosenb authored Jul 21, 2023
2 parents 3626463 + 417fe05 commit 2cf7bf6
Show file tree
Hide file tree
Showing 9 changed files with 1,778 additions and 63 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ docs/_build/
target/
venv/
metrics/
.python-version

# ignore Google Drive API secrets
*secrets.json
Expand Down
1 change: 0 additions & 1 deletion .python-version

This file was deleted.

28 changes: 14 additions & 14 deletions designsafe/static/scripts/workspace/controllers/application-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,19 @@ export default function ApplicationFormCtrl($scope, $rootScope, $localStorage, $

$scope.data.app = resp.data;

Systems.getSystemStatus(resp.data.executionSystem)
.then((response) => {
let heartbeatStatus = response.heartbeat.status;
$scope.data.systemDown = (heartbeatStatus == false);
}, (err) => {
$scope.data.messages.push({
type: 'warning',
header: 'System status unknown',
body: `Could not access system status for system ${resp.data.executionSystem}.
Jobs may fail.`,
});
$scope.data.systemDown = null;
})
Systems.getSystemStatus(resp.data.exec_sys.login.host)
.then(
(response) => {
$scope.data.systemDown = !(
response.online &&
response.reachable &&
!(response.queues_down || response.in_maintenance)
);
},
(err) => {
$scope.data.systemDown = null;
}
)
.finally(() => {
$scope.resetForm();
});
Expand Down Expand Up @@ -117,7 +117,7 @@ export default function ApplicationFormCtrl($scope, $rootScope, $localStorage, $
// reset formValid, var is used for invalid form msg
$scope.data.formValid = [];

let readOnly = $scope.data.needsLicense || $scope.data.unavailable || $scope.data.systemDown;
let readOnly = $scope.data.needsLicense || $scope.data.unavailable;

/* inputs */
let items = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ <h2>Application Unavailable</h2>
</p>
</div>
<div class="lead alert alert-warning" ng-if="data.systemDown">
<h2>Application Unavailable</h2>
<p>
This application's execution system ({{data.app.executionSystem}}) is not currently accepting requests. Please try again later,
This application's execution system host ({{data.app.exec_sys.login.host}}) is not reachable and may be down for maintenance. Check
<a href="https://tacc.utexas.edu/portal/dashboard" target="_blank">System Status</a> for updates,
or submit a ticket for assistance.
</p>
</div>
Expand Down
57 changes: 15 additions & 42 deletions designsafe/static/scripts/workspace/services/systems-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,49 +87,22 @@ export function workspaceSystemsService($q, $http) {
};

/**
*
* @param {string} system: The system to monitor.
*
* Returns a promise which resolves to the response from the TACC monitoring
* API if the execution system has monitoring set up, or a dummy that lets us grab
* data.heartbeat.status from the response (default to true).
*/
service.getSystemStatus = function(system) {
switch (system) {
case 'designsafe.community.exec.stampede2.nores':
case 'designsafe.community.exec.stampede2':
return $http.get('https://portal.tacc.utexas.edu/commnq/stampede2.tacc.utexas.edu/summary.json',
{ headers: { 'X-Requested-With': undefined, Authorization: undefined } })
.then((resp) => {
return resp.data;
}, (err) => {
return $q.reject(err);
});

case 'designsafe.community.exec.maverick2':
return $http.get('https://portal.tacc.utexas.edu/commnq/maverick2.tacc.utexas.edu/summary.json',
{ headers: { 'X-Requested-With': undefined, Authorization: undefined } })
.then((resp) => {
return resp.data;
}, (err) => {
return $q.reject(err);
});

case 'designsafe.community.exec.ls5':
return $http.get('https://portal.tacc.utexas.edu/commnq/lonestar5.tacc.utexas.edu/summary.json',
{ headers: { 'X-Requested-With': undefined, Authorization: undefined } })
.then((resp) => {
return resp.data;
}, (err) => {
return $q.reject(err);
});

default: {
let deferred = $q.defer();
deferred.resolve({ heartbeat: { status: true } });
return deferred.promise;
*
* @param {string} system: The system to monitor.
*
* Returns a promise which resolves to the response from the TACC monitoring
* API if the execution system has monitoring set up.
*/
service.getSystemStatus = (hostname) => {
return $http.get('https://tap.tacc.utexas.edu/status/').then(
(resp) => {
const system = Object.values(resp.data).find((s) => s.hostname === hostname);
return system;
},
(err) => {
return $q.reject(err);
}
}
);
};
return service;
}
Loading

0 comments on commit 2cf7bf6

Please sign in to comment.