Commit fe53c53f authored by Milan Jaros's avatar Milan Jaros
Browse files

update v3.4, remove raas_server

parent 728bee9c
......@@ -26,13 +26,19 @@ Cluster_items = [
]
JobQueueBarbora_items = [
("ORIGCPU", "Blender3.0 CPU", ""),
("ORIGCUDA", "Blender3.0 CUDA", ""),
("ORIGCPU", "Blender2.93 CPU", ""),
("ORIGCUDA", "Blender2.93 CUDA", ""),
("ORIGCPU3", "Blender3.0 CPU", ""),
("ORIGCUDA3", "Blender3.0 CUDA", ""),
]
JobQueueKarolina_items = [
("ORIGCPU", "Blender3.0 CPU", ""),
("ORIGCUDA", "Blender3.0 CUDA", ""),
("ORIGCPU", "Blender2.93 CPU", ""),
("ORIGCUDA", "Blender2.93 CUDA", ""),
("ORIGCPU3", "Blender3.0 CPU", ""),
("ORIGCUDA3", "Blender3.0 CUDA", ""),
]
from . import raas_jobs
......@@ -50,54 +56,83 @@ async def CreateJob(context, token):
if blender_job_info_new.job_queue_barbora == 'ORIGCUDA':
await raas_jobs.CreateJobSimple(context, token, 24, 12, 12, 1, 1)
if blender_job_info_new.job_queue_barbora == 'ORIGCPU3':
await raas_jobs.CreateJobSimple(context, token, 36, 11, 14, 1, 1)
if blender_job_info_new.job_queue_barbora == 'ORIGCUDA3':
await raas_jobs.CreateJobSimple(context, token, 24, 12, 15, 1, 1)
if blender_job_info_new.cluster_type == 'KAROLINA':
if blender_job_info_new.job_queue_karolina == 'ORIGCPU':
await raas_jobs.CreateJobSimple(context, token, 128, 21, 21, 2, 2)
if blender_job_info_new.job_queue_karolina == 'ORIGCUDA':
await raas_jobs.CreateJobSimple(context, token, 128, 22, 22, 2, 2)
await raas_jobs.CreateJobSimple(context, token, 128, 22, 22, 2, 2)
if blender_job_info_new.job_queue_karolina == 'ORIGCPU3':
await raas_jobs.CreateJobSimple(context, token, 128, 21, 24, 2, 2)
if blender_job_info_new.job_queue_karolina == 'ORIGCUDA3':
await raas_jobs.CreateJobSimple(context, token, 128, 22, 25, 2, 2)
##################################################################
def GetHEAPPEServer(pid):
return "https://heappeinfra1.it4i.cz/raas-" + pid + '/heappe/'
##################################################################
def GetDAServer(context):
blender_job_info_new = context.scene.raas_blender_job_info_new
if blender_job_info_new.cluster_type == 'BARBORA':
return 'login1.barbora.it4i.cz'
return 'barbora.it4i.cz'
if blender_job_info_new.cluster_type == 'KAROLINA':
return 'login1.karolina.it4i.cz'
return 'karolina.it4i.cz'
def GetDAClusterPath(context):
def GetDAClusterPath(context, pid):
blender_job_info_new = context.scene.raas_blender_job_info_new
if blender_job_info_new.cluster_type == 'BARBORA':
return '/mnt/proj3/open-18-15/heappe/direct'
return '/mnt/proj2/' + pid + '/heappe/direct'
if blender_job_info_new.cluster_type == 'KAROLINA':
return '/mnt/proj3/open-18-15/heappe/direct'
return '/mnt/proj2/' + pid + '/heappe/direct'
def GetDAOpenCallProject():
return 'OPEN-18-15'
def GetDAOpenCallProject(pid):
return pid
# return cores,queue,script
def GetDAQueueScript(ClusterId, ClusterNodeTypeId, CommandTemplateId):
def GetDAQueueScript(ClusterId, ClusterNodeTypeId, CommandTemplateId, pid):
# BARBORA
if ClusterId == 1:
# ORIGCPU
if CommandTemplateId == 11:
return 36,'qprod','/mnt/proj3/open-18-15/bheappe/run_blender_cpu.sh'
return 36,'qprod','/mnt/proj2/' + pid + '/bheappe/run_blender_cpu.sh'
# ORIGCUDA
if CommandTemplateId == 12:
return 24,'qnvidia','/mnt/proj3/open-18-15/bheappe/run_blender_gpu.sh'
return 24,'qnvidia','/mnt/proj2/' + pid + '/bheappe/run_blender_gpu.sh'
# ORIGCPU3
if CommandTemplateId == 14:
return 36,'qprod','/mnt/proj2/' + pid + '/bheappe/run_blender3_cpu.sh'
# ORIGCUDA3
if CommandTemplateId == 15:
return 24,'qnvidia','/mnt/proj2/' + pid + '/bheappe/run_blender3_gpu.sh'
# KAROLINA
if ClusterId == 2:
# ORIGCPU
if CommandTemplateId == 21:
return 128,'qprod','/mnt/proj3/open-18-15/bheappe/run_blender_cpu.sh'
return 128,'qprod','/mnt/proj2/' + pid + '/bheappe/run_blender_cpu.sh'
# ORIGCUDA
if CommandTemplateId == 22:
return 128,'qnvidia','/mnt/proj3/open-18-15/bheappe/run_blender_gpu.sh'
return 128,'qnvidia','/mnt/proj2/' + pid + '/bheappe/run_blender_gpu.sh'
# ORIGCPU3
if CommandTemplateId == 24:
return 128,'qprod','/mnt/proj2/' + pid + '/bheappe/run_blender3_cpu.sh'
# ORIGCUDA3
if CommandTemplateId == 25:
return 128,'qnvidia','/mnt/proj2/' + pid + '/bheappe/run_blender3_gpu.sh'
return None,None,None
\ No newline at end of file
......@@ -361,7 +361,7 @@ def CmdCreatePBSJob(context):
for task in tasks:
cluster_node_type_id = task['ClusterNodeTypeId']
command_template_id = task['CommandTemplateId']
cores,queue,script = raas_config.GetDAQueueScript(cluster_id, cluster_node_type_id, command_template_id)
cores,queue,script = raas_config.GetDAQueueScript(cluster_id, cluster_node_type_id, command_template_id, raas_pref.preferences().raas_pid.lower())
file = task['TemplateParameterValues'][0]['ParameterValue']
ncpus = int(cores)
......@@ -394,7 +394,7 @@ def CmdCreatePBSJob(context):
if 'DependsOn' in task:
depends_on = ' -W depend=afterok:$_' + str(task_id - 1)
cmd = cmd + '_' + str(task_id) + '=$(echo \' ' + script + ' ' + file + ' \' | qsub -P \"' + job_project + '\" -A ' + raas_config.GetDAOpenCallProject() + ' -v ' + job_env + ' -l select=' + str(nodes) + ':ncpus=' + str(ncpus) + ' -N \"' + job_project + '\" -l walltime=' + walltime + ' -e ' + work_dir_stderr + ' -o ' + work_dir_stdout + ' -q ' + queue + job_array + depends_on + ');echo $_' + str(task_id) + ';'
cmd = cmd + '_' + str(task_id) + '=$(echo \' ' + script + ' ' + file + ' \' | qsub -P \"' + job_project + '\" -A ' + raas_config.GetDAOpenCallProject(raas_pref.preferences().raas_pid.upper()) + ' -v ' + job_env + ' -l select=' + str(nodes) + ':ncpus=' + str(ncpus) + ' -N \"' + job_project + '\" -l walltime=' + walltime + ' -e ' + work_dir_stderr + ' -o ' + work_dir_stdout + ' -q ' + queue + job_array + depends_on + ');echo $_' + str(task_id) + ';'
task_id = task_id + 1
......
......@@ -185,10 +185,10 @@ class RaasPreferences(AddonPreferences):
options={'HIDDEN', 'SKIP_SAVE'}
)
raas_server: StringProperty(
name='RaaS Server',
default='https://heappeinfra1.it4i.cz/raas-open-XX-XX'
)
# raas_server: StringProperty(
# name='RaaS Server',
# default=''
# )
raas_username: StringProperty(
name='Username',
......@@ -201,6 +201,11 @@ class RaasPreferences(AddonPreferences):
subtype='PASSWORD'
)
raas_pid: StringProperty(
name='PID',
default=''
)
raas_job_storage_path: StringProperty(
name='Job Storage Path',
description='Path where to store job files, should be accesible for Workers too',
......@@ -254,6 +259,11 @@ class RaasPreferences(AddonPreferences):
box = layout.box()
raas_pid = box.split(**factor(0.25), align=True)
raas_pid.label(text='PID:')
pid_box = raas_pid.row(align=True)
pid_box.prop(self, 'raas_pid', text='')
if self.raas_use_direct_access == True:
self.raas_use_paramiko = True
auth_split = box.split(**factor(0.25), align=True)
......@@ -272,10 +282,10 @@ class RaasPreferences(AddonPreferences):
user_box.prop(self, 'raas_da_password', text='')
else:
raas_server = box.split(**factor(0.25), align=True)
raas_server.label(text='Server:')
user_box = raas_server.row(align=True)
user_box.prop(self, 'raas_server', text='')
# raas_server = box.split(**factor(0.25), align=True)
# raas_server.label(text='Server:')
# user_box = raas_server.row(align=True)
# user_box.prop(self, 'raas_server', text='')
auth_split = box.split(**factor(0.25), align=True)
auth_split.label(text='Username:')
......@@ -296,7 +306,7 @@ class RaasPreferences(AddonPreferences):
if self.ok_message:
sub = layout.row()
sub.label(text=self.ok_message, icon='FILE_TICK')
sub.label(text=self.ok_message, icon='FILE_TICK')
box = layout.box()
......
......@@ -118,7 +118,7 @@ def get_direct_access_remote_storage(context):
if len(project_group) == 0:
project_group = pref.raas_da_username
return raas_config.GetDAClusterPath(context) + '/' + project_group
return raas_config.GetDAClusterPath(context, pref.raas_pid.lower()) + '/' + project_group
################################
......
......@@ -38,10 +38,11 @@ def get_endpoint(endpoint_path=None):
"""
#import os
from . import raas_pref
from . import raas_config
import urllib.parse
import functools
base_url = raas_pref.preferences().raas_server + '/heappe/'
base_url = raas_config.GetHEAPPEServer(raas_pref.preferences().raas_pid.lower())
# urljoin() is None-safe for the 2nd parameter.
return urllib.parse.urljoin(base_url, endpoint_path)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment