Skip to content

Commit

Permalink
Switch to jovyan as the default user.
Browse files Browse the repository at this point in the history
Selecting a different user is currently creating problems, see
aiidalab/aiidalab-docker-stack#297 .
  • Loading branch information
csadorf committed Sep 15, 2022
1 parent b65a2ce commit 3d3cdbc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion aiidalab_launch/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import toml
from docker.models.containers import Container

from .core import LOGGER
from .util import docker_mount_for, get_docker_env, is_volume_readonly

MAIN_PROFILE_NAME = "default"
Expand Down Expand Up @@ -65,7 +66,7 @@ class Profile:
name: str = MAIN_PROFILE_NAME
port: int | None = field(default_factory=_default_port)
default_apps: list[str] = field(default_factory=lambda: ["aiidalab-widgets-base"])
system_user: str = "aiida"
system_user: str = "jovyan"
image: str = _DEFAULT_IMAGE
home_mount: str | None = None
extra_mounts: set[str] = field(default_factory=set)
Expand Down Expand Up @@ -93,6 +94,12 @@ def __post_init__(self):
self.extra_mounts.remove(extra_mount)
self.extra_mounts.add(f"{extra_mount}:rw")

if (
self.image.split(":")[0] == "aiidalab/full-stack"
and self.system_user != "jovyan"
):
LOGGER.warn("Resetting the system user may create issues for this image!")

def container_name(self) -> str:
return f"{CONTAINER_PREFIX}{self.name}"

Expand Down Expand Up @@ -127,6 +134,7 @@ def environment(self, jupyter_token: str) -> dict:
"AIIDALAB_DEFAULT_APPS": " ".join(self.default_apps),
"JUPYTER_TOKEN": str(jupyter_token),
"SYSTEM_USER": self.system_user,
"NB_USER": self.system_user,
}

def dumps(self) -> str:
Expand Down

0 comments on commit 3d3cdbc

Please sign in to comment.