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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 numericIDs (e.g.
2000). By recreating the users database on every restart,that mapping can change seemingly randomly.
For instance, the
datalabuser can have an ID of2000on one boot,with the
loggeruser having an ID of2001, and after rebooting theinstance those numbers could be reversed:
datalabhaving a user IDof
2001andloggerhaving a user ID of2000.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 connectcalls to fail, as the SSHtunnel cannot be created if the
datalabuser cannot log in.This change fixes that problem by making the file ownership of the
/home/datalaband/home/loggerdirectories stable. That is done byattempting 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.pyfile is sufficient todo 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