-
Notifications
You must be signed in to change notification settings - Fork 258
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
Improved config system in flytekit and improved FlyteRemote #857
Conversation
Signed-off-by: Ketan Umare <ketan.umare@gmail.com>
Signed-off-by: Ketan Umare <ketan.umare@gmail.com>
Signed-off-by: Ketan Umare <ketan.umare@gmail.com>
Signed-off-by: Ketan Umare <ketan.umare@gmail.com>
Signed-off-by: Ketan Umare <ketan.umare@gmail.com>
Signed-off-by: Ketan Umare <ketan.umare@gmail.com>
Signed-off-by: Ketan Umare <ketan.umare@gmail.com>
Signed-off-by: Ketan Umare <ketan.umare@gmail.com>
Signed-off-by: Ketan Umare <ketan.umare@gmail.com>
Signed-off-by: Ketan Umare <ketan.umare@gmail.com>
Signed-off-by: Ketan Umare <ketan.umare@gmail.com>
Structured dataset Signed-off-by: Ketan Umare <ketan.umare@gmail.com>
* mostly nits, changing import styles, etc. Signed-off-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com> * nits Signed-off-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com> * nits Signed-off-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com> * make fmt Signed-off-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com>
Signed-off-by: Ketan Umare <ketan.umare@gmail.com>
#874) * make fmt, core tests patched, remove additional context from ExecutionState, updated ImageConfig to not have Nones in the list Signed-off-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com> * make raw Signed-off-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com>
Signed-off-by: Ketan Umare <ketan.umare@gmail.com>
Signed-off-by: Ketan Umare <ketan.umare@gmail.com>
Signed-off-by: Ketan Umare <ketan.umare@gmail.com>
Signed-off-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com>
Signed-off-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com>
* default Signed-off-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com> * nit Signed-off-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com> * nit Signed-off-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com> * use os join Signed-off-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com>
Signed-off-by: Ketan Umare <ketan.umare@gmail.com>
Signed-off-by: Ketan Umare <ketan.umare@gmail.com>
Signed-off-by: Ketan Umare <ketan.umare@gmail.com>
Signed-off-by: Ketan Umare <ketan.umare@gmail.com>
Signed-off-by: Ketan Umare <ketan.umare@gmail.com>
Signed-off-by: Samhita Alla <aallasamhita@gmail.com>
Signed-off-by: Samhita Alla <aallasamhita@gmail.com>
Signed-off-by: Samhita Alla <aallasamhita@gmail.com>
Signed-off-by: Samhita Alla <aallasamhita@gmail.com>
Signed-off-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com>
Signed-off-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com>
Signed-off-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com>
# Always retry auth errors. | ||
if i == (max_retries - 1): | ||
# Exit the loop and wrap the authentication error. | ||
raise _user_exceptions.FlyteAuthenticationException(str(e)) | ||
cli_logger.error(f"Unauthenticated RPC error {e}, refreshing credentials and retrying\n") | ||
refresh_handler_fn = _get_refresh_handler(creds_config.AUTH_MODE.get()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we cannot pass the auth mode as an environment variable any longer. Was this intended?
# metadata will hold the value of the token to send to the various endpoints. | ||
self._metadata = None | ||
|
||
@classmethod | ||
def with_root_certificate(cls, cfg: PlatformConfig, root_cert_file: str) -> RawSynchronousFlyteClient: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this being called?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nvm, now I see the SynchronousFlyteClient
TL;DR
This PR substantially cleans up
flytekit
configuration, both in terms of the configuration settings themselves, and their usage from within the flytekit code base. Rarely used settings have been removed, remaining settings have been categorized together into classes that reflect usage, and global access has been reduced.Flytekit Configuration Ecosystem
Where can configuration come from?
Both before and after this PR, configuration can come from a few different places,
pyflyte package --help
for example.)flytekit.config
in the Python interpreter's starting directory~/.flyte/config
in the home directory as detected by Python.How is configuration used?
Configuration usage can roughly be bucketed into the following areas,
FlyteRemote UX
This cleanup also improves the
FlyteRemote
experience. Following this PR, users are able to constructFlyteRemote
objects more easily:Changes to UX
Creating the Flyte client
For users that may be using the Flyte client directly (the
RawSynchronousFlyteClient
andSynchronousFlyteClient
classes), we've updated the constructor to use the new configuration dataclasses.Plain Usage
Just creating the client object with minimal parameters
Old
New
Passing grpc credentials
If your Flyte backend relies on a custom certificate chain, you'd create the grpc credentials and pass through. With this release, users should instead pass in the file locations of the relevant certificates.
Old
New
options
andcompression
are also respected keyword arguments.Default resources deleted
The configuration objects under
configuration/resources.py
have been removed because they were rarely used and caused more confusion than it solved. If you would like to specify resource requests/limits on a task, you can of course still do that in the@task()
decorator. If not specified, the defaults will be determined by Admin. If you'd like to configure Admin's defaults , please refer to how-to-guide here.Type
Are all requirements met?
Complete description
Config object replacement
The series of files under
flytekit/configuration
have largely been deleted with this PR. Instead all the configuration is now embodied in the following dataclasses (some of which already existed).PlatformConfig
Roughly the entries in theplatform.py
file previously. Contains settings to talk to Flyte backend.StatsConfig
,SecretsConfig
,S3Config
,GCSConfig
,DataConfig
(which holds the S3/GCS config).EntrypointSettings
,Image
,ImageConfig
,SerializationSettings
All these are wrapped in one parent class called
flytekit.configuration.Config
flytekit.configuration.file.ConfigFile
Wrapper object representing a config file. Config files are still theini
formatted files from before, though some settings have been deleted.Settings that were only really used when registering launch plans have been moved to
flytekit.remote.remote.Options
. Theremote
package location makes more sense because these are effectively run-time settings used for registration, whichflytectl
has mostly taken over.FlyteRemote
however still does on-demand registration.For dynamic tasks, flytekit will now serialize the
SerializationSettings
at compile time (of the parent dynamic task) and store those bits as an environment variable. See the issue.SerializationSettings
,Image
andImageConfig
moved fromcontext_manager.py
to configuration folder instead.RawSynchronousFlyteClient
scan kwargs for grpc channel credential arguments instead of taking a constructed credentials object.Possible user impact changes
Tracking Issue
flyteorg/flyte#1359
flyteorg/flyte#2214
Follow-up issue
NA
OR
https://github.com/lyft/flyte/issues/