Skip to content

feature: alternate approach to environment force-rebuild #2443

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

saikonen
Copy link
Collaborator

@saikonen saikonen commented Jun 5, 2025

adds a top-level option to toggle force-rebuilding the environment

python HelloConda.py --environment conda --force-rebuild-environment run

the introduction of the new option is not mandatory. we could simply proceed with an internal envvar to enable the functionality for now.

metaflow/cli.py Outdated
@@ -242,6 +243,14 @@ def version(obj):
type=click.Choice(["local"] + [m.TYPE for m in ENVIRONMENTS]),
help="Execution environment type",
)
@click.option(
"--force-rebuild-environment/--no-force-rebuild-environment",
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we change this to --rebuild-environments

Copy link
Collaborator

Choose a reason for hiding this comment

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

actually, nvm. let's keep the force, otherwise --no-rebuild-environments takes a different meaning altogether. tiny nit - --force-rebuild-environments since there can be more than one.

metaflow/cli.py Outdated
default=False,
hidden=True,
type=bool,
help="Force rebuild the environment",
Copy link
Collaborator

Choose a reason for hiding this comment

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

explicitly rebuild the execution environments

metaflow/cli.py Outdated
@@ -432,6 +442,9 @@ def start(

ctx.obj.graph = ctx.obj.flow._graph

# carry the force rebuild as an internal env var for generic environments to use
if force_rebuild_environment:
os.environ["_MFENV_FORCE_REBUILD"] = "1"
Copy link
Collaborator

Choose a reason for hiding this comment

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

_METAFLOW_ENVIRONMENT_FORCE_REBUILD? MFENV will very soon have different connotations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants