From 4866b42f266979ef3f3ba1290d8589bbf12ce92f Mon Sep 17 00:00:00 2001 From: Future-Outlier Date: Tue, 17 Sep 2024 13:46:05 +0800 Subject: [PATCH] update flytectl part by Yee's advice Signed-off-by: Future-Outlier --- .../5741-binary-idl-with-message-pack.md | 33 +++++++++++++++++-- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/rfc/system/5741-binary-idl-with-message-pack.md b/rfc/system/5741-binary-idl-with-message-pack.md index 318face3f9d..d81eeb95c26 100644 --- a/rfc/system/5741-binary-idl-with-message-pack.md +++ b/rfc/system/5741-binary-idl-with-message-pack.md @@ -448,11 +448,11 @@ my_dc.model_json_schema() ``` ### FlyteCtl + In FlyteCtl, we can construct input for the execution. -We can construct a `Binary IDL Object` when we receive `SimpleType.STRUCT`. +When we receive `SimpleType.STRUCT`, we can construct a `Binary IDL Object` using the following logic in `flyteidl/clients/go/coreutils/literals.go`: -In `flyteidl/clients/go/coreutils/literals.go`: ```go if newT.Simple == core.SimpleType_STRUCT { if _, isValueStringType := v.(string); !isValueStringType { @@ -463,7 +463,34 @@ if newT.Simple == core.SimpleType_STRUCT { strValue = string(byteValue) } } -``` +``` + +This is how users can create an execution by using a YAML file: +```bash +flytectl create execution --execFile ./flytectl/create_dataclass_task.yaml -p flytesnacks -d development +``` + +Example YAML file (`create_dataclass_task.yaml`): +```yaml +iamRoleARN: "" +inputs: + input: + a: 1 + b: 3.14 + c: example_string + d: + "1": 100 + "2": 200 + e: + a: 1 + b: 3.14 +envs: {} +kubeServiceAcct: "" +targetDomain: "" +targetProject: "" +task: dataclass_example.dataclass_task +version: OSyTikiBTAkjBgrL5JVOVw +``` ### FlyteConsole #### Show input/output on FlyteConsole