openml / automlbenchmark

OpenML AutoML Benchmarking Framework
https://openml.github.io/automlbenchmark
MIT License
399 stars 132 forks source link

Docker/permissions #550

Closed PGijsbers closed 1 year ago

PGijsbers commented 1 year ago

Removes the logic about users and permissions for docker introduced in #495. Instead, introduces a docker.run_as option which can run the docker container as a specific user (root, current unix user, or a specific other user).

The problem with the previous implementation was that it did not work if the docker images were meant to be shared, as the creators uid/gid were embedded in it. I tried to look for a general solution that would work in both cases, but in doing so I found that docker is inconsistent. I had two users, both on ubuntu 22.04.02 and docker cb74dfc, run:

mkdir output
docker run -v $(pwd)/output:/output -u 0:0 --entrypoint=/bin/bash ubuntu:22.04 -c "touch /output/a$(date +%H%M%S)"
docker run -v $(pwd)/output:/output -u $(id -u):$(id -g) --entrypoint=/bin/bash ubuntu:22.04 -c "touch /output/b$(date +%H%M%S)"

One had the root file listed under her own name on the host machine while the second command gave a permission error. The other had the root file listed under root on the host machine while the second command created it under his name. Help is welcome, but until then we'll leave it configurable.

Additionally: