Skip to content

Commit

Permalink
Check Setup: Also pull the sing.log
Browse files Browse the repository at this point in the history
  • Loading branch information
TorecLuik committed May 22, 2024
1 parent 941b094 commit c8241d6
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions init/SLURM_check_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import omero
import omero.gateway
from omero import scripts
from omero.rtypes import rstring
from omero.rtypes import rstring, wrap
from biomero import SlurmClient
import logging
import os
Expand Down Expand Up @@ -60,11 +60,24 @@ def runScript():
else:
pending[model].append(version)

message += f"\n>> Available Models: {models}"
message += f"\n>>> Pending Models: {pending}"
message += f"\n>> Available Data: {data}"
message += f"\n>> Available Models: {models}."
message += f"\n>>> Pending Models: {pending}."
message += f"\n>> Available Data: {data}."
logger.info(message)
# TODO get sing.log too
# misuse get_logfile to get this sing.log
tup = slurmClient.get_logfile_from_slurm(slurm_job_id='',
logfile=f"{slurmClient.slurm_images_path}/sing.log")
(dir, export_file, result) = tup
# little script hack here so we don't have to adjust the client
export_file = os.path.join(dir, "sing.log")
logger.debug(f"Pulled logfile {result.__dict__}")
# Upload logfile to Omero as Original File
mimetype = 'text/plain'
obj = client.upload(export_file, type=mimetype)
obj_id = obj.id.val
url = f"get_original_file/{obj_id}/"
client.setOutput("URL", wrap({"type": "URL", "href": url}))
message += f"\n>>Also pulled the singularity log, click the URL button above to view ({url})"

client.setOutput("Message", rstring(str(message)))

Expand Down

0 comments on commit c8241d6

Please sign in to comment.