Webpublisher: Cleanup targets (#5418)

* remove remotepublish commands from cli

* use 'automated' target instead ot 'remotepublish'

* removed references to remotepublish

* added webpublish target

* use webpubish targets where automated does not make sense
This commit is contained in:
Jakub Trllo 2023-08-08 11:36:16 +02:00 committed by GitHub
parent 7d40debd64
commit 7debe12c2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 21 additions and 132 deletions

View file

@ -196,47 +196,6 @@ def publish(paths, targets, gui):
PypeCommands.publish(list(paths), targets, gui)
@main.command()
@click.argument("path")
@click.option("-h", "--host", help="Host")
@click.option("-u", "--user", help="User email address")
@click.option("-p", "--project", help="Project")
@click.option("-t", "--targets", help="Targets", default=None,
multiple=True)
def remotepublishfromapp(project, path, host, user=None, targets=None):
"""Start CLI publishing.
Publish collects json from paths provided as an argument.
More than one path is allowed.
"""
if AYON_SERVER_ENABLED:
raise RuntimeError(
"AYON does not support 'remotepublishfromapp' command."
)
PypeCommands.remotepublishfromapp(
project, path, host, user, targets=targets
)
@main.command()
@click.argument("path")
@click.option("-u", "--user", help="User email address")
@click.option("-p", "--project", help="Project")
@click.option("-t", "--targets", help="Targets", default=None,
multiple=True)
def remotepublish(project, path, user=None, targets=None):
"""Start CLI publishing.
Publish collects json from paths provided as an argument.
More than one path is allowed.
"""
if AYON_SERVER_ENABLED:
raise RuntimeError("AYON does not support 'remotepublish' command.")
PypeCommands.remotepublish(project, path, user, targets=targets)
@main.command(context_settings={"ignore_unknown_options": True})
def projectmanager():
if AYON_SERVER_ENABLED:

View file

@ -15,7 +15,7 @@ class CloseAE(pyblish.api.ContextPlugin):
active = True
hosts = ["aftereffects"]
targets = ["remotepublish"]
targets = ["automated"]
def process(self, context):
self.log.info("CloseAE")

View file

@ -17,7 +17,7 @@ class ClosePS(pyblish.api.ContextPlugin):
active = True
hosts = ["photoshop"]
targets = ["remotepublish"]
targets = ["automated"]
def process(self, context):
self.log.info("ClosePS")

View file

@ -6,8 +6,6 @@ from openpype.pipeline.create import get_subset_name
class CollectAutoImage(pyblish.api.ContextPlugin):
"""Creates auto image in non artist based publishes (Webpublisher).
'remotepublish' should be renamed to 'autopublish' or similar in the future
"""
label = "Collect Auto Image"
@ -15,7 +13,7 @@ class CollectAutoImage(pyblish.api.ContextPlugin):
hosts = ["photoshop"]
order = pyblish.api.CollectorOrder + 0.2
targets = ["remotepublish"]
targets = ["automated"]
def process(self, context):
family = "image"

View file

@ -20,7 +20,7 @@ class CollectAutoReview(pyblish.api.ContextPlugin):
label = "Collect Auto Review"
hosts = ["photoshop"]
order = pyblish.api.CollectorOrder + 0.2
targets = ["remotepublish"]
targets = ["automated"]
publish = True

View file

@ -12,7 +12,7 @@ class CollectAutoWorkfile(pyblish.api.ContextPlugin):
label = "Collect Workfile"
hosts = ["photoshop"]
targets = ["remotepublish"]
targets = ["automated"]
def process(self, context):
family = "workfile"

View file

@ -35,7 +35,7 @@ class CollectBatchData(pyblish.api.ContextPlugin):
order = pyblish.api.CollectorOrder - 0.495
label = "Collect batch data"
hosts = ["photoshop"]
targets = ["remotepublish"]
targets = ["webpublish"]
def process(self, context):
self.log.info("CollectBatchData")

View file

@ -34,7 +34,7 @@ class CollectColorCodedInstances(pyblish.api.ContextPlugin):
label = "Instances"
order = pyblish.api.CollectorOrder
hosts = ["photoshop"]
targets = ["remotepublish"]
targets = ["automated"]
# configurable by Settings
color_code_mapping = []

View file

@ -26,7 +26,7 @@ class CollectPublishedVersion(pyblish.api.ContextPlugin):
order = pyblish.api.CollectorOrder + 0.190
label = "Collect published version"
hosts = ["photoshop"]
targets = ["remotepublish"]
targets = ["automated"]
def process(self, context):
workfile_subset_name = None

View file

@ -3,4 +3,4 @@ Webpublisher
Plugins meant for processing of Webpublisher.
Gets triggered by calling openpype.cli.remotepublish with appropriate arguments.
Gets triggered by calling `openpype_console modules webpublisher publish` with appropriate arguments.

View file

@ -270,7 +270,7 @@ def find_variant_key(application_manager, host):
def get_task_data(batch_dir):
"""Return parsed data from first task manifest.json
Used for `remotepublishfromapp` command where batch contains only
Used for `publishfromapp` command where batch contains only
single task with publishable workfile.
Returns:

View file

@ -34,7 +34,7 @@ def cli_publish(project_name, batch_path, user_email, targets):
Args:
project_name (str): project to publish (only single context is
expected per call of remotepublish
expected per call of 'publish')
batch_path (str): Path batch folder. Contains subfolders with
resources (workfile, another subfolder 'renders' etc.)
user_email (string): email address for webpublisher - used to
@ -49,8 +49,8 @@ def cli_publish(project_name, batch_path, user_email, targets):
if not batch_path:
raise RuntimeError("No publish paths specified")
log = Logger.get_logger("remotepublish")
log.info("remotepublish command")
log = Logger.get_logger("Webpublish")
log.info("Webpublish command")
# Register target and host
webpublisher_host = WebpublisherHost()
@ -107,7 +107,7 @@ def cli_publish_from_app(
Args:
project_name (str): project to publish (only single context is
expected per call of remotepublish
expected per call of publish
batch_path (str): Path batch folder. Contains subfolders with
resources (workfile, another subfolder 'renders' etc.)
host_name (str): 'photoshop'
@ -117,9 +117,9 @@ def cli_publish_from_app(
(to choose validator for example)
"""
log = Logger.get_logger("RemotePublishFromApp")
log = Logger.get_logger("PublishFromApp")
log.info("remotepublishphotoshop command")
log.info("Webpublish photoshop command")
task_data = get_task_data(batch_path)

View file

@ -216,7 +216,7 @@ class BatchPublishEndpoint(WebpublishApiEndpoint):
"extensions": [".tvpp"],
"command": "publish",
"arguments": {
"targets": ["tvpaint_worker"]
"targets": ["tvpaint_worker", "webpublish"]
},
"add_to_queue": False
},
@ -230,7 +230,7 @@ class BatchPublishEndpoint(WebpublishApiEndpoint):
# Make sure targets are set to None for cases that default
# would change
# - targets argument is not used in 'publishfromapp'
"targets": ["remotepublish"]
"targets": ["automated", "webpublish"]
},
# does publish need to be handled by a queue, eg. only
# single process running concurrently?
@ -247,7 +247,7 @@ class BatchPublishEndpoint(WebpublishApiEndpoint):
"project": content["project_name"],
"user": content["user"],
"targets": ["filespublish"]
"targets": ["filespublish", "webpublish"]
}
add_to_queue = False

