Skip to content

Commit

Permalink
Add support for local execute in pod task (#852) (#853)
Browse files Browse the repository at this point in the history
Signed-off-by: ggydush-fn <greg.gydush@freenome.com>

Co-authored-by: ggydush-fn <69013027+ggydush-fn@users.noreply.github.com>
  • Loading branch information
wild-endeavor and ggydush-fn committed Feb 15, 2022
1 parent 7bc0d4b commit 68586be
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugins/flytekit-k8s-pod/flytekitplugins/pod/task.py
Expand Up @@ -7,6 +7,7 @@
from flytekit import FlyteContext, PythonFunctionTask
from flytekit.exceptions import user as _user_exceptions
from flytekit.extend import Promise, SerializationSettings, TaskPlugins
from flytekit.loggers import logger
from flytekit.models import task as _task_models

_PRIMARY_CONTAINER_NAME_FIELD = "primary_container_name"
Expand Down Expand Up @@ -120,7 +121,10 @@ def get_config(self, settings: SerializationSettings) -> Dict[str, str]:
return {_PRIMARY_CONTAINER_NAME_FIELD: self.task_config.primary_container_name}

def local_execute(self, ctx: FlyteContext, **kwargs) -> Union[Tuple[Promise], Promise, None]:
raise _user_exceptions.FlyteUserException("Local execute is not currently supported for pod tasks")
logger.warning(
"Running pod task locally. Local environment may not match pod environment which may cause issues."
)
return super().local_execute(ctx=ctx, **kwargs)


TaskPlugins.register_pythontask_plugin(Pod, PodFunctionTask)

0 comments on commit 68586be

Please sign in to comment.