To migrate an image to the new training management version, perform the following operations:
You can modify an image by referring to the following Dockerfile so that the image complies with specifications for custom images of the new-version training management.
FROM {An existing image} USER root RUN groupadd ma-group -g 100 && \ useradd -d /home/ma-user -m -u 1000 -g 100 -s /bin/bash ma-user # [important] avoid missing training log ENV PYTHONUNBUFFERED=1 USER ma-user WORKDIR /home/ma-user
In the new-version training management, custom images are executed by the user whose UID is 1000 by default. Before using an image in the new-version training management, check image file permissions on the server where the image was built. The process is as follows:
Run the following command to specify the user whose UID is 1000 to run the image:
docker run -u 1000 -ti {Custom image} bash
Run the boot command (such as the following command) in the container during image runtime:
python train.py
Check whether there are any Permission denied error.
If Permission denied is displayed for a file, for example, train.py, run the following command to change the file that belongs to the user whose UID is 1000:
chown 1000 train.py