Skip to content
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

Houdini: Cleanup after publishing #9

Merged
merged 114 commits into from
Jun 27, 2024

Conversation

MustafaJafar
Copy link
Contributor

@MustafaJafar MustafaJafar commented Feb 8, 2024

Changelog Description

This PR adds a collector to add the parent of the exported files to the clean up list.

Additional info

Cautions, This feature can be dangerous.

Testing notes:

  1. Publish different product types from Houdini
  2. All exported files should be gone after the integration finishes.

@MustafaJafar
Copy link
Contributor Author

MustafaJafar commented Feb 14, 2024

As far as I tested, this PR works with local publishing, I'm not sure yet about farm publishing.
Let me add my thoughts as I 'm not sure if this PR addresses the issue correctly.


From digging around discord and the code I found out that there are plugins that do the cleaning up:

  • ayon-core/plugins/cleanup.py which remove the staging dir if it were in temp path
  • ayon_core/plugins/publish/cleanup_explicit.py which removes in path in this list context.data["cleanupFullPaths"]
  • ayon_core/plugins/publish/cleanup_farm.py which I'm not sure how to use it.

tbh, I find this feature dangerous and requires pipeline admins to be aware of how to use it.
I think these settings are related, I don't know if they are working with Houdini 😅 :

  • ayon+settings://core/tools/publish/custom_staging_dir_profiles
  • ayon+settings://core/publish/CleanUp
  • ayon+settings://core/publish/CleanUpFarm

@MustafaJafar
Copy link
Contributor Author

Mentioning @BigRoy as I couldn't add him as a reviewer in this PR.

@MustafaJafar
Copy link
Contributor Author

MustafaJafar commented Feb 15, 2024

Here are the current test results on my side.
I tested these product types and it deletes files as expected

        "camera",
        "pointcache",
        "imagesequence",
        "mantraifd",
        "review",
        "staticMesh",
        "usd",
        "vdbcache"

FYI, I found out a bug in mantra ifd, I'll fix it in a separate PR, here #75

From publisher log:

Removed files:
\\storage\work\ayon_projects\Robo\Assets\Character\BigRobo\work\cfx\ayon\S_BigRoboMain\S_BigRoboMain.fbx
\\storage\work\ayon_projects\Robo\Assets\Character\BigRobo\work\cfx\ayon\cameraMain\cameraMain.abc
\\storage\work\ayon_projects\Robo\Assets\Character\BigRobo\work\cfx\ayon\imagesequenceMain\imagesequenceMain.1001.exr
\\storage\work\ayon_projects\Robo\Assets\Character\BigRobo\work\cfx\ayon\imagesequenceMain\imagesequenceMain.1002.exr
\\storage\work\ayon_projects\Robo\Assets\Character\BigRobo\work\cfx\ayon\mantraifdMain\mantraifdMain.1001.ifd
\\storage\work\ayon_projects\Robo\Assets\Character\BigRobo\work\cfx\ayon\mantraifdMain\mantraifdMain.1002.ifd
\\storage\work\ayon_projects\Robo\Assets\Character\BigRobo\work\cfx\ayon\pointcacheABC\pointcacheABC.abc
\\storage\work\ayon_projects\Robo\Assets\Character\BigRobo\work\cfx\ayon\pointcacheBgeo\pointcacheBgeo.1001.bgeo
\\storage\work\ayon_projects\Robo\Assets\Character\BigRobo\work\cfx\ayon\pointcacheBgeo\pointcacheBgeo.1002.bgeo
\\storage\work\ayon_projects\Robo\Assets\Character\BigRobo\work\cfx\ayon\reviewMain\reviewMain.1001.png
\\storage\work\ayon_projects\Robo\Assets\Character\BigRobo\work\cfx\ayon\reviewMain\reviewMain.1002.png
\\storage\work\ayon_projects\Robo\Assets\Character\BigRobo\work\cfx\ayon\reviewMain\reviewMain_h264focal_length_burnin.mp4
\\storage\work\ayon_projects\Robo\Assets\Character\BigRobo\work\cfx\ayon\usdMain\usdMain.usd
\\storage\work\ayon_projects\Robo\Assets\Character\BigRobo\work\cfx\ayon\vdbcacheMain\vdbcacheMain.1001.vdb
\\storage\work\ayon_projects\Robo\Assets\Character\BigRobo\work\cfx\ayon\vdbcacheMain\vdbcacheMain.1002.vdb

