kruize / hpo

Hyper Parameter Optimization
Apache License 2.0
11 stars 14 forks source link

Change the ownership to hpo instead of root for all copied files in Dockerfile #109

Closed kusumachalasani closed 2 years ago

kusumachalasani commented 2 years ago

Signed-off-by: kusumachalasani kchalasa@redhat.com

Description: This fixes the issue #99

From the docker references, the default behavior of docker is to copy with root unless chown flag is used.

Attaching the snapshot from that document and reference:

All new files and directories are created with a UID and GID of 0, unless the optional --chown flag specifies a given username, groupname, or UID/GID combination to request specific ownership of the copied content.

Reference: https://docs.docker.com/engine/reference/builder/#copy

Ownership of files with new changes in Dockerfile:

[hpo@d5bf819453e0 app]$ ls -lrt
total 12
-rw-rw-r--. 1 hpo hpo   79 Sep 23 17:04 requirements.txt
-rw-rw-r--. 1 hpo hpo 1448 Sep 23 17:04 index.html
-rw-rw-r--. 1 hpo hpo  512 Sep 23 17:04 experiment.html
drwxr-xr-x. 5 hpo hpo   57 Sep 23 19:15 src
khansaad commented 2 years ago

@kusumachalasani @dinogun

Able to validate the same in openshift quicklab cluster. PFB logs:

[saakhan@saakhan hpo]$ kubectl get pod -n openshift-tuning

NAME                   READY   STATUS    RESTARTS   AGE

hpo-558bdddf5b-wn828   1/1     Running   0          5m15s

[saakhan@saakhan hpo]$ kubectl -n openshift-tuning exec --stdin --tty hpo-558bdddf5b-wn828 -- /bin/bash

[hpo@hpo-558bdddf5b-wn828 app]$ ls -ltr

total 12
-rw-rw-r--. 1 hpo hpo   79 Sep 28 11:00 requirements.txt
-rw-rw-r--. 1 hpo hpo 1448 Sep 28 11:00 index.html
-rw-rw-r--. 1 hpo hpo  512 Sep 28 11:00 experiment.html
drwxr-xr-x. 1 hpo hpo   57 Sep 28 11:43 src
kusumachalasani commented 2 years ago

Added GPG signs to the commits.