File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
src/codeflare_sdk/ray/cluster Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change 18
18
"""
19
19
20
20
import json
21
+ import sys
21
22
import typing
22
23
import yaml
23
24
import os
31
32
)
32
33
import codeflare_sdk
33
34
35
+ SUPPORTED_PYTHON_VERSIONS = {
36
+ "3.9" : "quay.io/modh/ray@sha256:0d715f92570a2997381b7cafc0e224cfa25323f18b9545acfd23bc2b71576d06" ,
37
+ "3.11" : "quay.io/modh/ray:2.35.0-py311-cu121" ,
38
+ }
39
+
34
40
35
41
def read_template (template ):
36
42
with open (template , "r" ) as stream :
@@ -88,9 +94,16 @@ def update_names(
88
94
89
95
def update_image (spec , image ):
90
96
containers = spec .get ("containers" )
91
- if image != "" :
92
- for container in containers :
93
- container ["image" ] = image
97
+ if not image :
98
+ python_version = f"{ sys .version_info .major } .{ sys .version_info .minor } "
99
+ if python_version in SUPPORTED_PYTHON_VERSIONS :
100
+ image = SUPPORTED_PYTHON_VERSIONS [python_version ]
101
+ else :
102
+ raise ValueError (
103
+ f"Python version '{ python_version } ' is not supported. Only 3.9 and 3.11 are supported."
104
+ )
105
+ for container in containers :
106
+ container ["image" ] = image
94
107
95
108
96
109
def update_image_pull_secrets (spec , image_pull_secrets ):
You can’t perform that action at this time.
0 commit comments