azure-search-openai-demo
azure-search-openai-demo copied to clipboard
Use Python 3.10 base image
Purpose
This PR updates the dev container to use a Python 3.10 base image, instead of the universal bullseye. It subsequently removes the Python feature, since it's slow. The feature was also using "os-provided" as the Python version, which is problematic on machines that have bad Python installs (like mine!). It's a more consistent environment to use the Docker's Python. (Related issue: #343)
A similar change was made in the Python azd templates a while back: https://github.com/Azure-Samples/todo-python-mongo-terraform/blob/main/.devcontainer/Dockerfile
Does this introduce a breaking change?
[ ] Yes
[X] No
Pull Request Type
What kind of change does this Pull Request introduce?
[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:
How to Test
- Open in Dev Container on Mac, run azd up
- Open in GitHub Codespaces, run azd up.
This doesn't work for me:
[12350653 ms] Start: Run: docker inspect --type image mcr.microsoft.com/devcontainers/python:3.10
[12353447 ms] Error fetching image details: No manifest found for mcr.microsoft.com/devcontainers/python:3.10.
[12353447 ms] Start: Run: docker pull mcr.microsoft.com/devcontainers/python:3.10
Error response from daemon: Get "https://mcr.microsoft.com/v2/": net/http: TLS handshake timeout
[12374441 ms] []
[12374441 ms] Error: No such image: mcr.microsoft.com/devcontainers/python:3.10
@tonybaloney I wonder if that was an intermittent error? It's listed at that exact URL on: https://mcr.microsoft.com/en-us/product/devcontainers/python/about
I also just started a Codespace from this branch and it succeeded:
#9 [internal] load metadata for mcr.microsoft.com/devcontainers/python:3.10
2023-06-30 15:59:26.867Z: #9 DONE 0.8s
2023-06-30 15:59:27.112Z:
#10 [context dev_containers_feature_content_source] load from client
#10 transferring dev_containers_feature_content_source: 72.97kB done
2023-06-30 15:59:27.230Z: #10 DONE 0.2s
I do sometimes have intermittent errors with the mcr.microsoft.com images, though not recently.
This worked for me.