Skip to content
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

Refactor interfaces and engine code #153

Merged
merged 86 commits into from
Sep 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
1a65cef
messing around
Jul 5, 2020
ea602fb
doesn't compile
Jul 6, 2020
f642ce6
uh
Jul 8, 2020
33ebcbd
complete mess
Jul 10, 2020
f2bea18
what?
Jul 11, 2020
978cb90
fjdksalfj
Jul 13, 2020
b664c3d
fixing comments
Jul 14, 2020
2707644
merge
Aug 1, 2020
4d924a2
merging master
Aug 6, 2020
cf59e21
manually construct the workflow outputs
Aug 6, 2020
d7be767
adding a couple comments, and using sdk task and workflow
Aug 6, 2020
7c05782
temporarily deleting long-running tests, self-naming
Aug 7, 2020
9701acc
doesn't work
Aug 8, 2020
752cd43
definitely doesn't work
Aug 9, 2020
361fba5
remove six
Aug 10, 2020
76a14bc
one more six
Aug 10, 2020
fa4a935
wip
Aug 10, 2020
ded737d
fdsa
Aug 11, 2020
74c80c2
wip
Aug 11, 2020
1c1efb8
lp
Aug 11, 2020
7fa979f
nodes
Aug 11, 2020
97d4e8a
workflow execution
Aug 11, 2020
ced4cb4
task execution
Aug 11, 2020
e0604ce
delete annotated stuff
Aug 11, 2020
a1c0c8f
moving stuff from runnable launch plan to sdk launch plan, moving hel…
Aug 12, 2020
98d5aa5
minor changes
Aug 12, 2020
f6d2b73
add back removed files
Aug 12, 2020
6e7ed7d
wip
Aug 12, 2020
4aa07fd
wip
Aug 12, 2020
17b86e3
add setter to pass through setting
Aug 12, 2020
9749409
a test
Aug 12, 2020
025736b
wip
Aug 13, 2020
a92d09c
tests finally passing
Aug 14, 2020
356c2c0
add a serialize function redirect and remove the leftover workflow
Aug 14, 2020
5ea2238
move the upstream entities from
Aug 14, 2020
2a6a398
call local constructor in workflow
Aug 14, 2020
74f212e
wip
Aug 14, 2020
8582b6c
isort
Aug 14, 2020
a25c5f1
wip
Aug 14, 2020
1d604fb
wip
Aug 14, 2020
f2cbf4e
what
Aug 14, 2020
63b5f7d
run black and isort again
Aug 14, 2020
2df757a
ignore build
Aug 14, 2020
b2344f9
black exclusion dirs
Aug 14, 2020
fb477a7
3.6
Aug 14, 2020
e413be1
add back raw output stuff
Aug 14, 2020
03faf55
clean up
Aug 14, 2020
7068d73
fmt
Aug 14, 2020
9bc7e90
lint
Aug 14, 2020
6c08e62
add back test
Aug 14, 2020
f600a04
remove meta for now
Aug 14, 2020
ab7f746
wip
Aug 15, 2020
21c1cae
moving
Aug 15, 2020
50b40b8
make fmt
Aug 15, 2020
0c48927
remove bad comment
Aug 15, 2020
c2bc06b
remove part of the duplication with container objects
Aug 15, 2020
5492335
move output back to old file
Aug 16, 2020
2190a9d
Revert "move output back to old file"
Aug 17, 2020
0b7f0ce
comment
Aug 17, 2020
16aba83
made PythonWorkflow a subclass of SdkWorkflow just to see if it makes…
Aug 17, 2020
d1ba7de
changing around abcs
Aug 17, 2020
72b28d5
rename local to trackable
Aug 17, 2020
41771e4
changing around abcs once more
Aug 20, 2020
667782d
lint and fmt
Aug 20, 2020
e1df33c
merge in master again and pull katrina's changes
Aug 28, 2020
cda6ca7
merge master
Aug 31, 2020
d15e8c9
lint
Sep 1, 2020
3fce0ac
wip
Sep 4, 2020
bbf92e0
merge master and resolve conflicts
Sep 9, 2020
80a3a17
fmt
Sep 9, 2020
5b85549
revert
Sep 9, 2020
7ecaf58
add back cls override to workflow()
Sep 9, 2020
2f1fd89
always need to transform literal map
Sep 10, 2020
8ae8ec3
same early return fix for executions, but for inputs
Sep 10, 2020
4a3604f
refactoring non-engine uses of flyteclientmanager behind a helper fun…
Sep 11, 2020
5149145
type hinting
Sep 11, 2020
6e765b5
lint
Sep 11, 2020
a119929
remove rest of future stuff
Sep 11, 2020
99959b9
removing six metaclass
Sep 11, 2020
a4b8f56
removing six metaclass
Sep 11, 2020
6aa0f76
forgot to delete
Sep 11, 2020
b4bd176
forgot to delete
Sep 11, 2020
c285359
lint
Sep 11, 2020
cc0eef3
rename PythonWorkflow to SdkRunnableWorkflow, and add a long comment …
Sep 11, 2020
e7b23db
change deprecation message version to match
Sep 14, 2020
63b28a7
rename alias
Sep 14, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions flytekit/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
from __future__ import absolute_import
import logging as _logging

import flytekit.plugins # noqa: F401

__version__ = "0.12.6"
__version__ = "0.13.0b4"

logger = _logging.getLogger("flytekit")

# create console handler and set level to debug
ch = _logging.StreamHandler()
ch.setLevel(_logging.DEBUG)
Copy link
Contributor

Choose a reason for hiding this comment

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

do you want the level to be DEBUG?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup. At least for the beta releases right? I'd like to add a lot more debug statements and some info statements too. I'll make it info for the non-beta release.


# create formatter
formatter = _logging.Formatter("%(asctime)s-%(name)s-%(levelname)s$ %(message)s")

# add formatter to ch
ch.setFormatter(formatter)

# add ch to logger
logger.addHandler(ch)
2 changes: 0 additions & 2 deletions flytekit/bin/entrypoint.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import

import datetime as _datetime
import importlib as _importlib
import os as _os
Expand Down
2 changes: 0 additions & 2 deletions flytekit/clients/friendly.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import

import six as _six
from flyteidl.admin import common_pb2 as _common_pb2
from flyteidl.admin import execution_pb2 as _execution_pb2
Expand Down
2 changes: 0 additions & 2 deletions flytekit/clients/raw.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import

import logging as _logging

import six as _six
Expand Down
2 changes: 0 additions & 2 deletions flytekit/clis/auth/credentials.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import

import logging as _logging
import urllib.parse as _urlparse

Expand Down
2 changes: 0 additions & 2 deletions flytekit/clis/flyte_cli/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import

import importlib as _importlib
import os as _os
import stat as _stat
Expand Down
2 changes: 0 additions & 2 deletions flytekit/clis/helpers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import

import six as _six

from flytekit.common.types.helpers import get_sdk_type_from_literal_type as _get_sdk_type_from_literal_type
Expand Down
2 changes: 0 additions & 2 deletions flytekit/clis/sdk_in_container/basic_auth.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import

import base64 as _base64
import logging as _logging

Expand Down
2 changes: 0 additions & 2 deletions flytekit/clis/sdk_in_container/launch_plan.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import

import logging as _logging

import click
Expand Down
8 changes: 1 addition & 7 deletions flytekit/clis/sdk_in_container/pyflyte.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
from __future__ import absolute_import, print_function

import logging as _logging
import os as _os
from pathlib import Path

import click

try:
from pathlib import Path
except ImportError:
from pathlib2 import Path # python 2 backport

from flytekit.clis.sdk_in_container.constants import CTX_DOMAIN, CTX_PACKAGES, CTX_PROJECT, CTX_VERSION
from flytekit.clis.sdk_in_container.launch_plan import launch_plans
from flytekit.clis.sdk_in_container.register import register
Expand Down
2 changes: 0 additions & 2 deletions flytekit/clis/sdk_in_container/register.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import

import logging as _logging

import click
Expand Down
2 changes: 0 additions & 2 deletions flytekit/clis/sdk_in_container/serialize.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, print_function

import logging as _logging
import math as _math
import os as _os
Expand Down
8 changes: 2 additions & 6 deletions flytekit/common/component_nodes.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
from __future__ import absolute_import

import logging as _logging

import six as _six

from flytekit.common import sdk_bases as _sdk_bases
from flytekit.common.exceptions import system as _system_exceptions
from flytekit.models.core import workflow as _workflow_model


