Loading client/src/components/JobInformation/CodeRow.vue +13 −18 Original line number Diff line number Diff line <template> <tr v-b-tooltip.hover :title="`click to ${action}`" @mousedown="mouseIsDown = true" @mousemove="mouseIsDown ? (mouseMoved = true) : (mouseMoved = false)" @mouseup="toggleExpanded()"> <tr> <td> {{ codeLabel }} </td> Loading @@ -13,7 +8,10 @@ <b-col cols="11"> <pre :class="codeClass">{{ codeItem }}</pre> </b-col> <b-col class="nopadding pointer"> <b-col class="nopadding pointer" v-b-tooltip.hover :title="`click to ${action}`" @mouseup="toggleExpanded()"> <font-awesome-icon :icon="iconClass" /> </b-col> </b-row> Loading @@ -37,10 +35,8 @@ export default { }, data() { return { mouseIsDown: false, mouseMoved: false, expanded: false, lastHeight: 0, lastPos: 0, }; }, computed: { Loading @@ -55,21 +51,20 @@ export default { }, }, updated() { // If the user is at the bottom of the code div, auto scroll for them. try { var codeDiv = document.querySelector("#stdout").querySelector(".code"); if (codeDiv.scrollTop >= this.lastHeight - 3000) { var codeDiv = this.$el.querySelector(".code"); if (codeDiv.scrollTop + codeDiv.offsetHeight >= this.lastPos - 5) { // scroll is at the bottom codeDiv.scrollTop = codeDiv.scrollHeight; } this.lastHeight = codeDiv.scrollHeight; this.lastPos = codeDiv.scrollHeight; } catch(exception) { console.log("Code div is not present"); console.debug("Code div is not present"); } }, methods: { toggleExpanded() { this.mouseIsDown = false; if (this.codeItem && !this.mouseMoved) { if (this.codeItem) { this.expanded = !this.expanded; } }, Loading client/src/components/JobInformation/JobInformation.test.js +4 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ describe("JobInformation/JobInformation.vue", () => { beforeEach(() => { axiosMock = new MockAdapter(axios); axiosMock.onGet(new RegExp(`api/configuration/decode/*`)).reply(200, { decoded_id: 123 }); axiosMock.onGet("/api/jobs/test_id?full=True&stdout_position=0&stdout_length=50000").reply(200, jobResponse); axiosMock.onGet("/api/jobs/test_id?full=True&stdout_position=0&stdout_length=50000&stderr_position=0&stderr_length=50000").reply(200, jobResponse); }); afterEach(() => { Loading @@ -48,6 +48,9 @@ describe("JobInformation/JobInformation.vue", () => { stdout_position: STDOUT_POSITION, stdout_length: STDOUT_LENGTH, stdout_text: STDOUT_TEXT, stderr_position: STDOUT_POSITION, stderr_length: STDOUT_LENGTH, stderr_text: STDOUT_TEXT, }; wrapper = mount(JobInformation, { propsData, Loading client/src/components/JobInformation/JobInformation.vue +9 −15 Original line number Diff line number Diff line <template> <div> <job-details-provider auto-refresh :jobId="job_id" :stdout_position=stdout_position :stdout_length=stdout_length @update:result="updateJob" /> <job-details-provider auto-refresh :jobId="job_id" :stdout_position=stdout_position :stdout_length=stdout_length :stderr_position=stderr_position :stderr_length=stderr_length @update:result="updateJob"/> <h2 class="h-md">Job Information</h2> <table id="job-information" class="tabletip info_data_table"> <tbody> Loading Loading @@ -42,7 +42,7 @@ </tr> <code-row v-if="job" id="command-line" :code-label="'Command Line'" :code-item="job.command_line" /> <code-row v-if="job" id="stdout" :code-label="'Tool Standard Output'" :code-item="stdout_text" /> <code-row v-if="job" id="stderr" :code-label="'Tool Standard Error'" :code-item="job.tool_stderr" /> <code-row v-if="job" id="stderr" :code-label="'Tool Standard Error'" :code-item="stderr_text" /> <code-row v-if="job && job.traceback" id="traceback" Loading Loading @@ -110,6 +110,9 @@ export default { stdout_position: 0, stdout_length: 50000, stdout_text: "", stderr_position: 0, stderr_length: 50000, stderr_text: "", }; }, computed: { Loading @@ -122,19 +125,6 @@ export default { return this.job && !JOB_STATES_MODEL.NON_TERMINAL_STATES.includes(this.job.state); }, }, updated() { try { const stdout_block = document.querySelector("#stdout").querySelector(".code"); // if user is scrolled above the bottom of the code element, then no need to update the stdout if (stdout_block.scrollTop <= stdout_block.scrollHeight - 3000) { this.stdout_length = 0; } else { this.stdout_length = 50000; } } catch(exception) { console.log(exception); } }, methods: { getAppRoot() { return getAppRoot(); Loading @@ -146,6 +136,10 @@ export default { this.stdout_text += job.tool_stdout; this.stdout_position += job.tool_stdout.length; } if (job.tool_stderr != null) { this.stderr_text += job.tool_stderr; this.stderr_position += job.tool_stderr.length; } }, }, }; Loading client/src/components/providers/JobProvider.js +2 −2 Original line number Diff line number Diff line Loading @@ -5,8 +5,8 @@ import { rethrowSimple } from "utils/simple-error"; import { stateIsTerminal } from "./utils"; import { cleanPaginationParameters } from "./utils"; async function jobDetails({ jobId, stdout_position = 0, stdout_length = 0 }) { const url = `${getAppRoot()}api/jobs/${jobId}?full=True&stdout_position=${stdout_position}&stdout_length=${stdout_length}`; async function jobDetails({ jobId, stdout_position = 0, stdout_length = 0, stderr_position = 0, stderr_length = 0 }) { const url = `${getAppRoot()}api/jobs/${jobId}?full=True&stdout_position=${stdout_position}&stdout_length=${stdout_length}&stderr_position=${stderr_position}&stderr_length=${stderr_length}`; try { const { data } = await axios.get(url); return data; Loading lib/galaxy/jobs/runners/pulsar.py +14 −9 Original line number Diff line number Diff line Loading @@ -657,14 +657,19 @@ class PulsarJobRunner(AsynchronousJobRunner): run_results = client.full_status() remote_metadata_directory = run_results.get("metadata_directory", None) tool_stdout = run_results.get("stdout", "") if tool_stdout is None: tool_stderr = run_results.get("stderr", "") for file in ("tool_stdout", "tool_stderr"): if tool_stdout and tool_stderr: pass try: stdout_path = Path(job_wrapper.working_directory) / "outputs" / "tool_stdout" stdout_file = open(stdout_path, "r") tool_stdout = stdout_file.read() file_path = Path(job_wrapper.working_directory) / "outputs" / file file_content = open(file_path, "r") if tool_stdout is None and file == "tool_stdout": tool_stdout = file_content.read() elif tool_stderr is None and file == "tool_stderr": tool_stderr = file_content.read() except Exception: pass tool_stderr = run_results.get("stderr", "") job_stdout = run_results.get("job_stdout") job_stderr = run_results.get("job_stderr") exit_code = run_results.get("returncode") Loading Loading
client/src/components/JobInformation/CodeRow.vue +13 −18 Original line number Diff line number Diff line <template> <tr v-b-tooltip.hover :title="`click to ${action}`" @mousedown="mouseIsDown = true" @mousemove="mouseIsDown ? (mouseMoved = true) : (mouseMoved = false)" @mouseup="toggleExpanded()"> <tr> <td> {{ codeLabel }} </td> Loading @@ -13,7 +8,10 @@ <b-col cols="11"> <pre :class="codeClass">{{ codeItem }}</pre> </b-col> <b-col class="nopadding pointer"> <b-col class="nopadding pointer" v-b-tooltip.hover :title="`click to ${action}`" @mouseup="toggleExpanded()"> <font-awesome-icon :icon="iconClass" /> </b-col> </b-row> Loading @@ -37,10 +35,8 @@ export default { }, data() { return { mouseIsDown: false, mouseMoved: false, expanded: false, lastHeight: 0, lastPos: 0, }; }, computed: { Loading @@ -55,21 +51,20 @@ export default { }, }, updated() { // If the user is at the bottom of the code div, auto scroll for them. try { var codeDiv = document.querySelector("#stdout").querySelector(".code"); if (codeDiv.scrollTop >= this.lastHeight - 3000) { var codeDiv = this.$el.querySelector(".code"); if (codeDiv.scrollTop + codeDiv.offsetHeight >= this.lastPos - 5) { // scroll is at the bottom codeDiv.scrollTop = codeDiv.scrollHeight; } this.lastHeight = codeDiv.scrollHeight; this.lastPos = codeDiv.scrollHeight; } catch(exception) { console.log("Code div is not present"); console.debug("Code div is not present"); } }, methods: { toggleExpanded() { this.mouseIsDown = false; if (this.codeItem && !this.mouseMoved) { if (this.codeItem) { this.expanded = !this.expanded; } }, Loading
client/src/components/JobInformation/JobInformation.test.js +4 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ describe("JobInformation/JobInformation.vue", () => { beforeEach(() => { axiosMock = new MockAdapter(axios); axiosMock.onGet(new RegExp(`api/configuration/decode/*`)).reply(200, { decoded_id: 123 }); axiosMock.onGet("/api/jobs/test_id?full=True&stdout_position=0&stdout_length=50000").reply(200, jobResponse); axiosMock.onGet("/api/jobs/test_id?full=True&stdout_position=0&stdout_length=50000&stderr_position=0&stderr_length=50000").reply(200, jobResponse); }); afterEach(() => { Loading @@ -48,6 +48,9 @@ describe("JobInformation/JobInformation.vue", () => { stdout_position: STDOUT_POSITION, stdout_length: STDOUT_LENGTH, stdout_text: STDOUT_TEXT, stderr_position: STDOUT_POSITION, stderr_length: STDOUT_LENGTH, stderr_text: STDOUT_TEXT, }; wrapper = mount(JobInformation, { propsData, Loading
client/src/components/JobInformation/JobInformation.vue +9 −15 Original line number Diff line number Diff line <template> <div> <job-details-provider auto-refresh :jobId="job_id" :stdout_position=stdout_position :stdout_length=stdout_length @update:result="updateJob" /> <job-details-provider auto-refresh :jobId="job_id" :stdout_position=stdout_position :stdout_length=stdout_length :stderr_position=stderr_position :stderr_length=stderr_length @update:result="updateJob"/> <h2 class="h-md">Job Information</h2> <table id="job-information" class="tabletip info_data_table"> <tbody> Loading Loading @@ -42,7 +42,7 @@ </tr> <code-row v-if="job" id="command-line" :code-label="'Command Line'" :code-item="job.command_line" /> <code-row v-if="job" id="stdout" :code-label="'Tool Standard Output'" :code-item="stdout_text" /> <code-row v-if="job" id="stderr" :code-label="'Tool Standard Error'" :code-item="job.tool_stderr" /> <code-row v-if="job" id="stderr" :code-label="'Tool Standard Error'" :code-item="stderr_text" /> <code-row v-if="job && job.traceback" id="traceback" Loading Loading @@ -110,6 +110,9 @@ export default { stdout_position: 0, stdout_length: 50000, stdout_text: "", stderr_position: 0, stderr_length: 50000, stderr_text: "", }; }, computed: { Loading @@ -122,19 +125,6 @@ export default { return this.job && !JOB_STATES_MODEL.NON_TERMINAL_STATES.includes(this.job.state); }, }, updated() { try { const stdout_block = document.querySelector("#stdout").querySelector(".code"); // if user is scrolled above the bottom of the code element, then no need to update the stdout if (stdout_block.scrollTop <= stdout_block.scrollHeight - 3000) { this.stdout_length = 0; } else { this.stdout_length = 50000; } } catch(exception) { console.log(exception); } }, methods: { getAppRoot() { return getAppRoot(); Loading @@ -146,6 +136,10 @@ export default { this.stdout_text += job.tool_stdout; this.stdout_position += job.tool_stdout.length; } if (job.tool_stderr != null) { this.stderr_text += job.tool_stderr; this.stderr_position += job.tool_stderr.length; } }, }, }; Loading
client/src/components/providers/JobProvider.js +2 −2 Original line number Diff line number Diff line Loading @@ -5,8 +5,8 @@ import { rethrowSimple } from "utils/simple-error"; import { stateIsTerminal } from "./utils"; import { cleanPaginationParameters } from "./utils"; async function jobDetails({ jobId, stdout_position = 0, stdout_length = 0 }) { const url = `${getAppRoot()}api/jobs/${jobId}?full=True&stdout_position=${stdout_position}&stdout_length=${stdout_length}`; async function jobDetails({ jobId, stdout_position = 0, stdout_length = 0, stderr_position = 0, stderr_length = 0 }) { const url = `${getAppRoot()}api/jobs/${jobId}?full=True&stdout_position=${stdout_position}&stdout_length=${stdout_length}&stderr_position=${stderr_position}&stderr_length=${stderr_length}`; try { const { data } = await axios.get(url); return data; Loading
lib/galaxy/jobs/runners/pulsar.py +14 −9 Original line number Diff line number Diff line Loading @@ -657,14 +657,19 @@ class PulsarJobRunner(AsynchronousJobRunner): run_results = client.full_status() remote_metadata_directory = run_results.get("metadata_directory", None) tool_stdout = run_results.get("stdout", "") if tool_stdout is None: tool_stderr = run_results.get("stderr", "") for file in ("tool_stdout", "tool_stderr"): if tool_stdout and tool_stderr: pass try: stdout_path = Path(job_wrapper.working_directory) / "outputs" / "tool_stdout" stdout_file = open(stdout_path, "r") tool_stdout = stdout_file.read() file_path = Path(job_wrapper.working_directory) / "outputs" / file file_content = open(file_path, "r") if tool_stdout is None and file == "tool_stdout": tool_stdout = file_content.read() elif tool_stderr is None and file == "tool_stderr": tool_stderr = file_content.read() except Exception: pass tool_stderr = run_results.get("stderr", "") job_stdout = run_results.get("job_stdout") job_stderr = run_results.get("job_stderr") exit_code = run_results.get("returncode") Loading