Skip to content
This repository has been archived by the owner on Nov 12, 2019. It is now read-only.

Commit

Permalink
Task Inspector tasks link to Task Graph Inspector
Browse files Browse the repository at this point in the history
Previously, TaskGraphId was shown as a plain string - with this change,
they are now shown as a hyperlink, so you can get straight from a task
to the task graph it came from.

Secondly, I've updated the "Run Locally" generated output to quote words
consistently and appropriately, and removed unnecessary ';' from end of
lines (which were redundant).

Changes tested locally and working.
  • Loading branch information
petemoore committed Aug 27, 2015
1 parent b96c348 commit d61087e
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions lib/ui/taskinfo.jsx
Expand Up @@ -164,7 +164,11 @@ var TaskInfo = React.createClass({
<dt>SchedulerId</dt>
<dd><code>{task.schedulerId}</code></dd>
<dt>TaskGroupId</dt>
<dd><code>{task.taskGroupId}</code></dd>
<dd>
<a href={'../task-graph-inspector/#' + task.taskGroupId}>
{task.taskGroupId}
</a>
</dd>
</dl>
<dl className="dl-horizontal">
<dt>Scopes</dt>
Expand Down Expand Up @@ -258,14 +262,14 @@ var TaskInfo = React.createClass({
cmds.push("# WARNING: this is experimental mileage may vary!");
cmds.push("");
cmds.push("# Fetch docker image");
cmds.push("docker pull " + payload.image);
cmds.push("docker pull '" + payload.image + "'");
cmds.push("");
cmds.push("# Find a unique container name");
cmds.push("export NAME='task-" + taskId + "-container';");
cmds.push("export NAME='task-" + taskId + "-container'");
cmds.push("");
cmds.push("# Run docker command");
cmds.push("docker run -ti \\");
cmds.push(" --name $NAME \\");
cmds.push(" --name \"${NAME}\" \\");
if (payload.capabilities && payload.capabilities.privileged) {
cmds.push(" --privileged \\");
}
Expand Down Expand Up @@ -294,7 +298,6 @@ var TaskInfo = React.createClass({
}).join(' ');
cmds.push(" " + command + " \\");
}
cmds.push(" ;");
cmds.push("");
if (payload.artifacts) {
cmds.push("# Extract Artifacts");
Expand All @@ -304,13 +307,13 @@ var TaskInfo = React.createClass({
if (payload.artifacts[name].type === 'file') {
folder = path.dirname(name);
}
cmds.push("mkdir -p " + folder + ";");
cmds.push("docker cp $NAME:" + src + " " + name + ";");
cmds.push("mkdir -p '" + folder + "'");
cmds.push("docker cp \"$NAME:" + src + "\" '" + name + "'");
});
cmds.push("");
}
cmds.push("");
cmds.push("# Delete docker container");
cmds.push("docker rm -v $NAME;");
cmds.push("docker rm -v \"${NAME}\"");
return cmds.join('\n');
}
});
Expand Down

0 comments on commit d61087e

Please sign in to comment.