Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2016d78

Browse files
authoredFeb 23, 2025··
Merge pull request #66 from aisingapore/dev
0.5.1 release part 2
2 parents a565cc0 + 9eb7cd4 commit 2016d78

File tree

4 files changed

+62
-40
lines changed

4 files changed

+62
-40
lines changed
 

‎{{cookiecutter.repo_name}}/aisg-context/guide-site/docs/runai/03c-dev-wksp.md

-12
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,3 @@ if you intend to use Jupyter notebooks within the VSCode environment.
127127
[vsx-python]: https://marketplace.visualstudio.com/items?itemName=ms-python.python
128128
[vsx-jy]: https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter
129129
[jy-vscode]: ./04c-virtual-env.md#jupyter-kernel-for-vscode
130-
131-
## Using Docker within Kubernetes
132-
133-
!!! caution
134-
Since these development environments are essentially pods deployed
135-
within a Kubernetes cluster, using Docker within the pods
136-
themselves is not feasible by default and while possible, should
137-
be avoided.
138-
139-
??? info "Reference Link(s)"
140-
141-
- [Using Docker-in-Docker for your CI or testing environment? Think twice. - jpetazzo](https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/)

‎{{cookiecutter.repo_name}}/aisg-context/guide-site/docs/runai/06c-job-orchestration.md

+41-6
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ values can be overridden through the CLI.
3838

3939
## Data Preparation & Preprocessing
4040

41-
To process the sample raw data, there are many ways to do so. One way
42-
is to submit the job through Run:ai. You can first your configuration
43-
variables at `conf/process_data.yaml`, specifically this section:
41+
To process the sample raw data, there are many ways to do so. We can
42+
either build within the Coder workspace, or to submit the job through
43+
Run:ai. You can first your configuration variables at
44+
`conf/process_data.yaml`, specifically this section:
4445

4546
```yaml
4647
raw_data_dir_path: "./data/raw"
@@ -53,6 +54,23 @@ provided in this template:
5354

5455
=== "Coder Workspace Terminal"
5556

57+
```bash
58+
docker build \
59+
-t {{cookiecutter.registry_project_path}}/cpu:0.1.0 \
60+
-f $(pwd)/docker/{{cookiecutter.repo_name}}-cpu.Dockerfile \
61+
$(pwd)
62+
{%- if cookiecutter.platform == 'gcp' %}
63+
# Run `gcloud auth activate-service-account --key-file $GOOGLE_APPLICATION_CREDENTIALS`
64+
# and `gcloud auth configure-docker {{cookiecutter.registry_project_path.split('/')[0]}}`
65+
{%- elif cookiecutter.platform == 'onprem' %}
66+
# Run `docker login {{cookiecutter.registry_project_path.split('/')[0]}}`
67+
{%- endif %}
68+
# to authenticate if you have not done so
69+
docker push {{cookiecutter.registry_project_path}}/cpu:0.1.0
70+
```
71+
72+
=== "Using Run:ai"
73+
5674
```bash
5775
# Run `runai login` and `runai config project {{cookiecutter.proj_name}}` first if needed
5876
# Run this in the base of your project repository, and change accordingly
@@ -70,7 +88,7 @@ provided in this template:
7088
Now that we have the Docker image built and pushed to the registry, we
7189
can submit a job using that image to Run:ai\:
7290

73-
=== "Coder Workspace Terminal"
91+
=== "Coder Workspace Terminal using Run:ai"
7492

7593
```bash
7694
# Switch working-dir to /<NAME_OF_DATA_SOURCE>/workspaces/<YOUR_HYPHENATED_NAME>/{{cookiecutter.repo_name}} to use the repo in the PVC
@@ -156,6 +174,23 @@ After that, we build the Docker image from the Docker file
156174

157175
=== "Coder Workspace Terminal"
158176

177+
```bash
178+
docker build \
179+
-t {{cookiecutter.registry_project_path}}/gpu:0.1.0 \
180+
-f $(pwd)/docker/{{cookiecutter.repo_name}}-gpu.Dockerfile \
181+
$(pwd)
182+
{%- if cookiecutter.platform == 'gcp' %}
183+
# Run `gcloud auth activate-service-account --key-file $GOOGLE_APPLICATION_CREDENTIALS`
184+
# and `gcloud auth configure-docker {{cookiecutter.registry_project_path.split('/')[0]}}`
185+
{%- elif cookiecutter.platform == 'onprem' %}
186+
# Run `docker login {{cookiecutter.registry_project_path.split('/')[0]}}`
187+
{%- endif %}
188+
# to authenticate if you have not done so
189+
docker push {{cookiecutter.registry_project_path}}/gpu:0.1.0
190+
```
191+
192+
=== "Using Run:ai"
193+
159194
```bash
160195
# Run `runai login` and `runai config project {{cookiecutter.proj_name}}` first if needed
161196
# Run this in the base of your project repository, and change accordingly
@@ -173,7 +208,7 @@ After that, we build the Docker image from the Docker file
173208
Now that we have the Docker image built and pushed to the registry,
174209
we can run a job using it:
175210