@BigRoy
Copy link
Collaborator

BigRoy commented Feb 15, 2024

The Mantra IFD and .rs files being deleted doesn't seem like what you'd want right? Or are those IFD files actually being published? Aren't those just intermediate rendering files?

@m-u-r-p-h-y m-u-r-p-h-y added the sponsored This is directly sponsored by a client or community member label Jun 27, 2024
@moonyuet
Copy link
Member

I encountered this issue during installing addon

Traceback (most recent call last):
      File "/backend/ayon_server/addons/definition.py", line 84, in versions
        self.init_addon(version_dir)
      File "/backend/ayon_server/addons/definition.py", line 148, in init_addon
        module = import_module(vname, server_module_path)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/backend/ayon_server/addons/utils.py", line 18, in import_module
        spec.loader.exec_module(module)
      File "<frozen importlib._bootstrap_external>", line 940, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "/addons/houdini/0.3.7/server/__init__.py", line 5, in <module>
        from .settings import HoudiniSettings, DEFAULT_VALUES
      File "/addons/houdini/0.3.7/server/settings/__init__.py", line 1, in <module>
        from .main import (
      File "/addons/houdini/0.3.7/server/settings/main.py", line 15, in <module>
        from .publish import (
      File "/addons/houdini/0.3.7/server/settings/publish.py", line 100, in <module>
        class PublishPluginsModel(BaseSettingsModel):
      File "/addons/houdini/0.3.7/server/settings/publish.py", line 111, in PublishPluginsModel
        default_factory=BasicValidateModel,
                        ^^^^^^^^^^^^^^^^^^
    NameError: name 'BasicValidateModel' is not defined

We need to change BasicValidateModel to BasicEnabledStatesModel after this

@BigRoy
Copy link
Collaborator

BigRoy commented Jun 27, 2024

Tested out the PR for pointcache and vdb sequences - works for me:

image

And if the folder was empty before publishing (or didn't exist) it also removes it - which is a debug log:

image

@MustafaJafar MustafaJafar requested a review from BigRoy June 27, 2024 11:42
Copy link
Member

@moonyuet moonyuet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with Review, Camera and Mantra ROP(both local and farm)
Works smoothly.

Copy link
Collaborator

@BigRoy BigRoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed a version bump - only thing to double check @MustafaJafar is Kayla's comment. If you think that's all resolved / fine as it is feel free to mark resolved and merge the PR.

Did another pointcache + vdb test run just now. Works fine.

@moonyuet
Copy link
Member

I pushed a version bump - only thing to double check @MustafaJafar is Kayla's comment. If you think that's all resolved / fine as it is feel free to mark resolved and merge the PR.

Did another pointcache + vdb test run just now. Works fine.

we need to dimiss Ondrej's review to merge it btw.

@BigRoy BigRoy removed the request for review from antirotor June 27, 2024 12:02
@BigRoy BigRoy dismissed antirotor’s stale review June 27, 2024 12:04

The request has been implemented, but Ondrej is not around to review now.

@BigRoy BigRoy assigned MustafaJafar and unassigned antirotor Jun 27, 2024
@MustafaJafar MustafaJafar merged commit eed7634 into develop Jun 27, 2024
10 checks passed
@MustafaJafar MustafaJafar deleted the feature/houdini_cleanup_after_publishing branch June 27, 2024 12:08
MustafaJafar pushed a commit that referenced this pull request Jun 27, 2024
…nhance_parms

Houdini: Update ayon_lop_import 1.0 (Expanded HDA)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
host: Houdini sponsored This is directly sponsored by a client or community member type: feature Adding something new and exciting to the product
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

7 participants