Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI And Other Improvements #1954

Merged
merged 8 commits into from
Jun 14, 2019
Merged
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
2 changes: 1 addition & 1 deletion SingularityExecutor/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mesosphere/mesos-slave:1.6.1-rc2
FROM mesosphere/mesos-slave:1.7.1
## mesos + java used to build hubspot/singularitybase

MAINTAINER platform-infrastructure-groups@hubspot.com
Expand Down
7 changes: 2 additions & 5 deletions SingularityService/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -555,13 +555,10 @@
<ports>
<port>7099</port>
</ports>
<entryPoint>
<exec>
<arg>/etc/singularity/start.sh</arg>
</exec>
</entryPoint>
<cmd>
<exec>
<args>/bin/bash</args>
<args>/etc/singularity/start.sh</args>
<args>server</args>
<args>/etc/singularity/singularity.yaml</args>
</exec>
Expand Down
2 changes: 1 addition & 1 deletion SingularityService/src/main/docker/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ if [[ "${SINGULARITY_DB_MIGRATE:-}" != "" ]]; then
fi

echo "Running: java ${args[@]} -jar /SingularityService.jar $*"
exec java "${args[@]}" -jar /SingularityService.jar $*
exec /usr/local/openjdk-8/bin/java "${args[@]}" -jar /SingularityService.jar $*
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ public class MesosConfiguration {
private double recheckMetricsLoad5Threshold = 0.8;
private int agentReregisterTimeoutSeconds = 600;

private Optional<String> mesosUsername;
private Optional<String> mesosPassword;
private Optional<String> mesosUsername = Optional.absent();
private Optional<String> mesosPassword = Optional.absent();

public int getMaxNumInstancesPerRequest() {
return maxNumInstancesPerRequest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ public static RootUrlMode parse(String value) {
private Optional<String> taskS3LogOmitPrefix = Optional.absent();

@NotEmpty
private String timestampFormat = "lll";
private String timestampFormat = "lll Z";

@NotEmpty
private String timestampWithSecondsFormat = "lll:ss";
private String timestampWithSecondsFormat = "lll:ss Z";

@JsonProperty
private Optional<String> redirectOnUnauthorizedUrl = Optional.absent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -695,8 +695,8 @@ public List<SingularityRequestParent> getActiveRequests(

@GET
@Path("/ids")
@Operation(summary = "Retrieve the list of active request ids")
public List<String> getActiveRequests(
@Operation(summary = "Retrieve the list of all request ids")
public List<String> getAllRequestIds(
@Parameter(hidden = true) @Auth SingularityUser user,
@Parameter(description = "Fetched a cached version of this data to limit expensive operations") @QueryParam("useWebCache") Boolean useWebCache) {
return filterAutorized(Lists.newArrayList(requestManager.getRequests(useWebCache(useWebCache))), SingularityAuthorizationScope.READ, user)
Expand All @@ -705,6 +705,18 @@ public List<String> getActiveRequests(
.collect(Collectors.toList());
}

@GET
@Path("/ids/active")
@Operation(summary = "Retrieve the list of active request ids")
public List<String> getActiveRequestIds(
@Parameter(hidden = true) @Auth SingularityUser user,
@Parameter(description = "Fetched a cached version of this data to limit expensive operations") @QueryParam("useWebCache") Boolean useWebCache) {
return filterAutorized(Lists.newArrayList(requestManager.getActiveRequests(useWebCache(useWebCache))), SingularityAuthorizationScope.READ, user)
.stream()
.map((r) -> r.getRequest().getId())
.collect(Collectors.toList());
}


@GET
@PropertyFiltering
Expand Down
2 changes: 1 addition & 1 deletion SingularityUI/app/actions/api/requests.es6
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const FetchRequests = buildApiAction(

export const FetchRequestIds = buildApiAction(
'FETCH_REQUESTS',
{url: '/requests/ids?useWebCache=true'}
{url: '/requests/ids/active?useWebCache=true'}
);

export const FetchRequestsInState = buildApiAction(
Expand Down
7 changes: 1 addition & 6 deletions SingularityUI/app/actions/ui/requestDetail.es6
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,14 @@ import {
import { FetchTaskCleanups, FetchScheduledTasksForRequest } from '../api/tasks';
import { FetchRequestUtilization } from '../api/utilization';

export const refresh = (requestId, taskHistoryPage = 1, taskHistoryPageSize = 10) => (dispatch, getState) => {
export const refresh = (requestId) => (dispatch, getState) => {
const requiredPromises = Promise.all([
dispatch(FetchRequest.trigger(requestId)),
dispatch(FetchRequestHistory.trigger(requestId, 5, 1))
])

dispatch(FetchActiveTasksForRequest.trigger(requestId));
dispatch(FetchTaskCleanups.trigger());

if (taskHistoryPage == 1) {
dispatch(FetchTaskHistoryForRequest.trigger(requestId, taskHistoryPageSize, taskHistoryPage));
}

dispatch(FetchDeploysForRequest.trigger(requestId, 5, 1));
dispatch(FetchScheduledTasksForRequest.trigger(requestId));
dispatch(FetchRequestUtilization.trigger(requestId, [404]))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class RequestDetailPage extends Component {
initialPageSize={Number(taskHistoryPageSize) || 10}
onPageChange={num => router.replace({ ...location, query: {...location.query, taskHistoryPage: num }})}
initialPageNumber={Number(taskHistoryPage) || 1}
refresh={this.props.fetchTaskHistoryForRequest}
/>
)}
{deleted || <RequestUtilization requestId={requestId} />}
Expand Down Expand Up @@ -118,4 +119,4 @@ const mapDispatchToProps = (dispatch, ownProps) => {
export default withRouter(connect(
mapStateToProps,
mapDispatchToProps
)(rootComponent(RequestDetailPage, (props) => refresh(props.params.requestId, Utils.maybe(props.location, ["query", "taskHistoryPage"]), Utils.maybe(props.location, ["query", "taskHistoryPageSize"])), true)));
)(rootComponent(RequestDetailPage, (props) => refresh(props.params.requestId), true)));
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class TaskHistoryTable extends Component {
if (tasks.length) {
maybeSearchButton = (
<Link to={`request/${requestId}/task-search`}>
<Button bsStyle="primary">
<Button bsSize="small" bsStyle="primary">
<Glyphicon glyph="search" aria-hidden="true" /><span> Search</span>
</Button>
</Link>
Expand Down
17 changes: 10 additions & 7 deletions SingularityUI/app/components/taskDetail/TaskAlerts.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,16 @@ const TaskAlerts = (props) => {
);
} else {
respondedMessage = (
<span>
Last healthcheck did not respond after{' '}
<code>
{lastHealthcheck.durationMillis && `${Utils.millisecondsToSecondsRoundToTenth(lastHealthcheck.durationMillis)} seconds`}
</code>
{' '}at {Utils.absoluteTimestampWithSeconds(lastHealthcheck.timestamp)}
</span>
<div>
<span>
Last healthcheck did not respond after{' '}
<code>
{lastHealthcheck.durationMillis && `${Utils.millisecondsToSecondsRoundToTenth(lastHealthcheck.durationMillis)} seconds`}
</code>
{' '}at {Utils.absoluteTimestampWithSeconds(lastHealthcheck.timestamp)}
</span>
<pre className="healthcheck-message">{lastHealthcheck.errorMessage || lastHealthcheck.responseBody}</pre>
</div>
);
}

Expand Down
8 changes: 7 additions & 1 deletion SingularityUI/app/components/taskDetail/TaskS3Logs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class TaskS3Logs extends Component {
emptyTableMessage="This task has no history yet"
data={s3Files}
keyGetter={(s3File) => s3File.key}
rowChunkSize={5}
rowChunkSize={20}
paginated={true}
>
<Column
Expand All @@ -56,18 +56,24 @@ class TaskS3Logs extends Component {
label="Last modified"
id="last-modified"
key="last-modified"
sortable={true}
sortData={(s3File) => s3File.lastModified}
cellData={(s3File) => Utils.absoluteTimestampWithSeconds(s3File.lastModified)}
/>
<Column
label="Estimated Start Time"
id="estimated-start"
key="estimated-start"
sortable={true}
sortData={(s3File) => (s3File.startTime) ? s3File.startTime : taskStartedAt}
cellData={(s3File) => (s3File.startTime) ? Utils.absoluteTimestampWithSeconds(s3File.startTime) : Utils.absoluteTimestampWithSeconds(taskStartedAt)}
/>
<Column
label="Estimated End Time"
id="estimtaed-end"
key="estimtaed-end"
sortable={true}
sortData={(s3File) => (s3File.endTime) ? s3File.endTime : s3File.lastModified}
cellData={(s3File) => (s3File.endTime) ? Utils.absoluteTimestampWithSeconds(s3File.endTime) : Utils.absoluteTimestampWithSeconds(s3File.lastModified)}
/>
<Column
Expand Down
11 changes: 9 additions & 2 deletions SingularityUI/app/utils.es6
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ const Utils = {
},

getMaxAvailableResource(slaveInfo, statName) {
if (!slaveInfo.hasOwnProperty('resources')) {
return 0;
}
switch (statName) {
case STAT_NAMES.cpusUsedStat:
try {
Expand Down Expand Up @@ -229,8 +232,12 @@ const Utils = {
},

getListOfUniqueRequestsFromListOfTasks(listOfTasks) {
const requestIds = listOfTasks.map(taskId => taskId.requestId)
return _.uniq(requestIds);
if (listOfTasks) {
const requestIds = listOfTasks.map(taskId => taskId.requestId)
return _.uniq(requestIds);
} else {
return []
}
},

getInstanceNoFromTaskId(taskId) {
Expand Down
Loading