Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
{
"name": "pandas",
"context": ".",
"dockerFile": "Dockerfile",
"service": "dev",
"workspaceFolder": "/home/pandas",
"dockerComposeFile": "docker-compose.yml",
// The 'dockerFile' property is optional and can be used instead of 'dockerComposeFile' if you want to use a single Dockerfile.
// If you use 'dockerFile', uncomment the line below and remove the 'dockerComposeFile' line above.
// "dockerFile": "Dockerfile",

// Use 'settings' to set *default* container specific settings.json values on container create.
// You can edit these settings after create using File > Preferences > Settings > Remote.
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ RUN apt-get update && \
apt-get --no-install-recommends -y install \
build-essential \
bash-completion \
# Install Qt5 dependencies for pytest-qt, only for m chip Macs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this only affects Macs? I vaguely recall there being some kind of issue with qt on all platforms, and since this is in a Dockerfile anyway I'm not sure why the host should matter

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apparently not only Macs, but arm64 arch in general?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this has anything to do with the platform architecture, but rather when running a headless environment (like a Docker container)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to fix this issue too. My approach was to use PyQt6 (#62176).

The main problem is that PyQt5 doesn't provide pre-compiled binaries for linux-arm64.

If you want to have PyQt5 in the container, you must compile it from source. For that, you will need to install some Qt5 libraries. I was verifying this approach with QEMU emulation, but after 3h building PyQt5, I gave up on the idea.

Another solution is to remove the Qt dependencies from the image for ARM64.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The qt dependency is only for a very small set of tests in the code base. If it's problematic for environment creation, I think it would be fine to separate that out

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @WillAyd, I applied your idea on #62422.

#-y qt5-qmake qtbase5-dev\
# hdf5 needed for pytables installation
libhdf5-dev \
# libgles2-mesa needed for pytest-qt
Expand Down
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: '3'
services:
dev:
build:
context: .
dockerfile: Dockerfile
# Uncomment the line below if you are using Mac with M1/M2/M3 and encounter build issues.
# platform: linux/amd64
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're adding docker-compose because platform cannot be specified in .devcontainer.json, is that right?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. yes VS Code Dev Containers does not support a plain Dockerfile to automatically detect or adjust for architecture differences. By default, it tries to build the image using the host architecture—arm64 on Apple Silicon. docker-compose.yml makes it possible to force the dev containers build with amd 64 instead

  2. actually an other architecture like intel x86 user can also use this docker-compose.ym even if "platform: linux/amd64" is not uncommit. Docker will detected whether the architecture fit or not. If not, docker will build it with default suitable platform. However i dont have another pc to test so just in case i comment this line

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should add docker-compose.yml here; as @rhshadrach already mentioned we have very little support activity in our Docker space, so I don't think we should expand it at the moment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. yes VS Code Dev Containers does not support a plain Dockerfile to automatically detect or adjust for architecture differences. By default, it tries to build the image using the host architecture—arm64 on Apple Silicon. docker-compose.yml makes it possible to force the dev containers build with amd 64 instead
  2. actually an other architecture like intel x86 user can also use this docker-compose.ym even if "platform: linux/amd64" is not uncommit. Docker will detected whether the architecture fit or not. If not, docker will build it with default suitable platform. However i dont have another pc to test so just in case i comment this line

If you put
FROM --platform=linux/amd64 python:3.11.13 into the Dockerfile itself, it will be built for amd64, even on apple silicon Mac

Loading