mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-07-11 05:47:22 +02:00
Merge pull request #96 from alicevision/dev_submitterConfig
[submitters] simpleFarm: use a config file for serviceKeys
This commit is contained in:
commit
d6ab36c60b
4 changed files with 88 additions and 9 deletions
43
meshroom/nodes/aliceVision/MeshFiltering.py
Normal file
43
meshroom/nodes/aliceVision/MeshFiltering.py
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
import sys
|
||||||
|
from meshroom.core import desc
|
||||||
|
|
||||||
|
|
||||||
|
class MeshFiltering(desc.CommandLineNode):
|
||||||
|
internalFolder = '{cache}/{nodeType}/{uid0}/'
|
||||||
|
commandLine = 'aliceVision_meshFiltering {allParams}'
|
||||||
|
|
||||||
|
inputs = [
|
||||||
|
desc.File(
|
||||||
|
name='input',
|
||||||
|
label='Input',
|
||||||
|
description='''Input Mesh (OBJ file format).''',
|
||||||
|
value='',
|
||||||
|
uid=[0],
|
||||||
|
),
|
||||||
|
desc.IntParam(
|
||||||
|
name='iterations',
|
||||||
|
label='Nb Iterations',
|
||||||
|
description='',
|
||||||
|
value=10,
|
||||||
|
range=(0, 50, 1),
|
||||||
|
uid=[0],
|
||||||
|
),
|
||||||
|
desc.FloatParam(
|
||||||
|
name='lambda',
|
||||||
|
label='Lambda',
|
||||||
|
description='',
|
||||||
|
value=1.0,
|
||||||
|
range=(0.0, 10.0, 0.1),
|
||||||
|
uid=[0],
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
||||||
|
outputs = [
|
||||||
|
desc.File(
|
||||||
|
name='output',
|
||||||
|
label='Output',
|
||||||
|
description='''Output mesh (OBJ file format).''',
|
||||||
|
value='{cache}/{nodeType}/{uid0}/mesh.obj',
|
||||||
|
uid=[],
|
||||||
|
),
|
||||||
|
]
|
|
@ -40,6 +40,22 @@ class Meshing(desc.CommandLineNode):
|
||||||
exclusive=True,
|
exclusive=True,
|
||||||
uid=[0],
|
uid=[0],
|
||||||
),
|
),
|
||||||
|
desc.IntParam(
|
||||||
|
name='smoothingIteration',
|
||||||
|
label='Smoothing Iteration',
|
||||||
|
description='Number of Smoothing Iterations',
|
||||||
|
value=10,
|
||||||
|
range=(0, 50, 1),
|
||||||
|
uid=[0],
|
||||||
|
),
|
||||||
|
desc.FloatParam(
|
||||||
|
name='smoothingWeight',
|
||||||
|
label='Smoothing Weight',
|
||||||
|
description='Smoothing Weight',
|
||||||
|
value=1.0,
|
||||||
|
range=(0, 2, 1),
|
||||||
|
uid=[0],
|
||||||
|
),
|
||||||
desc.File(
|
desc.File(
|
||||||
name="depthMapFolder",
|
name="depthMapFolder",
|
||||||
label='Depth Maps Folder',
|
label='Depth Maps Folder',
|
||||||
|
|
18
meshroom/submitters/simpleFarmConfig.json
Normal file
18
meshroom/submitters/simpleFarmConfig.json
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"BASE": ["mikrosRender", "!RenderLow", "!Wkst_OS", "!\"vfxpc1*\"", "!\"vfxpc??\""],
|
||||||
|
"CPU": {
|
||||||
|
"NONE": [],
|
||||||
|
"NORMAL": [],
|
||||||
|
"INTENSIVE": ["\"RenderHigh*\"", "@.nCPUs>20"]
|
||||||
|
},
|
||||||
|
"RAM": {
|
||||||
|
"NONE": [],
|
||||||
|
"NORMAL": ["@.mem>8"],
|
||||||
|
"INTENSIVE": ["@.mem>30"]
|
||||||
|
},
|
||||||
|
"GPU": {
|
||||||
|
"NONE": [],
|
||||||
|
"NORMAL": ["!\"*loc*\"", "Wkst"],
|
||||||
|
"INTENSIVE": ["!\"*loc*\"", "Wkst"]
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,16 +2,21 @@
|
||||||
# coding:utf-8
|
# coding:utf-8
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import json
|
||||||
|
|
||||||
import simpleFarm
|
import simpleFarm
|
||||||
from meshroom.core.desc import Level
|
from meshroom.core.desc import Level
|
||||||
from meshroom.core.submitter import BaseSubmitter
|
from meshroom.core.submitter import BaseSubmitter
|
||||||
|
|
||||||
|
currentDir = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
|
||||||
|
|
||||||
class SimpleFarmSubmitter(BaseSubmitter):
|
class SimpleFarmSubmitter(BaseSubmitter):
|
||||||
MESHROOM_PACKAGE = os.environ.get('REZ_USED_REQUEST', '')
|
MESHROOM_PACKAGE = os.environ.get('REZ_USED_REQUEST', '')
|
||||||
|
|
||||||
BASE_REQUIREMENTS = ['mikrosRender', '!RenderLow', '!Wkst_OS', '!"vfxpc1*"', '!"vfxpc??"']
|
filepath = os.environ.get('SIMPLEFARMCONFIG', os.path.join(currentDir, 'simpleFarmConfig.json'))
|
||||||
|
config = json.load(open(filepath))
|
||||||
|
|
||||||
ENGINE = ''
|
ENGINE = ''
|
||||||
DEFAULT_TAGS = {'prod': ''}
|
DEFAULT_TAGS = {'prod': ''}
|
||||||
|
|
||||||
|
@ -34,13 +39,10 @@ class SimpleFarmSubmitter(BaseSubmitter):
|
||||||
|
|
||||||
tags['nbFrames'] = nbFrames
|
tags['nbFrames'] = nbFrames
|
||||||
tags['prod'] = self.prod
|
tags['prod'] = self.prod
|
||||||
allRequirements = list(self.BASE_REQUIREMENTS)
|
allRequirements = self.config.get('BASE', [])
|
||||||
if node.nodeDesc.cpu == Level.INTENSIVE:
|
allRequirements.extend(self.config['CPU'].get(node.nodeDesc.cpu.name, []))
|
||||||
allRequirements.extend(['"RenderHigh*"', '@.nCPUs>20'])
|
allRequirements.extend(self.config['RAM'].get(node.nodeDesc.ram.name, []))
|
||||||
if node.nodeDesc.gpu != Level.NONE:
|
allRequirements.extend(self.config['GPU'].get(node.nodeDesc.gpu.name, []))
|
||||||
allRequirements.extend(['!"*loc*"', 'Wkst'])
|
|
||||||
if node.nodeDesc.ram == Level.INTENSIVE:
|
|
||||||
allRequirements.append('@.mem>30')
|
|
||||||
|
|
||||||
task = simpleFarm.Task(
|
task = simpleFarm.Task(
|
||||||
name=node.nodeType,
|
name=node.nodeType,
|
||||||
|
@ -48,7 +50,7 @@ class SimpleFarmSubmitter(BaseSubmitter):
|
||||||
nodeName=node.name, meshroomFile=meshroomFile, parallelArgs=parallelArgs),
|
nodeName=node.name, meshroomFile=meshroomFile, parallelArgs=parallelArgs),
|
||||||
tags=tags,
|
tags=tags,
|
||||||
rezPackages=[self.MESHROOM_PACKAGE],
|
rezPackages=[self.MESHROOM_PACKAGE],
|
||||||
requirements={'service': ','.join(allRequirements)},
|
requirements={'service': str(','.join(allRequirements))},
|
||||||
**arguments)
|
**arguments)
|
||||||
return task
|
return task
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue