@@ -179,6 +179,9 @@ jobs:
179179 echo "✅ Image created: $(docker inspect --format='{{.Created}}' ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:secure-latest)"
180180 echo "✅ Image architecture: $(docker inspect --format='{{.Architecture}}' ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:secure-latest)"
181181 echo "✅ Image OS: $(docker inspect --format='{{.Os}}' ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:secure-latest)"
182+ echo "Image entrypoint: $(docker inspect --format='{{.Config.Entrypoint}}' ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:secure-latest)"
183+ echo "Image cmd: $(docker inspect --format='{{.Config.Cmd}}' ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:secure-latest)"
184+ echo "Image working dir: $(docker inspect --format='{{.Config.WorkingDir}}' ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:secure-latest)"
182185
183186 - name : Test basic container functionality
184187 run : |
@@ -196,50 +199,69 @@ jobs:
196199 - name : Test Python installation (inspect)
197200 run : |
198201 echo "Testing Python installation via image inspection..."
199- # Check if Python is available in the image
200- docker run --rm --entrypoint="" ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:secure-latest which python3 || echo "python3 not found in PATH"
201- docker run --rm --entrypoint="" ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:secure-latest ls -la /usr/bin/python* || echo "No Python binaries found"
202+ echo "Checking PATH environment:"
203+ docker run --rm --entrypoint="" ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:secure-latest echo $PATH || echo "PATH not available"
204+ echo "Searching for Python in common locations:"
205+ docker run --rm --entrypoint="" ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:secure-latest find /usr -name "python*" 2>/dev/null || echo "No Python found in /usr"
206+ docker run --rm --entrypoint="" ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:secure-latest find /nix -name "python*" 2>/dev/null || echo "No Python found in /nix"
207+ docker run --rm --entrypoint="" ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:secure-latest find / -name "python*" -type f 2>/dev/null | head -10 || echo "No Python found anywhere"
208+ echo "Checking if Python is available via direct execution:"
209+ docker run --rm --entrypoint="" ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:secure-latest python --version 2>&1 || echo "python command failed"
210+ docker run --rm --entrypoint="" ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:secure-latest python3 --version 2>&1 || echo "python3 command failed"
202211 echo "✅ Python installation check completed"
203212
204213 - name : Test UV installation (inspect)
205214 run : |
206215 echo "Testing UV installation via image inspection..."
207- # Check if UV is available in the image
208- docker run --rm --entrypoint="" ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:secure-latest which uv || echo "uv not found in PATH"
216+ echo "Searching for UV in common locations:"
217+ docker run --rm --entrypoint="" ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:secure-latest find / -name "uv" -type f 2>/dev/null || echo "No UV found"
218+ echo "Checking if UV is available via direct execution:"
219+ docker run --rm --entrypoint="" ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:secure-latest uv --version 2>&1 || echo "uv command failed"
209220 echo "✅ UV installation check completed"
210221
222+ - name : Find Python executable
223+ run : |
224+ echo "Finding Python executable in the image..."
225+ # Find all Python executables
226+ PYTHON_PATHS=$(docker run --rm --entrypoint="" ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:secure-latest find / -name "python*" -type f -executable 2>/dev/null | head -5)
227+ echo "Found Python executables:"
228+ echo "$PYTHON_PATHS"
229+
230+ # Try to find a working Python
231+ for python_path in $PYTHON_PATHS; do
232+ echo "Testing $python_path:"
233+ docker run --rm --entrypoint="" ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:secure-latest $python_path --version 2>&1 || echo "Failed to run $python_path"
234+ done
235+
211236 - name : Test package availability (inspect)
212237 run : |
213238 echo "Testing package availability via image inspection..."
214- # Check if required packages are installed
215- docker run --rm --entrypoint="" ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:secure-latest python3 -c "
216- try:
217- import numpy
218- print('✅ NumPy available')
219- except ImportError:
220- print('❌ NumPy not available')
239+ echo "Checking if we can run the container's default command:"
240+ # Try running the container without overriding entrypoint
241+ docker run --rm ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:secure-latest python --version 2>&1 || echo "Default python command failed"
221242
222- try:
223- import gurobipy
224- print('✅ Gurobi available')
225- except ImportError:
226- print('❌ Gurobi not available')
227- " || echo "Package check completed with warnings"
228-
229- cleanup :
230- runs-on : ubuntu-latest
231- needs : [build, test]
232- if : always() && github.event.inputs.push_images != 'false'
233-
234- permissions :
235- packages : write
236-
237- steps :
238- - name : Clean up old images
239- uses : dataaxiom/ghcr-cleanup-action@v1
240- with :
241- token : ${{ secrets.GITHUB_TOKEN }}
242- package : ${{ env.IMAGE_NAME }}
243+ echo "Checking Python package availability with found executables:"
244+ # Find and test Python executables
245+ PYTHON_EXECUTABLES=$(docker run --rm --entrypoint="" ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:secure-latest find / -name "python*" -type f -executable 2>/dev/null | head -3)
246+
247+ for python_cmd in $PYTHON_EXECUTABLES; do
248+ echo "Testing packages with $python_cmd:"
249+ docker run --rm --entrypoint="" ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:secure-latest $python_cmd -c "
250+ try:
251+ import numpy
252+ print('✅ NumPy available')
253+ except ImportError as e:
254+ print(f'❌ NumPy not available: {e}')
255+
256+ try:
257+ import gurobipy
258+ print('✅ Gurobi available')
259+ except ImportError as e:
260+ print(f'❌ Gurobi not available: {e}')
261+ " 2>&1 || echo "Package check failed with $python_cmd"
262+ done
263+
264+ echo "✅ Package availability check completed"
243265
244266 generate-summary :
245267 runs-on : ubuntu-latest
0 commit comments