GitHub
07/08/2023, 2:29 PM<https://github.com/flyteorg/flyte-conference-talks/tree/main|main>
by cosmicBboy
<https://github.com/flyteorg/flyte-conference-talks/commit/7af619956a0d733870a7ac9264b24106c6e3daec|7af61995>
- debug
flyteorg/flyte-conference-talksGitHub
07/08/2023, 2:39 PM<https://github.com/flyteorg/flyte-conference-talks/tree/main|main>
by cosmicBboy
<https://github.com/flyteorg/flyte-conference-talks/commit/a8dbcc36184b2a7bafd4f6ffb1a645d1680b3291|a8dbcc36>
- debug
flyteorg/flyte-conference-talksGitHub
07/08/2023, 2:48 PM<https://github.com/flyteorg/flyte-conference-talks/tree/main|main>
by cosmicBboy
<https://github.com/flyteorg/flyte-conference-talks/commit/c3e6e1719c1aabafe2465243cc5c81fe5f664ab1|c3e6e171>
- debug
flyteorg/flyte-conference-talksGitHub
07/08/2023, 3:04 PM<https://github.com/flyteorg/flyte-conference-talks/tree/main|main>
by cosmicBboy
<https://github.com/flyteorg/flyte-conference-talks/commit/13be53bdbb02b73be51a214fb3b9e39ece16b305|13be53bd>
- debug
flyteorg/flyte-conference-talksGitHub
07/08/2023, 3:22 PM<https://github.com/flyteorg/flyte-conference-talks/tree/main|main>
by cosmicBboy
<https://github.com/flyteorg/flyte-conference-talks/commit/99342541dbe37ae0873b30931890472d0d53ec5a|99342541>
- debug
flyteorg/flyte-conference-talksGitHub
07/08/2023, 4:00 PMGitHub
07/08/2023, 4:10 PMSecret
object:
• env_var
• file
Allowing users to directly specify a name or mountPath for the Secret, without having to specify a full PodTemplate(name). The old mount_requirement
can still be used. Example:
from flytekit import task, workflow, Secret
import flytekit
import os
@task(
secret_requests=[
Secret(
group="user-info",
key="user_secret",
mount_requirement=Secret.MountType.FILE,
),
Secret(
group="user-info",
key="user_secret",
mount_requirement=Secret.MountType.ENV_VAR,
),
]
)
def old() -> None:
context = flytekit.current_context()
print("old")
# mount_requirement=ENV_VAR
print(context.secrets.get(env_name="_FSEC_USER-INFO_USER_SECRET"))
# mount_requirement=FILE
with open('/etc/flyte/secrets/user-info/user_secret', 'r') as infile:
print(infile.readlines())
return True
@task(
secret_requests=[
Secret(
group="user-info",
key="user_secret",
env_var=Secret.MountEnvVar(name="foo"),
),
Secret(
group="user-info",
key="user_secret",
file=Secret.MountFile(path="/foo"),
),
]
)
def new() -> None:
context = flytekit.current_context()
print("new")
# env_var=
print(context.secrets.get(env_name="foo"))
# file=
with open('/foo/user_secret', 'r') as infile:
print(infile.readlines())
@workflow
def training_workflow(hyperparameters: dict) -> None:
"""Put all of the steps together into a single workflow."""
old()
new()
Type
☐ Bug Fix
☑︎ Feature
☐ Plugin
Are all requirements met?
☑︎ Code completed
☑︎ Smoke tested
☑︎ Unit tests added
☑︎ Code documentation added
☑︎ Any pending items have an associated Issue
Complete description
How did you fix the bug, make the feature etc. Link to any design docs etc
Tracking Issue
fixes flyteorg/flyte#3053
Follow-up issue
NA
flyteorg/flytekit
✅ All checks have passed
2/2 successful checksGitHub
07/08/2023, 9:32 PMFlyteContext
with LOCAL_TASK_EXECUTION
for @task
,and LOCAL_WORKFLOW_EXECUTION
if it is @workflow
.
2. If flyte_entity_call_handler
is invoked inside LOCAL_TASK_EXECUTION
or TASK_EXECUTION
, that means it is called inside @task
, warn the users of nested @tasks/@workflows
.
Created a helper function is_local_execution()
to shorthand the checks.
Tracking Issue
flyteorg/flyte#3734
Follow-up issue
The *call*() function in remote_callable and reference_entity duplicates and can be replaced with flyte_entity_call_handler
as well in the future.
flyteorg/flytekit
✅ All checks have passed
2/2 successful checksGitHub
07/09/2023, 12:39 AM<https://github.com/flyteorg/flyte-conference-talks/tree/main|main>
by cosmicBboy
<https://github.com/flyteorg/flyte-conference-talks/commit/1e24d3e067a75b11e2019189e88c8e37bdab6a41|1e24d3e0>
- debug
flyteorg/flyte-conference-talksGitHub
07/09/2023, 12:56 AM<https://github.com/flyteorg/flyte-conference-talks/tree/main|main>
by cosmicBboy
<https://github.com/flyteorg/flyte-conference-talks/commit/970f3e5b2be237d14dec1b5e8885d697610ee922|970f3e5b>
- update ephemeral storage
flyteorg/flyte-conference-talksGitHub
07/09/2023, 1:48 AM<https://github.com/flyteorg/flyte-conference-talks/tree/main|main>
by cosmicBboy
<https://github.com/flyteorg/flyte-conference-talks/commit/bac9c47fe022adb3e720670aa148c8325d9474ac|bac9c47f>
- debug
flyteorg/flyte-conference-talksGitHub
07/09/2023, 2:12 AM<https://github.com/flyteorg/flyte-conference-talks/tree/main|main>
by cosmicBboy
<https://github.com/flyteorg/flyte-conference-talks/commit/9c14da770a8fcbf827c48a5e3c0eb4f85fa94928|9c14da77>
- debug
flyteorg/flyte-conference-talksGitHub
07/09/2023, 2:26 AM<https://github.com/flyteorg/flyte-conference-talks/tree/main|main>
by cosmicBboy
<https://github.com/flyteorg/flyte-conference-talks/commit/90ed27f41eef295542f2e0a2e55159eedd68e6f6|90ed27f4>
- debug
flyteorg/flyte-conference-talksGitHub
07/09/2023, 2:51 AM<https://github.com/flyteorg/flyte-conference-talks/tree/main|main>
by cosmicBboy
<https://github.com/flyteorg/flyte-conference-talks/commit/3a665bd501f802f19bc4f24acf205a9084179a3a|3a665bd5>
- only run unit tests
flyteorg/flyte-conference-talksGitHub
07/09/2023, 2:52 AM<https://github.com/flyteorg/flyte-conference-talks/tree/main|main>
by cosmicBboy
<https://github.com/flyteorg/flyte-conference-talks/commit/577b24acd11fd0790616cb2efb841adc1ab7beae|577b24ac>
- remove ephemeral storage
flyteorg/flyte-conference-talksGitHub
07/09/2023, 3:12 AM<https://github.com/flyteorg/flyte-conference-talks/tree/main|main>
by cosmicBboy
<https://github.com/flyteorg/flyte-conference-talks/commit/90867d2617f5e4158c80d876526f96660f5a75c0|90867d26>
- testing setup flyte sandbox
flyteorg/flyte-conference-talksGitHub
07/09/2023, 4:15 AMGitHub
07/09/2023, 5:00 AMGitHub
07/09/2023, 7:08 PM<https://github.com/flyteorg/flyte-conference-talks/tree/main|main>
by cosmicBboy
<https://github.com/flyteorg/flyte-conference-talks/commit/d8d3fa508a4a682c44cf8497a85c04e8023a903e|d8d3fa50>
- wip
<https://github.com/flyteorg/flyte-conference-talks/commit/4a57822cf04f4f6e734d39c7bb56d1c709ce35ad|4a57822c>
- add flytekitplugins envd
<https://github.com/flyteorg/flyte-conference-talks/commit/79a335bd4a9795ab703be3b600036a33bfbd6392|79a335bd>
- wip
<https://github.com/flyteorg/flyte-conference-talks/commit/eaf9dc592ea10fc68ad1eeaeee80985c2d01fb95|eaf9dc59>
- add back integration tests
<https://github.com/flyteorg/flyte-conference-talks/commit/b8215a3dd390ea6978ead9eb35f243d1c8b73e04|b8215a3d>
- debug
<https://github.com/flyteorg/flyte-conference-talks/commit/b7b217c231e5ac3294a755c58989acc5c5db3df4|b7b217c2>
- debug
<https://github.com/flyteorg/flyte-conference-talks/commit/90093ccaf2ff2eb5123b6835e918aae17ff99c11|90093cca>
- matrix
<https://github.com/flyteorg/flyte-conference-talks/commit/a8b3a19d54a2fd8e9c08eae51c47e7ec2e193902|a8b3a19d>
- fix typing Annotated
<https://github.com/flyteorg/flyte-conference-talks/commit/c9ab0da63d161cc2e905d6fd1e84f7ff860b971a|c9ab0da6>
- debug
<https://github.com/flyteorg/flyte-conference-talks/commit/d52f124990c627d0373467664b1706e6fb517ef6|d52f1249>
- debug
<https://github.com/flyteorg/flyte-conference-talks/commit/edad4db0aa0242a9cc6818fa74a23688c7b6e693|edad4db0>
- add poll interval
<https://github.com/flyteorg/flyte-conference-talks/commit/e8ace0157cb92bf160b161388cb072053bf21aea|e8ace015>
- update readme
<https://github.com/flyteorg/flyte-conference-talks/commit/009f7b7969de1425b4cd7c387723a0fdd0ead478|009f7b79>
- add sandbox make command
<https://github.com/flyteorg/flyte-conference-talks/commit/8a8496c7ed19f6b045ca3cf90e508be8cf977c0c|8a8496c7>
- Merge pull request #5 from flyteorg/add-integration-tests
flyteorg/flyte-conference-talksGitHub
07/10/2023, 1:38 AM<https://github.com/flyteorg/flyte-conference-talks/tree/main|main>
by cosmicBboy
<https://github.com/flyteorg/flyte-conference-talks/commit/1ec3833af373d9350d4ca2b6f16c83d680a3fc1d|1ec3833a>
- update resources, makefile
flyteorg/flyte-conference-talksGitHub
07/10/2023, 9:56 AM<https://github.com/flyteorg/flyte/tree/master|master>
by samhita-alla
<https://github.com/flyteorg/flyte/commit/49868b670e45eba0b72387849f7e172378c5c1a1|49868b67>
- Doc: gang-scheduling for kubeflow training-operator (#3851)
flyteorg/flyteGitHub
07/10/2023, 9:58 AM@task(
task_config=Databricks(
databricks_conf={
"run_name": "dbx simplified example",
"existing_cluster_id": "<my-existing-cluster-id>",
"timeout_seconds": 3600,
"max_retries": 1,
}
),
limits=Resources(mem="2000M"),
cache_version="1",
)
def print_spark_config():
spark = flytekit.current_context().spark_session
print(spark.sparkContext.getConf().getAll())
@workflow
def my_databricks_job():
print_spark_config()
STEPS:
• Run workflow: pyflyte --verbose run --remote --destination-dir . dbx_simplified_example.py my_databricks_job
ISSUE:
Databricks job run triggered and failed with this error:
_TypeError: loader must define exec_module()_
ERROR LOG:
TypeError: loader must define exec_module()
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<command--1> in <cell line: 12>()
11
12 with open(filename, "rb") as f:
---> 13 exec(compile(f.read(), filename, 'exec'))
14
/tmp/tmptkt83uf9.py in <module>
4
5 import click
----> 6 from flytekit.bin.entrypoint import fast_execute_task_cmd as _fast_execute_task_cmd
7 from flytekit.bin.entrypoint import execute_task_cmd as _execute_task_cmd
8 from flytekit.exceptions.user import FlyteUserException
/databricks/python_shell/dbruntime/PythonPackageImportsInstrumentation/__init__.py in import_patch(name, globals, locals, fromlist, level)
169 # Import the desired module. If you’re seeing this while debugging a failed import,
170 # look at preceding stack frames for relevant error information.
--> 171 original_result = python_builtin_import(name, globals, locals, fromlist, level)
172
173 is_root_import = thread_local._nest_level == 1
/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/flytekit/__init__.py in <module>
226 from flytekit.core.workflow import ImperativeWorkflow as Workflow
227 from flytekit.core.workflow import WorkflowFailurePolicy, reference_workflow, workflow
--> 228 from flytekit.deck import Deck
229 from flytekit.image_spec import ImageSpec
230 from flytekit.loggers import logger
/databricks/python_shell/dbruntime/PythonPackageImportsInstrumentation/__init__.py in import_patch(name, globals, locals, fromlist, level)
169 # Import the desired module. If you’re seeing this while debugging a failed import,
170 # look at preceding stack frames for relevant error information.
--> 171 original_result = python_builtin_import(name, globals, locals, fromlist, level)
172
173 is_root_import = thread_local._nest_level == 1
/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/flytekit/deck/__init__.py in <module>
16
17 from .deck import Deck
---> 18 from .renderer import TopFrameRenderer
/databricks/python_shell/dbruntime/PythonPackageImportsInstrumentation/__init__.py in import_patch(name, globals, locals, fromlist, level)
169 # Import the desired module. If you’re seeing this while debugging a failed import,
170 # look at preceding stack frames for relevant error information.
--> 171 original_result = python_builtin_import(name, globals, locals, fromlist, level)
172
173 is_root_import = thread_local._nest_level == 1
/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/flytekit/deck/renderer.py in <module>
10 import pyarrow
11 else:
---> 12 pandas = lazy_module("pandas")
13 pyarrow = lazy_module("pyarrow")
14
/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/flytekit/lazy_import/lazy_module.py in lazy_module(fullname)
25 # <https://docs.python.org/3/library/importlib.html#implementing-lazy-imports>
26 spec = importlib.util.find_spec(fullname)
---> 27 loader = importlib.util.LazyLoader(spec.loader)
28 spec.loader = loader
29 module = importlib.util.module_from_spec(spec)
/usr/lib/python3.9/importlib/util.py in __init__(self, loader)
280
281 def __init__(self, loader):
--> 282 self.__check_eager_loader(loader)
283 self.loader = loader
284
/usr/lib/python3.9/importlib/util.py in __check_eager_loader(loader)
271 def __check_eager_loader(loader):
272 if not hasattr(loader, 'exec_module'):
--> 273 raise TypeError('loader must define exec_module()')
274
275 @classmethod
TypeError: loader must define exec_module()
Expected behavior
Databricks job triggered, workflow successfully completed.
Additional context to reproduce
I suspect the entrypoint.py referred in Databricks Plugin Setup guide is not compatible with Flyte 1.7.0.
Screenshots
No response
Are you sure this issue hasn't been raised already?
☑︎ Yes
Have you read the Code of Conduct?
☑︎ Yes
flyteorg/flyteGitHub
07/10/2023, 10:15 AMScreenshot 2023-07-10 at 5 58 44 PM▾
image▾
GitHub
07/10/2023, 10:50 AMGitHub
07/10/2023, 11:19 AM@task(
task_config=Databricks(
databricks_conf={
"run_name": "dbx simplified example",
"existing_cluster_id": "<my-existing-cluster-id>",
"timeout_seconds": 3600,
"max_retries": 1,
}
),
limits=Resources(mem="2000M"),
cache_version="1",
)
def print_spark_config():
spark = flytekit.current_context().spark_session
print(spark.sparkContext.getConf().getAll())
@workflow
def my_databricks_job():
print_spark_config()
STEPS:
• Run workflow: pyflyte --verbose run --remote --destination-dir . dbx_simplified_example.py my_databricks_job
ISSUE:
Databricks job run triggered and successfully completed, but the Flyte job status is not updated, it is stuck in RUNNING
state.
Expected behavior
Flyte job status keeps updated.
Additional context to reproduce
Please note that we tried to upgrade Flyte to v1.7.0:
• when I also upgraded the Flyte packages on the Databricks cluster to 1.7.0 -> #3853
• when I used the 1.5.0 Flyte packages on the Databricks cluster -> same issue - Databricks job successfully completed, but Flyte job keeps running forever
Screenshots
No response
Are you sure this issue hasn't been raised already?
☑︎ Yes
Have you read the Code of Conduct?
☑︎ Yes
flyteorg/flyteGitHub
07/10/2023, 12:42 PM<https://github.com/flyteorg/flyte-conference-talks/tree/main|main>
by cosmicBboy
<https://github.com/flyteorg/flyte-conference-talks/commit/4b020a1e75dd2de91f3c29d686615b8a30b81ad3|4b020a1e>
- update readme
flyteorg/flyte-conference-talksGitHub
07/10/2023, 1:11 PM<https://github.com/flyteorg/flyte-conference-talks/tree/main|main>
by cosmicBboy
<https://github.com/flyteorg/flyte-conference-talks/commit/1b1d33eff5140c8a3c4a3c5821ec522000decafd|1b1d33ef>
- update readme
flyteorg/flyte-conference-talksGitHub
07/10/2023, 1:24 PMpyflyte run
to indicate that it is no longer limited to single-script execution.
flyteorg/flytesnacks
GitHub Actions: Docs Warnings
✅ 2 other checks have passed
2/3 successful checksGitHub
07/10/2023, 1:28 PMGitHub
07/10/2023, 1:38 PM<https://github.com/flyteorg/flyte-conference-talks/tree/main|main>
by cosmicBboy
<https://github.com/flyteorg/flyte-conference-talks/commit/d9f1da172272786ebd8b1f10a57312abc7d68758|d9f1da17>
- update resource reqs for example 10
flyteorg/flyte-conference-talks