View file

@ -45,7 +45,7 @@ def run_webserver(executable, upload_dir, host=None, port=None):
server_manager = webserver_module.create_new_server_manager(port, host)
webserver_url = server_manager.url
# queue for remotepublishfromapp tasks
# queue for publishfromapp tasks
studio_task_queue = collections.deque()
resource = RestApiResource(server_manager,

View file

@ -33,7 +33,7 @@ class CollectUsernameForWebpublish(pyblish.api.ContextPlugin):
order = pyblish.api.CollectorOrder + 0.0015
label = "Collect ftrack username"
hosts = ["webpublisher", "photoshop"]
targets = ["remotepublish", "filespublish", "tvpaint_worker"]
targets = ["webpublish"]
def process(self, context):
self.log.info("{}".format(self.__class__.__name__))

View file

@ -165,74 +165,6 @@ class PypeCommands:
log.info("Publish finished.")
@staticmethod
def remotepublishfromapp(project_name, batch_path, host_name,
user_email, targets=None):
"""Opens installed variant of 'host' and run remote publish there.
Eventually should be yanked out to Webpublisher cli.
Currently implemented and tested for Photoshop where customer
wants to process uploaded .psd file and publish collected layers
from there. Triggered by Webpublisher.
Checks if no other batches are running (status =='in_progress). If
so, it sleeps for SLEEP (this is separate process),
waits for WAIT_FOR seconds altogether.
Requires installed host application on the machine.
Runs publish process as user would, in automatic fashion.
Args:
project_name (str): project to publish (only single context is
expected per call of remotepublish
batch_path (str): Path batch folder. Contains subfolders with
resources (workfile, another subfolder 'renders' etc.)
host_name (str): 'photoshop'
user_email (string): email address for webpublisher - used to
find Ftrack user with same email
targets (list): Pyblish targets
(to choose validator for example)
"""
from openpype.hosts.webpublisher.publish_functions import (
cli_publish_from_app
)
cli_publish_from_app(
project_name, batch_path, host_name, user_email, targets
)
@staticmethod
def remotepublish(project, batch_path, user_email, targets=None):
"""Start headless publishing.
Used to publish rendered assets, workfiles etc via Webpublisher.
Eventually should be yanked out to Webpublisher cli.
Publish use json from passed paths argument.
Args:
project (str): project to publish (only single context is expected
per call of remotepublish
batch_path (str): Path batch folder. Contains subfolders with
resources (workfile, another subfolder 'renders' etc.)
user_email (string): email address for webpublisher - used to
find Ftrack user with same email
targets (list): Pyblish targets
(to choose validator for example)
Raises:
RuntimeError: When there is no path to process.
"""
from openpype.hosts.webpublisher.publish_functions import (
cli_publish
)
cli_publish(project, batch_path, user_email, targets)
@staticmethod
def extractenvironments(output_json_path, project, asset, task, app,
env_group):