176-
=== "Coder Workspace Terminal"
211+
=== "Coder Workspace Terminal using Run:ai"
177212

178213
```bash
179214
# Switch working-dir to /<NAME_OF_DATA_SOURCE>/workspaces/<YOUR_HYPHENATED_NAME>/{{cookiecutter.repo_name}} to use the repo in the PVC
@@ -320,7 +355,7 @@ executing the model training job out of the Run:ai platform, as the
320355
`JOB_NAME` and `JOB_UUID` environment variables would not be available
321356
by default.
322357

323-
=== "Coder Workspace Terminal"
358+
=== "Coder Workspace Terminal using Run:ai"
324359

325360
```bash
326361
# Switch working-dir to /<NAME_OF_DATA_SOURCE>/workspaces/<YOUR_HYPHENATED_NAME>/{{cookiecutter.repo_name}} to use the repo in the PVC

‎{{cookiecutter.repo_name}}/problem-templates/cv/aisg-context/guide-site/docs/runai/06c-job-orchestration.md.diff

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
--- {{cookiecutter.repo_name}}/aisg-context/guide-site/docs/runai/06c-job-orchestration.md
22
+++ {{cookiecutter.repo_name}}/problem-templates/cv/aisg-context/guide-site/docs/runai/06c-job-orchestration.md
3-
@@ -46,2 +46,2 @@
3+
@@ -47,2 +47,2 @@
44
-raw_data_dir_path: "./data/raw"
55
-processed_data_dir_path: "./data/processed"
66
+raw_data_dir_path: "./data/mnist-pngs-data-aisg"
77
+processed_data_dir_path: "./data/processed/mnist-pngs-data-aisg-processed"
8-
@@ -84,2 +84,2 @@
8+
@@ -102,2 +102,2 @@
99
- raw_data_dir_path=/<NAME_OF_DATA_SOURCE>/workspaces/<YOUR_HYPHENATED_NAME>/data/raw \
1010
- processed_data_dir_path=/<NAME_OF_DATA_SOURCE>/workspaces/<YOUR_HYPHENATED_NAME>/data/processed"
1111
+ raw_data_dir_path=/<NAME_OF_DATA_SOURCE>/workspaces/<YOUR_HYPHENATED_NAME>/data/mnist-pngs-data-aisg \
1212
+ processed_data_dir_path=/<NAME_OF_DATA_SOURCE>/workspaces/<YOUR_HYPHENATED_NAME>/data/processed/mnist-pngs-data-aisg-processed"
13-
@@ -91 +91 @@
13+
@@ -109 +109 @@
1414
-`/<NAME_OF_DATA_SOURCE>/workspaces/<YOUR_HYPHENATED_NAME>/data/processed`.
1515
+`/<NAME_OF_DATA_SOURCE>/workspaces/<YOUR_HYPHENATED_NAME>/data/processed/mnist-pngs-data-aisg-processed`.
16-
@@ -121,0 +122,4 @@
16+
@@ -139,0 +140,4 @@
1717
+ !!! note
1818
+ The username and password for the MLflow Tracking server
1919
+ can be retrieved from the MLOps team or your team lead.
2020
+
21-
@@ -143,3 +147,13 @@
21+
@@ -161,3 +165,13 @@
2222
-data_dir_path: "./data/processed"
2323
-dummy_param1: 1.3
2424
-dummy_param2: 0.8
@@ -35,7 +35,7 @@
3535
+dry_run: false
3636
+model_checkpoint_interval: 2
3737
+model_checkpoint_dir_path: "./models/checkpoint"
38-
@@ -190,3 +204,6 @@
38+
@@ -225,3 +239,6 @@
3939
- data_dir_path=/<NAME_OF_DATA_SOURCE>/workspaces/<YOUR_HYPHENATED_NAME>/data/processed \
4040
- artifact_dir_path=/<NAME_OF_DATA_SOURCE>/workspaces/<YOUR_HYPHENATED_NAME>/models \
4141
- mlflow_tracking_uri=<MLFLOW_TRACKING_URI>"
@@ -45,17 +45,17 @@
4545
+ mlflow_exp_name=<NAME_OF_DEFAULT_MLFLOW_EXPERIMENT> \
4646
+ model_checkpoint_dir_path=/<NAME_OF_DATA_SOURCE>/workspaces/<YOUR_HYPHENATED_NAME>/{{cookiecutter.repo_name}}/models \
4747
+ epochs=3"
48-
@@ -265,2 +282,2 @@
48+
@@ -300,2 +317,2 @@
4949
- dummy_param1: range(0.9,1.7,step=0.1)
5050
- dummy_param2: choice(0.7,0.8,0.9)
5151
+ lr: range(0.9,1.7,step=0.1)
5252
+ gamma: choice(0.7,0.8,0.9)
53-
@@ -293 +310 @@
53+
@@ -328 +345 @@
5454
- return args["dummy_param1"], args["dummy_param2"]
5555
+ return curr_test_loss, curr_test_accuracy
56-
@@ -335,0 +353 @@
56+
@@ -370,0 +388 @@
5757
+ -e OMP_NUM_THREADS=2 \
58-
@@ -337,3 +355,6 @@
58+
@@ -372,3 +390,6 @@
5959
- data_dir_path=/<NAME_OF_DATA_SOURCE>/workspaces/<YOUR_HYPHENATED_NAME>/data/processed \
6060
- artifact_dir_path=/<NAME_OF_DATA_SOURCE>/workspaces/<YOUR_HYPHENATED_NAME>/models \
6161
- mlflow_tracking_uri=<MLFLOW_TRACKING_URI>"

