File tree 1 file changed +17
-3
lines changed
src/codeflare_sdk/ray/cluster
1 file changed +17
-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,17 @@ 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
+ try :
100
+ if python_version in SUPPORTED_PYTHON_VERSIONS :
101
+ image = SUPPORTED_PYTHON_VERSIONS [python_version ]
102
+ except Exception : # pragma: no cover
103
+ print (
104
+ f"Python version '{ python_version } ' is not supported. Only { ', ' .join (SUPPORTED_PYTHON_VERSIONS .keys ())} are supported."
105
+ )
106
+ for container in containers :
107
+ container ["image" ] = image
94
108
95
109
96
110
def update_image_pull_secrets (spec , image_pull_secrets ):
You can’t perform that action at this time.
0 commit comments