Skip to content

Environment variable to control UID of execution in docker worker. #2

Description

@carter-yagemann

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions