Hello, could somebody help me debug connection to the flyte cluster? I’ve just deployed flyte-binary...
a

Amadeusz Lisiecki

over 2 years ago
Hello, could somebody help me debug connection to the flyte cluster? I’ve just deployed flyte-binary following this guide. I’ve already run some workflows but now I’ve added ingress configuration, so I don’t have to run port-forward every time:
ingress:
  create: true
  commonAnnotations:
    <http://kubernetes.io/ingress.class|kubernetes.io/ingress.class>: internal
    <http://nginx.ingress.kubernetes.io/force-ssl-redirect|nginx.ingress.kubernetes.io/force-ssl-redirect>: "true"
  httpAnnotations:
    <http://nginx.ingress.kubernetes.io/app-root|nginx.ingress.kubernetes.io/app-root>: /console
  grpcAnnotations:
    <http://nginx.ingress.kubernetes.io/backend-protocol|nginx.ingress.kubernetes.io/backend-protocol>: GRPC
  host: <http://flyte-dev.internal.qa-knowledge-base-coin-dev.z-dn.net|flyte-dev.internal.qa-knowledge-base-coin-dev.z-dn.net>
Console works just fine but I get these errors from flytectl:
$ flytectl config init --host <http://flyte-dev.internal.qa-knowledge-base-coin-dev.z-dn.net|flyte-dev.internal.qa-knowledge-base-coin-dev.z-dn.net>
...
$ flytectl get project
Error: Connection Info: [Endpoint: dns:///flyte-dev.internal.qa-knowledge-base-coin-dev.z-dn.net, InsecureConnection?: false, AuthMode: Pkce]: rpc error: code = Unknown desc = unexpected HTTP status code received from server: 464 (); malformed header: missing HTTP content-type

OR
$ flytectl config init --host <http://flyte-dev.internal.qa-knowledge-base-coin-dev.z-dn.net|flyte-dev.internal.qa-knowledge-base-coin-dev.z-dn.net> --insecure
...
$ flytectl get project
Error: Connection Info: [Endpoint: dns:///flyte-dev.internal.qa-knowledge-base-coin-dev.z-dn.net, InsecureConnection?: true, AuthMode: Pkce]: rpc error: code = Unavailable desc = connection closed before server preface received
Any suggestions?
Hello, I have defined a Flyte workflow which calls a few flyte Tasks. All but one tasks return a str...
r

Ruchir Sachdeva

about 2 years ago
Hello, I have defined a Flyte workflow which calls a few flyte Tasks. All but one tasks return a string, and one task,
ingest_reports
, returns a
List[Dict[str, str]]
. Furthermore in my workflow, I have
>>
operator defining the sequence of task execution. Now when I test the workflow, I have a couple of questions: 1. When I test the workflow, I want to mock the task calls. Now,
>>
operator defines the sequence of task execution, and it expects the tasks to return a Promise. Since a Promise is expected, so the mocked task should be able to return a Promise, otherwise this operation fails with an error like:
except Exception as exc:
>                   raise type(exc)(f"Error encountered while executing '{fn_name}':\n  {exc}") from exc
E                   AttributeError: Error encountered while executing 'phishing_reports_workflow':
E                     'list' object has no attribute 'ref'
2. To do so I defined the mock as below:
def mock_promise(value: any):
        magic_mock_promise = MagicMock(spec=Promise)
        mock_output = MagicMock()
        mock_output.value = value
        magic_mock_promise.output = mock_output
        return magic_mock_promise
3. This mocking of tasks to return a FlytePromise works fine as long as task return type is a String. For the task,
ingest_reports
, return type is
List[Dict[str, str]]
. When I try to mock the response of
ingest_reports
using
mock_promise
above, by passing in a list of dict of strings, it fails with exception below:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = Typed List Transforms (<class 'list'>) to Flyte native
ctx = FlyteContext(file_access=<flytekit.core.data_persistence.FileAccessProvider object at 0x103772730>, level=1, flyte_cli...tackframe=<FrameSummary file /Library/Python/3.9/site-packages/flytekit/core/context_manager.py, line 877 in <module>>)
python_val = <MagicMock name='ingest_phishing_reports()' spec='Promise' id='5383586432'>
python_type = typing.List[typing.Dict[str, str]]
expected = <FlyteLiteral collection_type { map_value_type { simple: STRING } }>

    def to_literal(self, ctx: FlyteContext, python_val: T, python_type: Type[T], expected: LiteralType) -> Literal:
        if type(python_val) != list:
>           raise TypeTransformerFailedError("Expected a list")
E           flytekit.core.type_engine.TypeTransformerFailedError: Expected a list

/Library/Python/3.9/site-packages/flytekit/core/type_engine.py:1042: TypeTransformerFailedError
Any help on how to solve this?