diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 954a6df..52fc05e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,9 +17,12 @@ repos: rev: 22.8.0 hooks: - id: black + language_version: python3.8 +- repo: https://github.com/psf/black + rev: 22.1.0 + hooks: - id: black-jupyter language_version: python3 - # import 並び替え - repo: https://github.com/pycqa/isort rev: 5.10.1 diff --git a/.vscode/settings.json b/.vscode/settings.json index 4a629b6..0baab2f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,7 @@ { "python.linting.flake8Enabled": true, "python.linting.pylintEnabled": false, - "python.linting.enabled": true + "python.linting.enabled": true, + "python.defaultInterpreterPath": "./.venv" } + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ca56664 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +env-create: + conda env create --prefix=.venv --file=environments/environment.yml +env-update: + conda env update --prefix=.venv --file=environments/environment.yml \ No newline at end of file diff --git a/docs/01_create_environemnt.md b/docs/01_create_environemnt.md new file mode 100644 index 0000000..4b02ff9 --- /dev/null +++ b/docs/01_create_environemnt.md @@ -0,0 +1,26 @@ +# create environment + +``` +make env-create +``` + +```make env-create``` command is an alias of command below defined in Makefile. + +``` +conda env create --prefix ./.env --file environment.yml +``` + +If you place this repository on WSL2 /mnt/* or AzureML Compute Instance working directory, we recommend to change ```--prefix ./.env``` to ```--prefix ~/azureml-mlops-env``` because of storage latency. + +Affected: +- .vscode/setting.json ```python.defaultInterpreterPath``` +- Makefile + +# update environment + +1. Add new package name and version to environment.yml. +1. ```make env-update``` + +```make env-update``` command is alias of command below defined in Makefile. + +```conda env update --prefix ./.env --file environment.yml``` \ No newline at end of file diff --git a/environments/environment.yml b/environments/environment.yml new file mode 100644 index 0000000..e2e15e6 --- /dev/null +++ b/environments/environment.yml @@ -0,0 +1,20 @@ +name: azureml-mlops-env +channels: + - defaults + - conda-forge +dependencies: + - python=3.10.6 + - pip + - flake8=5.0.4 + - isort=5.10.1 + - black=22.8.0 + - notebook + - ipykernel + - numpy=1.23.1 + - matplotlib=3.5.2 + - tqdm=4.64.0 + - mlflow=1.29.0 + - pip: + - azureml-core==1.43.0 + - azureml-mlflow==1.43.0.post1 + - black_nbconvert==0.4.0 diff --git a/notebooks/train-prototyping.ipynb b/notebooks/train-prototyping.ipynb index 5f9f6a5..735fa8c 100644 --- a/notebooks/train-prototyping.ipynb +++ b/notebooks/train-prototyping.ipynb @@ -303,7 +303,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3.8.13 ('mlops-train')", + "display_name": "Python 3.10.6 (conda)", "language": "python", "name": "python3" }, @@ -317,12 +317,12 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.13" + "version": "3.10.6" }, "orig_nbformat": 4, "vscode": { "interpreter": { - "hash": "74419d3d9274bcbfe6ecb9acd0596b867bc1ac63effdfbb8a6e0b958ebbd5c34" + "hash": "38e473d28400b2903a173eeae82f0fe034393fd50eb0c5d12497f83fc604afcc" } } },