You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update README and environment configuration for Azure ML
- Simplified instructions in README regarding environment updates by removing redundant information about dependencies in requirements.txt.
- Adjusted the build context in create-env.yaml to use the repository root for Dockerfile compatibility, ensuring correct path resolution for dependencies.
Copy file name to clipboardExpand all lines: README.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,7 @@ A machine learning and data science project template that makes it easy to work
12
12
-[Features](#features)
13
13
-[Getting Started](#getting-started)
14
14
-[How to setup dev environment?](#how-to-setup-dev-environment)
15
+
-[How to create a new directory under src with a new environment](#how-to-create-a-new-directory-under-src-with-a-new-environment)
15
16
-[How to update python packages in the dev container](#how-to-update-python-packages-in-the-dev-container)
16
17
-[Directory Structure](#directory-structure)
17
18
-[`notebooks` directory vs `src` directory](#notebooks-directory-vs-src-directory)
@@ -30,7 +31,7 @@ A machine learning and data science project template that makes it easy to work
30
31
31
32
This repository provides a [VSCode Dev Container](https://code.visualstudio.com/docs/devcontainers/containers) based project template that can help accelerate your Machine Learning inner-loop development phase. The template covers the phases from early ML experimentation (local training/testing) until production oriented ML model training (cloud based training/testing with bigger CPUs and GPUs).
32
33
33
-
During the early phase of Machine Learning project, you may face challenges such as each data scientist creating various different python environments that span across CPU and GPU that tend to have different setup procedures. With the power of Dev Containers, you can automate environment setup process across the team and every data scientist will get the exact same environment automatically. This template provides both CPU and GPU Dev Container setup as examples. To support multiple different ML approaches with different python environments to be experimented in one project, this solution allows multiple different Dev Containers to be used in one repository while having a "common" module that will be installed into all Dev Container to enable code reuse across different Dev Containers.
34
+
During the early phase of Machine Learning project, you may face challenges such as each data scientist creating various different python environments that span across CPU and GPU that tend to have different setup procedures. With the power of Dev Containers, you can automate environment setup process across the team and every data scientist will get the exact same environment automatically. This template provides both CPU and GPU Dev Container setup as examples. To support multiple different ML approaches with different python environments to be experimented in one project, this solution allows multiple different Dev Containers to be used in one repository.
34
35
35
36
Another challenge you may face is each data scientist creating a low quality codebase. That is fine during the experimentation stage to keep the team agility high and maximize your team’s experimentation throughput. But when you move to the model productionization stage, you experience the burden of bringing code quality up to production level. With the power of python tools and VSCode extensions configured for this template on top of Dev Containers, you can keep the code quality high automatically without losing your team’s agility and experimentation throughput and ease the transition to the productionization phase.
36
37
@@ -102,17 +103,17 @@ This section gives you overview of the directory structure of this template. Onl
102
103
│ ├── .devcontainer # dev container related configuration files goes to here following VSCode convention
103
104
│ │ ├── devcontainer.json # dev container configuration and VS Code settings, extensions etc.
104
105
│ │ ├── Dockerfile # referred in devcontainer.json
105
-
│ │ └── pyproject.toml # includes python package list for notebooks. used in Dockerfile
106
+
│ │ ├── pyproject.toml # includes python package list for notebooks. used in Dockerfile
107
+
│ │ └── uv.lock # lock file for python packages. used in Dockerfile
106
108
│ └── sample_notebook.py # example of interactive python script
107
109
├── pyproject.toml # Setting file for ruff, pytest and pytest-cov
108
110
└── src
109
-
├── common # this module is accessible from all modules under src. put functions you want to import across the projects here
110
-
│ └── requirements.txt # python package list for common module. installed in all Dockerfile under src. python tools for src goes to here too
111
111
├── sample_cpu_project # cpu project example. Setup process is covered in Section: How to setup dev environment?
112
112
│ ├── .devcontainer # dev container related configuration files goes to here following VSCode convention
113
113
│ │ ├── devcontainer.json # dev container configuration and VS Code settings, extensions etc.
114
114
│ │ ├── Dockerfile # referred in devcontainer.json. Supports only CPU
115
-
│ │ └── pyproject.toml # includes python package list for sample_cpu_project. used in Dockerfile
115
+
│ │ ├── pyproject.toml # includes python package list for sample_cpu_project. used in Dockerfile
116
+
│ │ └── uv.lock # lock file for python packages. used in Dockerfile
116
117
│ ├── sample_main.py
117
118
│ └── tests # pytest scripts for sample_cpu_project goes here
118
119
│ └── test_dummy.py # pytest script example
@@ -121,7 +122,8 @@ This section gives you overview of the directory structure of this template. Onl
121
122
├── .devcontainer # dev container related configuration files goes to here following VSCode convention
122
123
│ ├── devcontainer.json # dev container configuration and VS Code settings, extensions etc.
123
124
│ ├── Dockerfile # referred in devcontainer.json. Supports GPU
124
-
│ └── pyproject.toml # includes python package list for sample_pytorch_gpu_project. used in Dockerfile
125
+
│ ├── pyproject.toml # includes python package list for sample_pytorch_gpu_project. used in Dockerfile
126
+
│ └── uv.lock # lock file for python packages. used in Dockerfile
125
127
├── aml_example/ # Sample AML CLI v2 Components-based pipeline, including setup YAML. See sample_pytorch_gpu_project/README for full details of files in this directory.
126
128
├── sample_main.py
127
129
├── inference.py # Example pytorch inference/eval script that also works with aml_example
@@ -224,7 +226,6 @@ ssh-add
224
226
## Future Roadmap
225
227
226
228
- Add Docker build caching to Azure DevOps MS hosted CI pipeline
227
-
- Investigate making `src/common` installed with `pip -e`
# Changing the default UV_LINK_MODE silences warnings about not being able to use hard links since the cache and sync target are on separate file systems
28
28
ENV UV_LINK_MODE=copy
29
-
# Install dependencies (as root for simplicity; devuser can still use installed packages)
29
+
# Install dependencies using bind mounts instead of COPY to avoid extra layers
30
+
# This is the recommended approach by uv: https://docs.astral.sh/uv/guides/integration/docker/#installing-a-project
# Changing the default UV_LINK_MODE silences warnings about not being able to use hard links since the cache and sync target are on separate file systems
28
28
ENV UV_LINK_MODE=copy
29
-
# Install dependencies (as root for simplicity; devuser can still use installed packages)
29
+
# Install dependencies using bind mounts instead of COPY to avoid extra layers
30
+
# This is the recommended approach by uv: https://docs.astral.sh/uv/guides/integration/docker/#installing-a-project
# This part can be potentially improved by https://docs.astral.sh/uv/concepts/projects/workspaces/#when-not-to-use-workspaces to move away from requirements.txt and gets its own lock file
37
-
COPY src/common/requirements.txt .
38
-
RUN --mount=type=cache,target=/root/.cache/uv \
39
-
uv pip install -r requirements.txt --system
40
-
41
36
# Allow devuser to manage packages at runtime without sudo (e.g. uv add)
0 commit comments