Commit 427b35d
authored
feat: Support multiple pip index URLs in CustomTrainer (#79)
* feat: Support multiple pip index URLs in CustomTrainer
- Add pip_index_urls parameter to CustomTrainer (list of URLs)
- Update constants to support multiple URLs with environment variable
- Modify utils to handle multiple index URLs in pip installation
- Update tests to use new parameter
- Fix mutable default issue with dataclasses.field(default_factory=...)
Closes #72
Signed-off-by: wassimbensalem <bswassim@gmail.com>
* test: add comprehensive test cases for multiple pip index URLs
Signed-off-by: wassimbensalem <bswassim@gmail.com>
* refactor: simplify constants for pip index URLs
Signed-off-by: wassimbensalem <bswassim@gmail.com>
* fix: remove Optional from pip_index_urls docstring to match implementation
Signed-off-by: wassimbensalem <bswassim@gmail.com>
* test: adjust unit test for get_custom_trainer
Signed-off-by: wassimbensalem <bswassim@gmail.com>
* fix: add missing Dict import in utils.py
Signed-off-by: wassimbensalem <bswassim@gmail.com>
* refactor: move test cases to utils_test.py and convert to parametrized format
Signed-off-by: wassimbensalem <bswassim@gmail.com>
* refactor: update utils test to use exact string matching instead of contains/not_contains checks
- Changed TestCase expected_output from Dict[str, Any] to str
- Replaced contains/not_contains logic with direct string equality
- Updated all test cases to specify complete expected script output
- Tests now assert the entire script returned by get_script_for_python_packages
Signed-off-by: wassimbensalem <bswassim@gmail.com>
* feat: add multiple pip index URLs support with comprehensive tests
- Add support for multiple pip index URLs in CustomTrainer
- Update constants to handle comma-separated environment variables
- Add integration test for multiple pip index URLs flow
- Update utils to generate correct pip install commands with --index-url and --extra-index-url
- Ensure backward compatibility with single URL usage
Signed-off-by: wassimbensalem <bswassim@gmail.com>
* refactor: remove redundant multiple pip index URLs test from backend
- Remove redundant test case since comprehensive tests already exist in utils test
- Keep integration tests focused on core functionality rather than implementation details
- Maintain test coverage while reducing duplication
Signed-off-by: wassimbensalem <bswassim@gmail.com>
* Revert "refactor: remove redundant multiple pip index URLs test from backend"
This reverts commit 0ec003d.
Signed-off-by: wassimbensalem <bswassim@gmail.com>
* refactor: remove duplicated test case from the backend.
Signed-off-by: wassimbensalem <bswassim@gmail.com>
---------
Signed-off-by: wassimbensalem <bswassim@gmail.com>1 parent 0f7a988 commit 427b35d
File tree
5 files changed
+167
-20
lines changed- kubeflow/trainer
- backends/kubernetes
- constants
- types
- utils
5 files changed
+167
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| 223 | + | |
| 224 | + | |
223 | 225 | | |
224 | 226 | | |
225 | 227 | | |
226 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
227 | 232 | | |
| 233 | + | |
228 | 234 | | |
229 | 235 | | |
230 | 236 | | |
231 | 237 | | |
232 | 238 | | |
233 | 239 | | |
234 | 240 | | |
235 | | - | |
236 | | - | |
| 241 | + | |
| 242 | + | |
237 | 243 | | |
238 | 244 | | |
239 | 245 | | |
| |||
723 | 729 | | |
724 | 730 | | |
725 | 731 | | |
726 | | - | |
| 732 | + | |
727 | 733 | | |
728 | 734 | | |
729 | 735 | | |
730 | 736 | | |
731 | 737 | | |
732 | 738 | | |
733 | | - | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
734 | 743 | | |
735 | 744 | | |
736 | 745 | | |
| |||
741 | 750 | | |
742 | 751 | | |
743 | 752 | | |
744 | | - | |
| 753 | + | |
745 | 754 | | |
746 | 755 | | |
747 | 756 | | |
| |||
757 | 766 | | |
758 | 767 | | |
759 | 768 | | |
| 769 | + | |
| 770 | + | |
760 | 771 | | |
761 | 772 | | |
762 | 773 | | |
| |||
788 | 799 | | |
789 | 800 | | |
790 | 801 | | |
| 802 | + | |
791 | 803 | | |
792 | 804 | | |
793 | 805 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
129 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
44 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
256 | | - | |
| 256 | + | |
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
260 | | - | |
| 260 | + | |
261 | 261 | | |
262 | | - | |
263 | 262 | | |
264 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
265 | 271 | | |
266 | 272 | | |
267 | 273 | | |
268 | 274 | | |
269 | 275 | | |
270 | 276 | | |
271 | 277 | | |
272 | | - | |
| 278 | + | |
273 | 279 | | |
274 | | - | |
| 280 | + | |
275 | 281 | | |
276 | | - | |
277 | | - | |
278 | 282 | | |
279 | 283 | | |
280 | 284 | | |
| |||
285 | 289 | | |
286 | 290 | | |
287 | 291 | | |
288 | | - | |
289 | | - | |
| 292 | + | |
| 293 | + | |
290 | 294 | | |
291 | 295 | | |
292 | 296 | | |
| |||
331 | 335 | | |
332 | 336 | | |
333 | 337 | | |
334 | | - | |
| 338 | + | |
335 | 339 | | |
336 | 340 | | |
337 | 341 | | |
| |||
372 | 376 | | |
373 | 377 | | |
374 | 378 | | |
375 | | - | |
| 379 | + | |
376 | 380 | | |
377 | 381 | | |
378 | 382 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
0 commit comments