Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ data/raw
data/processed

# MLflow
mlruns/
#mlruns/
mlartifacts/

# Default ignored files
Expand Down
19 changes: 19 additions & 0 deletions Dockerfile.prod
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,25 @@ RUN az storage blob download-batch \
--account-key "${AZURE_STORAGE_KEY}" \
--source mlruns \
--destination /app/mlruns/ || echo "No mlruns/ in storage yet, skipping"
RUN az storage file download \
--account-name "${AZURE_STORAGE_ACCOUNT}" \
--account-key "${AZURE_STORAGE_KEY}" \
--share-name "train-val-selected" \
--path "train_val_selected.csv" \
--dest /app/data/processed/train_val_selected.csv && \
az storage file download \
--account-name "${AZURE_STORAGE_ACCOUNT}" \
--account-key "${AZURE_STORAGE_KEY}" \
--share-name "train-val-selected" \
--path "test_selected.csv" \
--dest /app/data/processed/test_selected.csv && \
az storage file download \
--account-name "${AZURE_STORAGE_ACCOUNT}" \
--account-key "${AZURE_STORAGE_KEY}" \
--share-name "train-val-selected" \
--path "market_data_merged.csv" \
--dest /app/data/raw/market_data_merged.csv
RUN echo "=== /app/data/processed/ ===" && ls -lh /app/data/processed/
EXPOSE 8000 8501

COPY docker/entrypoint.sh /entrypoint.sh
Expand Down
14 changes: 5 additions & 9 deletions src/models/ml_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,11 @@ def run_mlflow_tracking() -> None:
MODELS_DIR.mkdir(parents=True, exist_ok=True)

mlflow.set_tracking_uri(settings.mlflow_tracking_uri)
if settings.mlflow_artifact_root:
mlflow.set_experiment(EXPERIMENT_NAME)
client = mlflow.tracking.MlflowClient()
exp = client.get_experiment_by_name(EXPERIMENT_NAME)
if exp is None:
mlflow.create_experiment(
EXPERIMENT_NAME, artifact_location=settings.mlflow_artifact_root
)

client = mlflow.tracking.MlflowClient()
exp = client.get_experiment_by_name(EXPERIMENT_NAME)
if exp is None:
artifact_loc = settings.mlflow_artifact_root or str(_PROJECT_ROOT / "mlruns")
mlflow.create_experiment(EXPERIMENT_NAME, artifact_location=artifact_loc)
mlflow.set_experiment(EXPERIMENT_NAME)

results_path = ARTIFACT_DIR / "training_results.json"
Expand Down
Loading