Kattis / problemtools

Tools to manage problem packages using the Kattis problem package format.
MIT License
105 stars 72 forks source link

Docker arm64 build (e.g., for apple M1 chip) #199

Open FinnLidbetter opened 3 years ago

FinnLidbetter commented 3 years ago

To get problemtools running with Docker on an arm64 architecture machine (e.g., a mac with an Apple M1 chip) a custom Docker image should be built.

I built such an image locally with docker buildx build . on my arm64 machine, but it should be able to be built on non-arm64 machines with docker buildx build --platform linux/arm64/v8 .

Docker builds on this architecture could be added official Docker problemtools repository. Adding such an image and a note in the README.md would be my preferred solution to this issue. Until such a build is available in the problemtools repository, or if it is decided not to be added, anyone else wishing to use the build can do one of the following: Option A:

  1. Download/clone this git repo.
  2. Run docker buildx build .
  3. Use docker images to see the image ID of the newly built image and run docker using that image ID.
  4. (Optional) Rename the newly created docker image with docker tag IMAGE-ID problemtools

Option B:

  1. Get the docker image that I have made available at docker hub with docker pull finnlidbetter/problemtools-icpc-arm

Note that it was found that running the existing docker image under emulation with docker run -it --rm --platform linux/arm64/v8 problemtools/icpc was unusably slow. Anecdotally, executing a submission on one test case through the Docker container was 80--100x slower than running it locally.