Skip to content

Commit

Permalink
Merge pull request #68 from at88mph/posix-map-fix-service-call
Browse files Browse the repository at this point in the history
Posix map fix service call
  • Loading branch information
at88mph authored Jul 10, 2024
2 parents d2b46d5 + 963104a commit 3fb11be
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG JAVA_VERSION=11

FROM gradle:7-jdk${JAVA_VERSION} as builder
FROM gradle:7-jdk${JAVA_VERSION} AS builder

RUN apt update \
&& apt install -y rsync xz-utils
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
# tags with and without build number so operators use the versioned
# tag but we always keep a timestamped tag in case a semantic tag gets
# replaced accidentally
VER=0.2.3
VER=0.2.4
TAGS="${VER} ${VER}-$(date -u +"%Y%m%dT%H%M%S")"
unset VER
17 changes: 13 additions & 4 deletions public/dev/js/science_portal_session.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,20 +319,29 @@
+ zeroPrefix(month) + "-" + zeroPrefix(nowDate.getUTCDate())
+ " " + zeroPrefix(nowDate.getUTCHours()) + ":" + zeroPrefix(nowDate.getMinutes())

// The free and totals are displayed, and so are parsed and fixed. The used field is data fed to the progress bar.
_selfPortalSess._platformUsage.cpu = {
"used" : platformUsage.cores.requestedCPUCores,
"free" : platformUsage.cores.cpuCoresAvailable - platformUsage.cores.requestedCPUCores,
"total" : platformUsage.cores.cpuCoresAvailable
"total" : platformUsage.cores.cpuCoresAvailable,
"display": {
"free": (parseFloat(platformUsage.cores.cpuCoresAvailable) - parseFloat(platformUsage.cores.requestedCPUCores)).toFixed(1),
"total": parseFloat(platformUsage.cores.cpuCoresAvailable).toFixed(1)
}
}

// {requestedRAM: "0G", ramAvailable: "0G", maxRAM: {ram: "0G", withCPUCores: 0}}
const requestedRAMGB = parseFileSize(platformUsage.ram.requestedRAM)
const availableRAMGB = parseFileSize(platformUsage.ram.ramAvailable)
_selfPortalSess._platformUsage.ram = {
"unit" : "G",
"unit" : "GB",
"used" : requestedRAMGB,
"free" : (parseFloat(availableRAMGB) - parseFloat(requestedRAMGB)).toFixed(2),
"total" : availableRAMGB
"free" : availableRAMGB - requestedRAMGB,
"total" : availableRAMGB,
"display": {
"free" : (parseFloat(availableRAMGB) - parseFloat(requestedRAMGB)).toFixed(2),
"total" : parseFloat(availableRAMGB).toFixed(2)
}
}

// These values may change over time, so store the key name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@
import ca.nrc.cadc.auth.AuthenticationUtil;
import ca.nrc.cadc.auth.AuthorizationToken;
import ca.nrc.cadc.auth.AuthorizationTokenPrincipal;
import ca.nrc.cadc.auth.SSOCookieCredential;
import ca.nrc.cadc.rest.InlineContentHandler;
import ca.nrc.cadc.rest.RestAction;
import ca.nrc.cadc.util.StringUtil;
import java.net.URL;
import java.util.Set;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.opencadc.token.Client;
Expand Down Expand Up @@ -142,6 +144,13 @@ protected Subject getCurrentSubject(final URL targetURL) throws Exception {
.forEach(authMethod -> subject.getPublicCredentials().remove(authMethod));
subject.getPublicCredentials().add(AuthMethod.TOKEN);
}
} else if (AuthenticationUtil.getAuthMethod(subject) == AuthMethod.COOKIE) {
final Set<SSOCookieCredential> publicCookieCredentials = subject.getPublicCredentials(SSOCookieCredential.class);
if (!publicCookieCredentials.isEmpty()) {
final SSOCookieCredential publicCookieCredential = publicCookieCredentials.toArray(new SSOCookieCredential[0])[0];
subject.getPublicCredentials().add(new SSOCookieCredential(publicCookieCredential.getSsoCookieValue(), targetURL.getHost(),
publicCookieCredential.getExpiryDate()));
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/react/SciencePortalConfirm.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class SciencePortalConfirm extends React.Component {
{modalMsg}
</Modal.Body>
<Modal.Footer>
<Button bsStyle="default" onClick={this.onClose}>
<Button variant="secondary" onClick={this.onClose}>
Cancel
</Button>

Expand Down
4 changes: 2 additions & 2 deletions src/react/SciencePortalPlatformLoad.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ function SciencePortalPlatformLoad(props) {
<Row className="sp-usage-bar-row">
<Col sm={12}>
<div className="sp-usage-cpu-title">
Available CPUs: {props.usage.cpu.free} / {props.usage.cpu.total}
Available CPUs: {props.usage.cpu.display.free} / {props.usage.cpu.display.total}
</div>
<div className="sp-usage-bar">
<Bar options={horizontalStackedCPUOptions} data={yAxisCPUData} />
Expand All @@ -249,7 +249,7 @@ function SciencePortalPlatformLoad(props) {
<Row className="sp-usage-bar-row">
<Col sm={12}>
<div className="sp-usage-ram-title">
Available RAM: {props.usage.ram.free}{props.usage.ram.unit} / {props.usage.ram.total}{props.usage.ram.unit}
Available RAM: {props.usage.ram.display.free}{props.usage.ram.unit} / {props.usage.ram.display.total}{props.usage.ram.unit}
</div>
<div className="sp-usage-bar">
<Bar options={horizontalStackedRAMOptions} data={yAxisRAMData} />
Expand Down

0 comments on commit 3fb11be

Please sign in to comment.