‎{{cookiecutter.repo_name}}/problem-templates/hdb/aisg-context/guide-site/docs/runai/06c-job-orchestration.md.diff

+11-12
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
--- {{cookiecutter.repo_name}}/aisg-context/guide-site/docs/runai/06c-job-orchestration.md
22
+++ {{cookiecutter.repo_name}}/problem-templates/hdb/aisg-context/guide-site/docs/runai/06c-job-orchestration.md
3-
@@ -49,0 +49,3 @@
3+
@@ -50,0 +51,2 @@
44
+There are other configurables in the `conf/process_data.yaml` which are used
55
+in data preparation scripts found in `src/{{cookiecutter.src_package_name}}/data_prep`.
6-
+
7-
@@ -144,2 +147,7 @@
6+
@@ -162,2 +164,7 @@
87
-dummy_param1: 1.3
98
-dummy_param2: 0.8
109
+artifact_dir_path: "./models"
@@ -14,38 +13,38 @@
1413
+gamma: 1
1514
+max_depth: 5
1615
+seed: 1111
17-
@@ -191,2 +199,5 @@
16+
@@ -226,2 +233,5 @@
1817
- artifact_dir_path=/<NAME_OF_DATA_SOURCE>/workspaces/<YOUR_HYPHENATED_NAME>/models \
1918
- mlflow_tracking_uri=<MLFLOW_TRACKING_URI>"
2019
+ setup_mlflow=true \
2120
+ mlflow_tracking_uri=<MLFLOW_TRACKING_URI> \
2221
+ mlflow_exp_name=<NAME_OF_DEFAULT_MLFLOW_EXPERIMENT> \
2322
+ model_checkpoint_dir_path=/<NAME_OF_DATA_SOURCE>/workspaces/<YOUR_HYPHENATED_NAME>/{{cookiecutter.repo_name}}/models \
2423
+ epochs=3"
25-
@@ -259,2 +270,2 @@
24+
@@ -294,2 +304,2 @@
2625
- direction: ["minimize", "maximize"]
2726
- study_name: "image-classification"
2827
+ direction: ["minimize"]
2928
+ study_name: "hdb-resale-process"
30-
@@ -265,2 +276,4 @@
29+
@@ -300,2 +310,4 @@
3130
- dummy_param1: range(0.9,1.7,step=0.1)
3231
- dummy_param2: choice(0.7,0.8,0.9)
3332
+ n_estimators: range(50, 200, step=10)
3433
+ lr: tag(log, interval(0.1, 0.6))
3534
+ gamma: choice(0,0.1,0.2,0.3,0.4,0.5)
3635
+ max_depth: range(2,20,step=1)
37-
@@ -293 +306 @@
36+
@@ -328 +340 @@
3837
- return args["dummy_param1"], args["dummy_param2"]
3938
+ return test_rmse ## or any other metrics
40-
@@ -300 +313 @@
39+
@@ -335 +347 @@
4140
- direction: ["minimize", "maximize"]
4241
+ direction: ["minimize"] ## or ["maximise"], if you're looking to maximise the test_rmse value
43-
@@ -306 +319 @@
44-
-loss and maximise the accuracy. The `hydra.sweeper.direction` field in
42+
@@ -341 +353 @@
43+
-loss and maximise the accuracy. The `hydra.sweeper.direction` field in
4544
+root mean square error. The `hydra.sweeper.direction` field in
46-
@@ -335,0 +348 @@
45+
@@ -370,0 +383 @@
4746
+ -e OMP_NUM_THREADS=2 \
48-
@@ -338,2 +352,5 @@
47+
@@ -373,2 +386,5 @@
4948
- artifact_dir_path=/<NAME_OF_DATA_SOURCE>/workspaces/<YOUR_HYPHENATED_NAME>/models \
5049
- mlflow_tracking_uri=<MLFLOW_TRACKING_URI>"
5150
+ setup_mlflow=true \

0 commit comments

Comments
 (0)
Please sign in to comment.