You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 3, 2022. It is now read-only.
Ensure that home directories have the right owner at startup. (#2067)
Apparently, Container Optimized OS stores the users database in a temp
filesystem, causing it to get lost and recreated every time an
instance is restarted.
Among the many important things recorded in that database is the
mapping from user names (e.g. `datalab`) to user numeric
IDs (e.g. `2000`). By recreating the users database on every restart,
that mapping can change seemingly randomly.
For instance, the `datalab` user can have an ID of `2000` on one boot,
with the `logger` user having an ID of `2001`, and after rebooting the
instance those numbers could be reversed: `datalab` having a user ID
of `2001` and `logger` having a user ID of `2000`.
Since file ownership is defined in terms of user ID, this means that
the owner of files under each home directory can change randomly every
time an instance is rebooted.
That, in turn, causes `datalab connect` calls to fail, as the SSH
tunnel cannot be created if the `datalab` user cannot log in.
This change fixes that problem by making the file ownership of the
`/home/datalab` and `/home/logger` directories stable. That is done by
attempting to assign those two users consistent UIDs, and then forcing
the file ownership to match the corresponding users even if the UID
has changed.
Changing the startup script in the `create.py` file is sufficient to
do this for both regular and gpu-enabled instances, as GPU instances
no longer have their own startup-script extensions. This change
also removes the structure that was previously used for startup-script
extensions in order to make clear the fact that they are no longer
used.
This fixes#2014
0 commit comments