Hi! Is there an easy way to obtain an instance of ...
# ask-the-community
a
Hi! Is there an easy way to obtain an instance of a
FlyteRemote
or similar (i.e.,
flytekit.clients.friendly
) API client instance when running in a container? I have seen
Config.auto()
, but it needs a config file to do its magic. Also, there's
FlyteContext.flyte_client
, which looks promising but is set to
None
, when I try to look it up on a context obtained via
FlyteContextManager.current_context()
at runtime. Any pointers are highly appreciated! 🙏
y
you can.
one sec
you can at least start out with
Config.for_endpoint(endpoint, insecure)
Copy code
endpoint: str,
        insecure: bool = False,
        data_config: typing.Optional[DataConfig] = None,
        config_file: typing.Union[str, ConfigFile] = None,
that’s the full constructor but the other objects are optional
a
Actually, that's what I settled on as a workaround, but it requires looking up the admin endpoint from k8s services - or is the endpoint URL readily available elsewhere in the task container?
y
it is not… but you can hard-code it right?
the dns shouldn’t change.
one thing though is that if you have authentication turned on you’ll have to contend with it
151 Views