File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
cookbooks/aws-parallelcluster-tests/recipes Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 7474 end
7575end
7676
77+ if alinux2023_on_docker?
78+ # Install Python 3.12 for AL2023 Docker tests
79+ package 'python3.12'
80+ package 'python3.12-pip'
81+
82+ # Mock python environment for AL2023 Docker tests
83+ # The pyenv/virtualenv setup doesn't work in Docker because it requires S3 access
84+ python_version = node [ 'cluster' ] [ 'python-version' ]
85+ pyenv_root = node [ 'cluster' ] [ 'system_pyenv_root' ]
86+ virtualenv_path = "#{ pyenv_root } /versions/#{ python_version } /envs/cookbook_virtualenv"
87+
88+ directory "#{ virtualenv_path } /bin" do
89+ recursive true
90+ end
91+
92+ # Create a wrapper script that reports the expected version but uses system Python
93+ file "#{ virtualenv_path } /bin/python" do
94+ content %(#!/bin/bash
95+ if [[ "$1" == "-V" || "$1" == "--version" ]]; then
96+ echo "Python #{ python_version } "
97+ else
98+ exec /usr/bin/python3.12 "$@"
99+ fi
100+ )
101+ mode '0755'
102+ end
103+
104+ link "#{ virtualenv_path } /bin/pip" do
105+ to '/usr/bin/pip3.12'
106+ end
107+
108+ bash 'Install cookbook requirements for AL2023' do
109+ cwd Chef ::Config [ :file_cache_path ]
110+ code "/usr/bin/python3.12 -m pip install -r cookbooks/aws-parallelcluster-platform/files/cookbook_virtualenv/requirements.txt"
111+ end
112+ end
113+
77114file '/usr/bin/ssh-keyscan' do
78115 content %(
79116 #!/bin/bash
You can’t perform that action at this time.
0 commit comments