cuddly-jelly-27016
05/27/2025, 12:09 AMFlyteRemote to be statically initialized
Issue created by ai-rnatour
### Describe the issue
In order to execute eager workflows on a remote cluster, a FlyteRemote object needs to be statically created for the decorator. This prevents the FlyteRemote from being constructed with runtime values and causes any module imports to require the side-effect of reading from the filesystem (which is an anti-pattern).
### What if we do not do this?
In our case, we have a number of Flyte deployments with different configs. In order order to reuse the eager workflow between deployments, we have to use a variant of this pattern:
@eager(
remote=FlyteRemote(
config=Config.auto(config_file=get_config_path_for_aws_account()), # use the AWS ACCOUNT_ID of our Flyte deployment to look up the correct Flyte config
default_project="my_project", # same for all deployments
default_domain=os.environ[FLYTE_STAGE_ENV_VAR], # look up the current domain from the runtime environment
),
client_secret_group="my_group",
client_secret_key="my_secret", # these two are the same for all deployments
)
It would be much better if we could instead create the FlyteRemote inside our task based on runtime inputs. Or, defer creation of the FlyteRemote until the task is running in the cluster and default to values suitable for invoking tasks and workflows registered to the currently executing Flyte deployment.
### Related component(s)
Eager workflows
### Are you sure this issue hasn't been raised already?
• Yes
### Have you read the Code of Conduct?
• Yes
flyteorg/flytecuddly-jelly-27016
05/27/2025, 12:09 AMFlyteRemote to be statically initialized
Issue closed as not planned by github-actions[bot]
flyteorg/flyte