Skip to content
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
4 changes: 4 additions & 0 deletions configs/jureptool/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ timezone: 'Europe/Berlin'
# Substitutions can be used with keys given in #(...)#. Inside it:
# - replace can be done with: [string_from,string_to]
# - removals can be done with: (string_to_remove)
# if only jureptool is used and not juri, keep this settings empty
hostname: 'https://llview.fz-juelich.de/#system(-dc)[ ,_]#'
# at the bottom of the generated html page, there will be a logo to llview that
# links to juri, if there is no juri (hostname = ''), put this link instead
standalone_link: 'https://apps.fz-juelich.de/jsc/llview/docu/install/server_install/#jureptool'

# JURI uses Jureptool to create html and pdf reports
# Jureptool relies on plotly and jquery to build the html pages
Expand Down
7 changes: 6 additions & 1 deletion jureptool/src/GenerateHTML.py
Original file line number Diff line number Diff line change
Expand Up @@ -1324,6 +1324,11 @@ def CreateFirstTables(data,config,num_cpus,num_gpus,gpus,ierr):
</div>
"""

if config['appearance'].get('hostname'):
hostname_link = f"{replace_vars(config['appearance']['hostname'], data['job'])}/login.php"
else:
hostname_link = config['appearance'].get('standalone_link')

navbar = f"""
<div id="navbar" class="no-print">
<table style="border: 0px solid black; width: 100%;">
Expand Down Expand Up @@ -1361,7 +1366,7 @@ def CreateFirstTables(data,config,num_cpus,num_gpus,gpus,ierr):
<td style="text-align: center;">{"#GPUs: <b>"+str(data['job']['numgpus'])+"</b>" if gpus else ""}</td>
<td style="text-align: center;">Last Update: <b>{data['job']['updatetime']}</b></td>
<td rowspan="2" style="width:6%; padding: 0px; vertical-align:middle;">
<a href="{replace_vars(config['appearance']['hostname'],data['job'])}/login.php" class="simple">
<a href="{hostname_link}" class="simple">
<div style="position: relative;">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 940 555" height="40px" style="fill-rule:evenodd;" xmlns:xlink="http://www.w3.org/1999/xlink">
<g><path style="opacity:0.991" fill="#163b67" d="M 20.5,14.5 C 39.8333,14.5 59.1667,14.5 78.5,14.5C 78.5,140.833 78.5,267.167 78.5,393.5C 90.8333,393.5 103.167,393.5 115.5,393.5C 115.5,297.167 115.5,200.833 115.5,104.5C 134.833,104.5 154.167,104.5 173.5,104.5C 173.5,200.833 173.5,297.167 173.5,393.5C 212.167,393.5 250.833,393.5 289.5,393.5C 289.5,410.833 289.5,428.167 289.5,445.5C 250.833,445.5 212.167,445.5 173.5,445.5C 173.5,457.833 173.5,470.167 173.5,482.5C 243.833,482.5 314.167,482.5 384.5,482.5C 384.5,500.167 384.5,517.833 384.5,535.5C 294.833,535.5 205.167,535.5 115.5,535.5C 115.5,505.5 115.5,475.5 115.5,445.5C 83.5,445.5 51.5,445.5 19.5,445.5C 19.1684,301.763 19.5017,158.097 20.5,14.5 Z"/></g>
Expand Down
12 changes: 9 additions & 3 deletions jureptool/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1022,9 +1022,11 @@ def main():
mp.set_start_method('forkserver')
global nerrors
nerrors = 0

default_config_folder = os.path.dirname(os.path.realpath(__file__))+"/../../configs/jureptool"
# Parse arguments
parser = argparse.ArgumentParser(description="JuRepTool")
parser = argparse.ArgumentParser( description="JuRepTool : Detailed Job Report Generation Script",
epilog="Example: main.py --configfolder <config_folder> <file_or_folder_json> \n")

parser.add_argument("file", nargs="+", default="", help="File including list of running and recently-finished jobs or JSON file of a job")
parser.add_argument("--daemon", default=False, action="store_true" , help="Run as a 'daemon', i.e., in an infinite loop")
parser.add_argument("--demo", default=False, action="store_true" , help="Run in 'demo' mode (hide usernames, project id and job names)")
Expand All @@ -1038,12 +1040,16 @@ def main():
parser.add_argument("--nprocs", default=4, type=int, help="Number of process to run in parallel (default: NPROCS=4)")
parser.add_argument("--loglevel", default=False, help="Select log level: 'DEBUG', 'INFO', 'WARNING', 'ERROR' (more to less verbose)")
parser.add_argument("--logprefix", help="Prefix for the daily log and errlog files (default: None)")
parser.add_argument("--configfolder", default=os.path.dirname(os.path.realpath(__file__))+"/../../configs/jureptool", help="Folder with YAML configuration files (default: src/../../configs/jureptool)")
parser.add_argument("--configfolder", default=default_config_folder, help="Folder with YAML configuration files (default: src/../../configs/jureptool)")
parser.add_argument("--outfolder", default="./results", help="Folder to store temporary and demo PDFs")
parser.add_argument("--semail", default="", help="Sender email to use in case of errors (default: None)")
parser.add_argument("--remail", default="", help="Receiver email to use in case of errors (default: None)")
args = parser.parse_args()

if args.configfolder == default_config_folder:
print(f"Warning: No --configfolder provided, using default: {default_config_folder}")
print(" If this is not intended, please specify a config folder with --configfolder.")

# Parsing configuration
config = {}
# Report appearance
Expand Down