-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
56 changed files
with
7,894 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
venv | ||
mlruns | ||
.mlruns_bckp | ||
.ipython | ||
*.png | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import glob | ||
import os | ||
import yaml | ||
import shutil | ||
|
||
mlflow_path = "./mlruns/1" | ||
backup_dir = "./.mlruns_bckp" | ||
|
||
cut_after = 1 # 1670237437014 | ||
|
||
runs = glob.glob(os.path.join(mlflow_path, "*")) | ||
|
||
for r in runs: | ||
mark_for_deletion = False | ||
mark_for_deprecation = False | ||
if not os.path.isdir(r): | ||
continue | ||
with open(os.path.join(r, "meta.yaml"), "r") as f: | ||
try: | ||
content = yaml.safe_load(f) | ||
except yaml.YAMLError as exc: | ||
print(exc) | ||
|
||
if content["status"] != 3: | ||
mark_for_deletion = True | ||
elif int(content["end_time"]) < cut_after: | ||
mark_for_deprecation = True | ||
content["lifecycle_stage"] = "deleted" | ||
|
||
if mark_for_deletion: | ||
shutil.move(r, os.path.join(backup_dir, os.path.basename(r))) | ||
elif mark_for_deprecation: | ||
with open(os.path.join(r, "meta.yaml"), "w") as f: | ||
yaml.safe_dump(content, f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
poetry install --without dev | ||
poetry run kedro mlflow init |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
poetry install | ||
poetry run pre-commit autoupdate | ||
poetry run pre-commit install | ||
poetry run kedro mlflow init | ||
poetry run pytest | ||
poetry run mkdocs build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
|
||
{ | ||
"label": "Setup", | ||
"type": "shell", | ||
"command": ".vscode/setup.sh", | ||
"group": "none", | ||
"presentation": { | ||
"reveal": "never", | ||
"panel": "new" | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "Kedro Test", | ||
"type": "shell", | ||
"command": "poetry", | ||
"args": ["run", "pytest"], | ||
"group": "none", | ||
"presentation": { | ||
"reveal": "never", | ||
"panel": "dedicated" | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "Kedro Viz", | ||
"type": "shell", | ||
"command": "poetry", | ||
"args": ["run", "kedro", "viz", "--autoreload"], | ||
"group": "none", | ||
"presentation": { | ||
"reveal": "never", | ||
"panel": "new" | ||
}, | ||
"runOptions": { | ||
"runOn": "folderOpen" | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "MLFlow Dashboard", | ||
"type": "shell", | ||
"command": "poetry", | ||
"args": ["run", "mlflow", "ui"], | ||
"group": "none", | ||
"presentation": { | ||
"reveal": "never", | ||
"panel": "new" | ||
}, | ||
"runOptions": { | ||
"runOn": "folderOpen" | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "MkDocs Build", | ||
"type": "shell", | ||
"command": "poetry", | ||
"args": ["run", "mkdocs", "build"], | ||
"group": "none", | ||
"presentation": { | ||
"reveal": "never", | ||
"panel": "dedicated" | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "MkDocs Serve", | ||
"type": "shell", | ||
"command": "poetry", | ||
"args": ["run", "mkdocs", "serve"], | ||
"group": "none", | ||
"presentation": { | ||
"reveal": "never", | ||
"panel": "dedicated" | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "MkDocs Deploy", | ||
"type": "shell", | ||
"command": "poetry", | ||
"args": ["run", "mkdocs", "gh-deploy"], | ||
"group": "none", | ||
"presentation": { | ||
"reveal": "never", | ||
"panel": "dedicated" | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.