Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Netflix/metaflow into fea…
Browse files Browse the repository at this point in the history
…ture/enable-subclassing-flows
  • Loading branch information
romain-intel committed Dec 3, 2024
2 parents 3b1c1eb + 286f9ac commit 8840bd2
Show file tree
Hide file tree
Showing 60 changed files with 2,277 additions and 1,312 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-20.04]
ver: ['4.4']
ver: ['4.4.1']

steps:
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
Expand Down
5 changes: 2 additions & 3 deletions metaflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@ class and related decorators.
# Flow spec
from .flowspec import FlowSpec

from .parameters import Parameter, JSONTypeClass

JSONType = JSONTypeClass()
from .parameters import Parameter, JSONTypeClass, JSONType

# data layer
# For historical reasons, we make metaflow.plugins.datatools accessible as
Expand Down Expand Up @@ -149,6 +147,7 @@ class and related decorators.
from .runner.metaflow_runner import Runner
from .runner.nbrun import NBRunner
from .runner.deployer import Deployer
from .runner.deployer import DeployedFlow
from .runner.nbdeploy import NBDeployer

__ext_tl_modules__ = []
Expand Down
56 changes: 42 additions & 14 deletions metaflow/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,20 @@ def resume(
if runtime.should_skip_clone_only_execution():
return

current._update_env(
{
"run_id": runtime.run_id,
}
)
_system_logger.log_event(
level="info",
module="metaflow.resume",
name="start",
payload={
"msg": "Resuming run",
},
)

with runtime.run_heartbeat():
if clone_only:
runtime.clone_original_run()
Expand Down Expand Up @@ -776,20 +790,34 @@ def run(
write_file(run_id_file, runtime.run_id)

obj.flow._set_constants(obj.graph, kwargs)
runtime.print_workflow_info()
runtime.persist_constants()

if runner_attribute_file:
with open(runner_attribute_file, "w", encoding="utf-8") as f:
json.dump(
{
"run_id": runtime.run_id,
"flow_name": obj.flow.name,
"metadata": obj.metadata.metadata_str(),
},
f,
)
runtime.execute()
current._update_env(
{
"run_id": runtime.run_id,
}
)
_system_logger.log_event(
level="info",
module="metaflow.run",
name="start",
payload={
"msg": "Starting run",
},
)
with runtime.run_heartbeat():
runtime.print_workflow_info()
runtime.persist_constants()

if runner_attribute_file:
with open(runner_attribute_file, "w", encoding="utf-8") as f:
json.dump(
{
"run_id": runtime.run_id,
"flow_name": obj.flow.name,
"metadata": obj.metadata.metadata_str(),
},
f,
)
runtime.execute()


def write_file(file_path, content):
Expand Down
4 changes: 2 additions & 2 deletions metaflow/client/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
from .filecache import FileCache

if TYPE_CHECKING:
from metaflow.metadata import MetadataProvider
from metaflow.metadata_provider import MetadataProvider

try:
# python2
Expand Down Expand Up @@ -143,7 +143,7 @@ def default_metadata() -> str:
if default:
current_metadata = default[0]
else:
from metaflow.plugins.metadata import LocalMetadataProvider
from metaflow.plugins.metadata_providers import LocalMetadataProvider

current_metadata = LocalMetadataProvider
return get_metadata()
Expand Down
2 changes: 1 addition & 1 deletion metaflow/clone_util.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import time
from .metadata import MetaDatum
from .metadata_provider import MetaDatum


def clone_task_helper(
Expand Down
Loading

0 comments on commit 8840bd2

Please sign in to comment.