File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed
src/codeflare_sdk/ray/cluster Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change 1818"""
1919
2020import json
21+ import sys
2122import typing
2223import yaml
2324import os
3132)
3233import codeflare_sdk
3334
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+
3440
3541def read_template (template ):
3642 with open (template , "r" ) as stream :
@@ -88,9 +94,17 @@ def update_names(
8894
8995def update_image (spec , image ):
9096 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
94108
95109
96110def update_image_pull_secrets (spec , image_pull_secrets ):
You can’t perform that action at this time.
0 commit comments