-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[core] Add support for dynamic chunks #2918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
f8df6d6
[core] Update submitter API
Alxiice 37c3fe8
[core] node/taskManager: create _chunksCreated to delay chunk creatio…
Alxiice 256c31c
[node] Add licenses list on node desc to provide a source where we ca…
Alxiice 72cc913
[core] computation : update computation levels
Alxiice 38ba5bf
[bin] Add createChunks script
Alxiice d0bd545
[submitter] Fix SubmitterOptionsEnum.ALL mode on py 3.9
Alxiice 1bdb0e9
[qml] Fix anchor issue when chunks are emptied
Alxiice 256c6dc
[core] Node : add defaultStatus in _createChunks
Alxiice 928f746
[core] Start updating taskmanager and submitter for new chunk process
Alxiice 877193b
[core] First implementation to kill submitted tasks
Alxiice 8cd9bd7
[core] graph : Manage nodeStatus file monitoring
Alxiice 038d555
[code] submitter : fix issues in dynamic chunks & submitting
Alxiice 9238e2a
[code] graph : Better management of statuses after task/job actions
Alxiice 100c54c
[core] Fix issues on missing chunks fro sfm node & node chunk indicator
Alxiice 5d84637
[core] submitter : retrieve job on node update + fix some ui issues
Alxiice 9e772c1
[chunks] Apply typos/cleaning suggestions from @cbentejac
Alxiice 24c912d
[submitter] Add tools to avoid autoretry on farm
Alxiice ae20f2a
[submitter] Fix interruptJob UI updates
Alxiice 60c0f81
[bin] Update permissions on `meshroom_createChunks`
cbentejac 121a086
[core] node: Correctly use custom size for non-parallelized nodes
cbentejac 57f1008
[bin] Fix typo: Replace occurrences of "infos" with "info"
cbentejac dd5a8b2
[core] Fix typo: Replace all occurrences of "infos" with "info"
cbentejac 8be3021
[core] Linting: Remove all trailing whitespaces
cbentejac f634d11
[core] node: Remove references to `packageVersion` in `NodeStatusData`
cbentejac 2e0fea6
[core] node: Remove static info from the chunks' status file
cbentejac 04a425d
Linting: Remove trailing whitespaces
cbentejac 44c8584
[core] node: Use explicit keys for chunks' blockSize, fullSize and nb…
cbentejac a69bdf0
[core] node: Detect whether external jobs can be stopped or canceled
cbentejac 6ae0216
[ui] Add `stoppable` state for the `Submit` button
cbentejac 45736d2
[ui] NodeActions: Add `Retry` button for submitted tasks on error state
cbentejac 18e0b07
[GraphEditor] NodeChunks: Remove specific color for dynamic chunks
cbentejac 848c91e
[ui] NodeActions: Fix status of `compute` and `submit` in `deletable`…
cbentejac 7070652
[GraphEditor] Add "Retry Error Tasks" menu to match NodeActions
cbentejac d80e5db
[GraphEditor] Add "Interrupt/Cancel Job" menus
cbentejac f328574
[GraphEditor] NodeChunks: Don't add specific display when there's no …
cbentejac 03bb620
[core] node: Add `chunkPlaceholder` property
cbentejac 1ba7776
[ui] Use chunk placeholder for uncreated dynamic chunks
cbentejac f2f9897
[core] graph: Trigger `onGraphUpdated` slot when chunks change
cbentejac fdee991
[ui] Application: Update state of the global "Submit" icon when needed
cbentejac 92b7794
[core] node: Correctly use `fullSize` instead of `nbChunks` to set ch…
cbentejac b8b6b42
Correct typos
Alxiice 602962c
[node] remove methods statusInThisSession & submitterStatusInThisSession
Alxiice def01dc
[graph] Fix a small issue in compareFilesTimes
Alxiice c91dd6b
[core] node: Reset chunks before updating the node's size
cbentejac 38211d6
`.git-blame-ignore-revs`: Add linting commits
cbentejac File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,145 @@ | ||
| #!/usr/bin/env python | ||
|
|
||
| """ | ||
| This is a script used to wrap the process of processing a node on the farm | ||
| It will handle chunk creation and create all the jobs for these chunks | ||
| If the submitter cannot create chunks, then it will process the chunks serially | ||
| in the current process | ||
| """ | ||
|
|
||
| import argparse | ||
| import logging | ||
| import os | ||
| import sys | ||
| try: | ||
| import meshroom | ||
| except Exception: | ||
| # If meshroom module is not in the PYTHONPATH, add our root using the relative path | ||
| import pathlib | ||
| meshroomRootFolder = pathlib.Path(__file__).parent.parent.resolve() | ||
| sys.path.append(meshroomRootFolder) | ||
| import meshroom | ||
| meshroom.setupEnvironment() | ||
|
|
||
| import meshroom.core | ||
| import meshroom.core.graph | ||
| from meshroom.core import submitters | ||
| from meshroom.core.submitter import SubmitterOptionsEnum | ||
| from meshroom.core.node import Status | ||
|
|
||
|
|
||
| parser = argparse.ArgumentParser(description='Execute a Graph of processes.') | ||
| parser.add_argument('graphFile', metavar='GRAPHFILE.mg', type=str, | ||
| help='Filepath to a graph file.') | ||
|
|
||
| parser.add_argument('--submitter', type=str, required=True, | ||
| help='Name of the submitter used to create the job.') | ||
| parser.add_argument('--node', metavar='NODE_NAME', type=str, required=True, | ||
| help='Process the node. It will generate an error if the dependencies are not already computed.') | ||
| parser.add_argument('--inCurrentEnv', help='Execute process in current env without creating a dedicated runtime environment.', | ||
| action='store_true') | ||
| parser.add_argument('--forceStatus', help='Force computation if status is RUNNING or SUBMITTED.', | ||
| action='store_true') | ||
| parser.add_argument('--forceCompute', help='Compute in all cases even if already computed.', | ||
| action='store_true') | ||
| parser.add_argument('--extern', help='Use this option when you compute externally after submission to a render farm from meshroom.', | ||
| action='store_true') | ||
| parser.add_argument('--cache', metavar='FOLDER', type=str, | ||
| default=None, | ||
| help='Override the cache folder') | ||
| parser.add_argument('-v', '--verbose', | ||
| help='Set the verbosity level for logging:\n' | ||
| ' - fatal: Show only critical errors.\n' | ||
| ' - error: Show errors only.\n' | ||
| ' - warning: Show warnings and errors.\n' | ||
| ' - info: Show standard informational messages.\n' | ||
| ' - debug: Show detailed debug information.\n' | ||
| ' - trace: Show all messages, including trace-level details.', | ||
| default=os.environ.get('MESHROOM_VERBOSE', 'info'), | ||
| choices=['fatal', 'error', 'warning', 'info', 'debug', 'trace']) | ||
|
|
||
| args = parser.parse_args() | ||
|
|
||
| # For extern computation, we want to focus on the node computation log. | ||
| # So, we avoid polluting the log with general warning about plugins, versions of nodes in file, etc. | ||
| logging.getLogger().setLevel(level=logging.INFO) | ||
|
|
||
| meshroom.core.initPlugins() | ||
| meshroom.core.initNodes() | ||
| meshroom.core.initSubmitters() # Required to spool child job | ||
|
|
||
| graph = meshroom.core.graph.loadGraph(args.graphFile) | ||
| if args.cache: | ||
| graph.cacheDir = args.cache | ||
| graph.update() | ||
|
|
||
| # Execute the node | ||
| node = graph.findNode(args.node) | ||
| submittedStatuses = [Status.RUNNING] | ||
|
|
||
| # Find submitter | ||
| submitter = None | ||
| # It's required if we want to spool chunks on different machines | ||
| for subName, sub in submitters.items(): | ||
| if args.submitter == subName: | ||
| submitter = sub | ||
| break | ||
|
|
||
| if node._nodeStatus.status in (Status.STOPPED, Status.KILLED): | ||
| logging.error("Node status is STOPPED or KILLED.") | ||
| if submitter: | ||
| submitter.killRunningJob() | ||
| sys.exit(meshroom.MeshroomExitStatus.ERROR_NO_RETRY) | ||
|
|
||
| if not node._chunksCreated: | ||
| # Create node chunks | ||
| # Once created we don't have to do it again even if we relaunch the job | ||
| node.createChunks() | ||
| # Set the chunks statuses | ||
| for chunk in node._chunks: | ||
| if args.forceCompute or chunk._status.status != Status.SUCCESS: | ||
| hasChunkToLaunch = True | ||
| chunk._status.setNode(node) | ||
| chunk._status.initExternSubmit() | ||
| chunk.upgradeStatusFile() | ||
|
|
||
| # Get chunks to process in the current process | ||
| chunksToProcess = [] | ||
| if submitter: | ||
| if not submitter._options.includes(SubmitterOptionsEnum.EDIT_TASKS): | ||
| chunksToProcess = node.chunks | ||
| else: | ||
| # Cannot retrieve job -> execute process serially | ||
| chunksToProcess = node.chunks | ||
|
|
||
| logging.info(f"[MeshroomCreateChunks] Chunks to process here : {chunksToProcess}") | ||
|
|
||
| if not args.forceStatus and not args.forceCompute: | ||
| for chunk in chunksToProcess: | ||
| if chunk.status.status in submittedStatuses: | ||
| # Particular case for the local isolated, the node status is set to RUNNING by the submitter directly. | ||
| # We ensure that no other instance has started to compute, by checking that the sessicomputeSessionUidonUid is empty. | ||
| if chunk.node.getMrNodeType() == meshroom.core.MrNodeType.NODE and \ | ||
| not chunk.status.computeSessionUid and node._nodeStatus.submitterSessionUid: | ||
| continue | ||
| logging.warning( | ||
| f"[MeshroomCreateChunks] Node is already submitted with status " \ | ||
| f"\"{chunk.status.status.name}\". See file: \"{chunk.statusFile}\". " \ | ||
| f"ExecMode: {chunk.status.execMode.name}, computeSessionUid: {chunk.status.computeSessionUid}, " \ | ||
| f"submitterSessionUid: {node._nodeStatus.submitterSessionUid}") | ||
|
|
||
| if chunksToProcess: | ||
| node.prepareLogger() | ||
| node.preprocess() | ||
| for chunk in chunksToProcess: | ||
| logging.info(f"[MeshroomCreateChunks] process chunk {chunk}") | ||
| chunk.process(args.forceCompute, args.inCurrentEnv) | ||
| node.postprocess() | ||
| node.restoreLogger() | ||
| else: | ||
| logging.info(f"[MeshroomCreateChunks] -> create job to process chunks {node.chunks}") | ||
| submitter.createChunkTask(node, graphFile=args.graphFile, cache=args.cache, | ||
| forceStatus=args.forceStatus, forceCompute=args.forceCompute) | ||
|
|
||
| # Restore the log level | ||
| logging.getLogger().setLevel(meshroom.logStringToPython[args.verbose]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.