|
85 | 85 |
|
86 | 86 | # If you don't want Mlflow, just add `-e MLFLOW_PORT=0` to `docker run` |
87 | 87 | if MLFLOW_PORT != 0: |
88 | | - mlflow_artifacts_path = f"{ARTIFACTS_FOLDER}/mlflow-artifacts" |
| 88 | + mlflow_artifacts_path = f"{ARTIFACTS_FOLDER}/mlflow-artifacts-{meta_trial_number}" |
89 | 89 | Path(mlflow_artifacts_path).mkdir(parents=True, exist_ok=True) |
90 | | - mlflow_backend_path = f"{ARTIFACTS_FOLDER}/mlruns" |
91 | | - Path(mlflow_backend_path).mkdir(parents=True, exist_ok=True) |
| 90 | + mlflow_db_path= f"{ARTIFACTS_FOLDER}/mlruns-{meta_trial_number}" |
| 91 | + Path(mlflow_db_path).mkdir(parents=True, exist_ok=True) |
92 | 92 |
|
93 | 93 | cmd = "".join([ |
94 | 94 | "mlflow server ", |
95 | 95 | "--host 0.0.0.0 ", |
96 | 96 | f"--port {str(MLFLOW_PORT)} ", |
97 | | - f"--default-artifact-root {str(mlflow_artifacts_path)} ", |
98 | | - f"--backend-store-uri {str(mlflow_backend_path)} &" |
| 97 | + f"--default-artifact-root {mlflow_artifacts_path} ", |
| 98 | + f"--backend-store-uri sqlite:////{mlflow_db_path} &" # NOTE THE 4 SLASHES |
99 | 99 | ]) |
100 | 100 |
|
101 | 101 | answer = subprocess.run(cmd, shell=True) |
|
560 | 560 | train_data_dtype=tf.int32, |
561 | 561 | merging_strategy='concatenate') # "mhc") |
562 | 562 |
|
563 | | -experiment = mlflow.get_experiment_by_name(MLFLOW_EXPERIMENT_NAME) |
564 | | -if experiment: |
565 | | - experiment_id = experiment.experiment_id |
566 | | -else: |
567 | | - # Handle the case where the experiment doesn't exist, e.g., create it |
568 | | - experiment_id = mlflow.create_experiment(MLFLOW_EXPERIMENT_NAME) |
569 | | - |
570 | | -print(f"Attempting to start run in Experiment ID: {experiment_id}") |
571 | | -print(f"Current Tracking URI: {mlflow.get_tracking_uri()}") |
572 | | -os.environ.pop("MLFLOW_RUN_ID", None) # The fix |
| 563 | +# experiment = mlflow.get_experiment_by_name(MLFLOW_EXPERIMENT_NAME) |
| 564 | +# if experiment: |
| 565 | +# experiment_id = experiment.experiment_id |
| 566 | +# else: |
| 567 | +# # Handle the case where the experiment doesn't exist, e.g., create it |
| 568 | +# experiment_id = mlflow.create_experiment(MLFLOW_EXPERIMENT_NAME) |
| 569 | +# |
| 570 | +# print(f"Attempting to start run in Experiment ID: {experiment_id}") |
| 571 | +# print(f"Current Tracking URI: {mlflow.get_tracking_uri()}") |
| 572 | +# os.environ.pop("MLFLOW_RUN_ID", None) # The fix |
573 | 573 |
|
574 | | -with mlflow.start_run(experiment_id=experiment_id): |
| 574 | +with mlflow.start_run(): # experiment_id=experiment_id): |
575 | 575 | mlflow.log_params(PARAMS) |
576 | 576 | cerebros_t0 = time.time() |
577 | 577 | phase_i_a_result_0 = cerebros_automl.run_random_search() |
|
0 commit comments