Skip to content

Commit

Permalink
Symlink the INFO file in Conda environments (#809)
Browse files Browse the repository at this point in the history
This allows for better Metaflow version information.

Black reformating from previous commits
  • Loading branch information
romain-intel committed Jan 5, 2022
1 parent 4ba77d0 commit 53ab9d4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions metaflow/plugins/conda/conda_step_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,16 @@ def _architecture(self, decos):
def runtime_init(self, flow, graph, package, run_id):
# Create a symlink to installed version of metaflow to execute user code against
path_to_metaflow = os.path.join(get_metaflow_root(), "metaflow")
path_to_info = os.path.join(get_metaflow_root(), "INFO")
self.metaflow_home = tempfile.mkdtemp(dir="/tmp")
self.addl_paths = None
os.symlink(path_to_metaflow, os.path.join(self.metaflow_home, "metaflow"))

# Also symlink the INFO version to properly propagate down version information
# from, for example, a step-function execution
if os.path.isfile(path_to_info):
os.symlink(path_to_info, os.path.join(self.metaflow_home, "INFO"))

# Do the same for metaflow_extensions
try:
import metaflow_extensions as m
Expand Down

0 comments on commit 53ab9d4

Please sign in to comment.