The worker is currently hardcoded to invoke docker containers with the UID 1001:
|
container_logs = client.containers.run( |
|
'%s:latest' % module_name, auto_remove=True, |
|
user=1001, stdout=True, stderr=True, |
|
environment=['PYTHONUNBUFFERED=1'], |
|
volumes={ |
|
input_dir_docker: {'bind': '/mnt/input', 'mode': 'ro'}, |
|
output_dir_docker: {'bind': '/mnt/output', 'mode': 'rw'}}) |
Some docker images may want to run internally as a different UID (e.g. root), so we should expose an environment variable in .env to allow for this.
Note, worker docker images are short-lived and self-contained, so it's of no risk to the MLsploit framework if developers want their worker image to internally run as root.
The worker is currently hardcoded to invoke docker containers with the UID
1001:mlsploit-execution-backend/mlsploit.py
Lines 136 to 142 in b4e992d
Some docker images may want to run internally as a different UID (e.g. root), so we should expose an environment variable in
.envto allow for this.Note, worker docker images are short-lived and self-contained, so it's of no risk to the MLsploit framework if developers want their worker image to internally run as root.