Skip to content

Add support for local binary distribution of resolver#120

Open
tadeas-hejnic wants to merge 30 commits into
developfrom
settings-redesign
Open

Add support for local binary distribution of resolver#120
tadeas-hejnic wants to merge 30 commits into
developfrom
settings-redesign

Conversation

@tadeas-hejnic
Copy link
Copy Markdown
Contributor

Changelog Description

This pull request introduces support for using locally installed USD resolver binaries as an alternative to downloading them from LakeFS, with new configuration options in both the server and client. The resolver selection logic has been refactored to prioritize local resolvers when preferred or on farm jobs, and to fall back to LakeFS or local as needed. Additionally, a new plugin collects relevant environment variables for farm jobs, and the version has been updated.

Additional review information

The base of the code changes comes from this PR, but the current implementation improves the feature and make the local distribution support more general.

Testing notes:

  1. start with the basic setup with lakefs distribution
  2. define local paths
  3. test possible enable/disable combinations
  4. test local distribution on farm

Luma and others added 12 commits February 18, 2026 13:33
…lver paths per app and platform, bypassing lakeFS downloads

- Add get_local_resolver_path utility to match resolver by app name, alias, and platform

- Update pre_resolver_init hook to prefer local resolver paths, support farm_publish launch type, and skip lakeFS on farm workers

- Harden addon data JSON reading with error handling for missing/corrupt files

- Add CollectResolverEnvVars publish plugin to forward resolver config vars (TF_DEBUG, logger settings) to farm job environments
@tadeas-hejnic tadeas-hejnic self-assigned this Apr 23, 2026
@tadeas-hejnic tadeas-hejnic added type: bug Something isn't working type: enhancement Improvement of existing functionality or minor addition sponsored This is directly sponsored by a client or community member labels Apr 23, 2026
Comment on lines +56 to +65
"AYONLOGGERLOGLVL": resolver_cfg.get("ayon_log_lvl", ""),
"AYONLOGGERSFILELOGGING": resolver_cfg.get(
"ayon_file_logger_enabled", ""
),
"AYONLOGGERSFILEPOS": resolver_cfg.get(
"file_logger_file_path", ""
),
"AYON_LOGGIN_LOGGIN_KEYS": resolver_cfg.get(
"ayon_logger_logging_keys", ""
),
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Flagging this because it still uses the old variable names. It should be updated once this PR is merged. If this PR gets merged first, then the fix should be made in that PR instead.

@tadeas-hejnic
Copy link
Copy Markdown
Contributor Author

tadeas-hejnic commented Apr 24, 2026

image

This is how the local distribution looks like in settings.

@tadeas-hejnic
Copy link
Copy Markdown
Contributor Author

Ok after a little more testing, i found one issue, if both lakefs and local distribution is on, with prefer local on, it still tries to download from lakefs when starting the addon and it crashes. I fixed it by adding this extra check in _download_global_lakefs_binaries

      74 +        if local_dist.get("enabled") and local_dist.get("prefer"):                                                                                                                                                          
      75 +            self.log.info(                                                                                                                                                                                                  
      76 +                "Local distribution is preferred; skipping LakeFS USD lib "                                                                                                                                                 
      77 +                "download."                                                                                                                                                                                                 
      78 +            )                                                                                                                                                                                                               
      79 +            return                                                                                                                                                                                                          
      80 +                               

Nice catch! I added to the next commit. You can check it now

Copy link
Copy Markdown
Member

@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 think the distinction between whether on farm or not is just making things more confusing (and dangerous) because this may mean the farm machines would end up picking a different resolver than the one being downloaded locally on the user's machine. As such, I think instead the settings should behave in that you can choose to either enable 'distributing' from LakeFS or locally or not at all (regardless of whether it's farm or not).

If farm is having issues with LakeFS, then really we should solve that. And not somehow have only farm machines behave differently in what resolver they may end up using.

We'll need to ensure production has a ground truth on behavior, ensuring that all launches have a reproducible setup on how they launch, regardless of whether it's farm or local etc.

I like the fact that we make it easier with this PR to offer a resolver from a local path.