class SdkTaskNode(_six.with_metaclass(_sdk_bases.ExtendedSdkType, _workflow_model.TaskNode)):
class SdkTaskNode(_workflow_model.TaskNode, metaclass=_sdk_bases.ExtendedSdkType):
def __init__(self, sdk_task):
"""
:param flytekit.common.tasks.task.SdkTask sdk_task:
Expand Down Expand Up @@ -60,7 +56,7 @@ def promote_from_model(cls, base_model, tasks):
return cls(sdk_task)


class SdkWorkflowNode(_six.with_metaclass(_sdk_bases.ExtendedSdkType, _workflow_model.WorkflowNode)):
class SdkWorkflowNode(_workflow_model.WorkflowNode, metaclass=_sdk_bases.ExtendedSdkType):
def __init__(self, sdk_workflow=None, sdk_launch_plan=None):
"""
:param flytekit.common.workflow.SdkWorkflow sdk_workflow:
Expand Down
2 changes: 0 additions & 2 deletions flytekit/common/constants.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import

INPUT_FILE_NAME = "inputs.pb"
OUTPUT_FILE_NAME = "outputs.pb"
FUTURES_FILE_NAME = "futures.pb"
Expand Down
12 changes: 3 additions & 9 deletions flytekit/common/core/identifier.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
from __future__ import absolute_import

import six as _six

from flytekit.common import sdk_bases as _sdk_bases
from flytekit.common.exceptions import user as _user_exceptions
from flytekit.models.core import identifier as _core_identifier


class Identifier(_six.with_metaclass(_sdk_bases.ExtendedSdkType, _core_identifier.Identifier)):
class Identifier(_core_identifier.Identifier, metaclass=_sdk_bases.ExtendedSdkType):

_STRING_TO_TYPE_MAP = {
"lp": _core_identifier.ResourceType.LAUNCH_PLAN,
Expand Down Expand Up @@ -61,9 +59,7 @@ def __str__(self):
)


class WorkflowExecutionIdentifier(
_six.with_metaclass(_sdk_bases.ExtendedSdkType, _core_identifier.WorkflowExecutionIdentifier)
):
class WorkflowExecutionIdentifier(_core_identifier.WorkflowExecutionIdentifier, metaclass=_sdk_bases.ExtendedSdkType):
@classmethod
def promote_from_model(cls, base_model):
"""
Expand Down Expand Up @@ -101,9 +97,7 @@ def __str__(self):
return "ex:{}:{}:{}".format(self.project, self.domain, self.name)


class TaskExecutionIdentifier(
_six.with_metaclass(_sdk_bases.ExtendedSdkType, _core_identifier.TaskExecutionIdentifier)
):
class TaskExecutionIdentifier(_core_identifier.TaskExecutionIdentifier, metaclass=_sdk_bases.ExtendedSdkType):
@classmethod
def promote_from_model(cls, base_model):
"""
Expand Down
7 changes: 1 addition & 6 deletions flytekit/common/exceptions/base.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
from __future__ import absolute_import

import six as _six


class _FlyteCodedExceptionMetaclass(type):
@property
def error_code(cls):
return cls._ERROR_CODE


class FlyteException(_six.with_metaclass(_FlyteCodedExceptionMetaclass, Exception)):
class FlyteException(Exception, metaclass=_FlyteCodedExceptionMetaclass):
_ERROR_CODE = "UnknownFlyteException"


Expand Down
2 changes: 0 additions & 2 deletions flytekit/common/exceptions/scopes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import

from sys import exc_info as _exc_info
from traceback import format_tb as _format_tb

Expand Down
2 changes: 0 additions & 2 deletions flytekit/common/exceptions/system.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import

from flytekit.common.exceptions import base as _base_exceptions


Expand Down
2 changes: 0 additions & 2 deletions flytekit/common/exceptions/user.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import

from flytekit.common.exceptions.base import FlyteException as _FlyteException
from flytekit.common.exceptions.base import FlyteRecoverableException as _Recoverable

Expand Down
6 changes: 2 additions & 4 deletions flytekit/common/interface.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import

import six as _six

from flytekit.common import promise as _promise
Expand All @@ -12,7 +10,7 @@
from flytekit.models import literals as _literal_models


class BindingData(_six.with_metaclass(_sdk_bases.ExtendedSdkType, _literal_models.BindingData)):
class BindingData(_literal_models.BindingData, metaclass=_sdk_bases.ExtendedSdkType):
@staticmethod
def _has_sub_bindings(m):
"""
Expand Down Expand Up @@ -96,7 +94,7 @@ def from_python_std(cls, literal_type, t_value, upstream_nodes=None):
return cls(scalar=scalar, collection=collection, map=map, promise=promise)


class TypedInterface(_six.with_metaclass(_sdk_bases.ExtendedSdkType, _interface_models.TypedInterface)):
class TypedInterface(_interface_models.TypedInterface, metaclass=_sdk_bases.ExtendedSdkType):
@classmethod
def promote_from_model(cls, model):
"""
Expand Down
Loading