Feature #3980
closed[SDKs] CLI tool to view real time logs from running jobs/pipelines, much like the Log tab of the Workbench PipelineInstance#show page
Description
It would be nice to have a command line tool that was able to receive log information from currently running jobs so that it could be monitored from the command line rather than going through the 'Log' page in workbench.
This should look just like crunch-job
in local mode, or the Log tab of a running job in Workbench: no json formatting, etc., just the text.
For pipeline instances, this should be implemented as arv-run-pipeline-instance --log-only --instance {uuid}
because a-r-p-i
will need to make use of websockets soon enough anyway (but combining --log
with --run-*-here
is a different story, #4503).
Something like this should make it easy to share code between --log-only
and the "don't poll" part of #4503:
def each_pipeline_state_change(my_instance_uuid)
# yield when pipeline changes state. return when pipeline has finished
subscribe_to_websocket my_instance_uuid
listen_to_websocket do |msg|
if {msg is a pipelineInstance update event with uuid==my_instance_uuid}
if {new instance has different job uuids, job states, etc. than last time}
subscribe_to_websocket {any new job uuids that have appeared}
yield new_instance_properties
end
if {pipeline is not running}
return
end
elsif {logging mode is enabled} and {msg is a stderr event for a job in this instance}
print msg.properties.text
end
end
end
For the case of a single job, this could just as well be a standalone ruby program.
arv tail {uuid}
should cause arv
to invoke the appropriate program, depending on whether {uuid}
is a pipeline_instance or a job uuid.
Updated by Tom Clegg about 10 years ago
- Subject changed from CLI tool to view real time logs from running jobs/pipelines to [SDKs] CLI tool to view real time logs from running jobs/pipelines, much like the Log tab of the Workbench PipelineInstance#show page
- Story points set to 1.0
Updated by Tom Clegg about 10 years ago
- Target version set to Arvados Future Sprints
Updated by Tom Clegg about 10 years ago
- Description updated (diff)
- Category set to SDKs
Updated by Brett Smith about 9 years ago
Note that the functionality was done in #3603 (invoked as arv ws --pipeline
or arv ws --job
), but I'll leave this open for now since it covers some interface improvements.
Updated by Ward Vandewege over 3 years ago
- Target version deleted (
Arvados Future Sprints)