I personally feel more for looking into a way to "share" the resolver by e.g. having even LakeFS distributed resolver to e.g. be downloaded and searched for on a network share. So you can customize the path on where the resolver should be, and if it's found - then even the farm machines would allow to pick that one up. However, it'd require concurrency checks on the downloads if timestamps mismatch, etc. and unique folders per resolver within that folder, etc. More complicated on how it deploys - but would make it so that not every machine needs to download from LakeFS individually if another had already downloaded it to the shared location in the studio.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we should NOT be passing on the env var of TF_DEBUG and logger level to the job - especially because e.g. the file location may not at all be the same path that is available on a farm machine. The farm job should really be picking up the env vars in the same manner they would when running locally which I suspect is from settings. As such, I have my doubts about adding this collector.

@cpt-cabbage
Copy link
Copy Markdown

@BigRoy the idea from our side is that if you're using the local resolvers, you're not using lakefs.

The distinction between it being on the farm and not is complicating it unnecessarily I agree, our original thinking shifted a little as we worked on this . The way we're currently using it is essentially the way you're saying. We are using a local resolver everywhere, we aren't using a separate LakeFS binary for workstations, we are pointing every single client to the local resolver.

So in my mind if local distribution is on, "Prefer Local" should always be on too.

@tadeas-hejnic if you'd like help let me know

@tadeas-hejnic
Copy link
Copy Markdown
Contributor Author

tadeas-hejnic commented Apr 29, 2026

That makes sense. To avoid confusion or any behaviour that can't be reproduced, I can remove the "Prefer toggle" and make it always enabled, so it will always override the LakeFS distribution. I'm just not sure how it should behave when the variant is defined in LakeFS, but not in the local distribution. Should it take the LakeFS one, fail or something else?

@BigRoy
Copy link
Copy Markdown
Member

BigRoy commented Apr 29, 2026

That makes sense. To avoid confusion or any behaviour that can't be reproduced, I can remove the "Prefer toggle" and make it always enabled, so it will always override the LakeFS distribution. I'm just not sure how it should behave when the variant is defined in LakeFS, but not in the local distribution. Should it take the LakeFS one, fail or something else?

We should make it so that either LakeFS distribution is enabled OR local distribution. Probably best using an enum attribute with conditional_enum=True to show/hide the relevant groups automatically. That attribute would just have options:

  • Distribute via AYON (LakeFS)
  • Configure via local path
  • Disabled

@tadeas-hejnic tadeas-hejnic deleted the settings-redesign branch May 5, 2026 09:37
@tadeas-hejnic tadeas-hejnic restored the settings-redesign branch May 5, 2026 09:40
@tadeas-hejnic tadeas-hejnic reopened this May 5, 2026
@tadeas-hejnic
Copy link
Copy Markdown
Contributor Author

tadeas-hejnic commented May 5, 2026

So I changed it based on @BigRoy comment. I have added also support for defining roots for the resolver paths.

LakeFS distribution:

image

.
Local distribution:

image

.
Disabled distribution:

image

Comment thread client/ayon_usd/utils.py Outdated
Comment thread client/ayon_usd/version.py Outdated
Copy link
Copy Markdown
Member

@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.

These settings changes will need server side settings conversion logic, so that existing overrides are preserved.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not convinced about this logic. I'd rather have it purely based on settings (which is the entry point to this anyway).

I think we're just mixing the set up USD resolver pre hook with the setting these env vars hook. I'd actually separate those to two hooks, and make the set debug level etc. hook just always run instead of only if local render.

Comment thread client/ayon_usd/hooks/pre_resolver_init.py Outdated
tadeas-hejnic and others added 4 commits May 12, 2026 12:17
Co-authored-by: Roy Nieterau <roy_nieterau@hotmail.com>
Co-authored-by: Roy Nieterau <roy_nieterau@hotmail.com>
@tadeas-hejnic
Copy link
Copy Markdown
Contributor Author

These settings changes will need server side settings conversion logic, so that existing overrides are preserved.

The settings conversion is now implemented in the last commit

@tadeas-hejnic tadeas-hejnic requested a review from BigRoy May 12, 2026 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sponsored This is directly sponsored by a client or community member type: bug Something isn't working type: enhancement Improvement of existing functionality or minor addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

YN-0552: USD resolver does not distribute automatically on farm machines

4 participants