Skip to content

Commit 71afd5a

Browse files
authored
Merge pull request 2i2c-org#2938 from consideRatio/pr/2i2c-itcoocean-add-shared-public-mount
2i2c-aws-us, itcoocean: mount shared-public folder
2 parents c4e2ef1 + a85e64e commit 71afd5a

File tree

3 files changed

+76
-41
lines changed

3 files changed

+76
-41
lines changed

config/clusters/2i2c-aws-us/itcoocean.values.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,41 @@ jupyterhub:
5353
admin_users:
5454
- eeholmes # Eli Holmes, Community representative
5555
singleuser:
56+
# shared-public for collaboration
57+
# See https://github.com/2i2c-org/infrastructure/issues/2821#issuecomment-1665642853
58+
storage:
59+
extraVolumeMounts:
60+
- name: home
61+
mountPath: /home/jovyan/shared
62+
subPath: _shared
63+
readOnly: true
64+
- name: home
65+
mountPath: /home/jovyan/shared-public
66+
subPath: _shared-public
67+
readOnly: false
68+
initContainers:
69+
- name: volume-mount-ownership-fix
70+
image: busybox
71+
command:
72+
[
73+
"sh",
74+
"-c",
75+
"id && chown 1000:1000 /home/jovyan && chown 1000:1000 /home/jovyan/shared-readwrite && chown 1000:1000 /home/jovyan/shared-public && ls -lhd /home/jovyan ",
76+
]
77+
securityContext:
78+
runAsUser: 0
79+
volumeMounts:
80+
- name: home
81+
mountPath: /home/jovyan
82+
subPath: "{username}"
83+
# Mounted without readonly attribute here,
84+
# so we can chown it appropriately
85+
- name: home
86+
mountPath: /home/jovyan/shared-readwrite
87+
subPath: _shared
88+
- name: home
89+
mountPath: /home/jovyan/shared-public
90+
subPath: _shared-public
5691
extraEnv:
5792
SCRATCH_BUCKET: s3://scratch-itcoocean/$(JUPYTERHUB_USER)
5893
PANGEO_SCRATCH: s3://scratch-itcoocean/$(JUPYTERHUB_USER)

docs/howto/features/per-user-db.md

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,18 @@ jupyterhub:
6868
securityContext:
6969
runAsUser: 0
7070
volumeMounts:
71-
- name: home
72-
mountPath: /home/jovyan
73-
subPath: "{username}"
74-
# Here so we can chown it appropriately
75-
- name: home
76-
mountPath: /home/jovyan/shared-readwrite
77-
subPath: _shared
78-
- name: postgres-db
79-
mountPath: /var/lib/postgresql/data
80-
# postgres recommends against mounting a volume directly here
81-
# So we put data in a subpath
82-
subPath: data
71+
- name: home
72+
mountPath: /home/jovyan
73+
subPath: "{username}"
74+
# Here so we can chown it appropriately
75+
- name: home
76+
mountPath: /home/jovyan/shared-readwrite
77+
subPath: _shared
78+
- name: postgres-db
79+
mountPath: /var/lib/postgresql/data
80+
# postgres recommends against mounting a volume directly here
81+
# So we put data in a subpath
82+
subPath: data
8383
storage:
8484
extraVolumes:
8585
- name: postgres-db
@@ -111,27 +111,27 @@ jupyterhub:
111111
memory: 64Mi
112112
cpu: 0.01
113113
env:
114-
# Configured using the env vars documented in https://hub.docker.com/_/postgres/
115-
# Postgres is only listening on localhost, so we can trust all connections that come to it
116-
- name: POSTGRES_HOST_AUTH_METHOD
117-
value: "trust"
118-
# The name of the default user in our user image is jovyan, so the postgresql superuser
119-
# should also be called that
120-
- name: POSTGRES_USER
121-
value: "jovyan"
122-
securityContext:
123-
runAsUser: 1000
124-
volumeMounts:
125-
# Mount the user homedirectory in the postgres db container as well, so postgres commands
126-
# that load data into the db from disk work
127-
- name: home
128-
mountPath: /home/jovyan
129-
subPath: "{username}"
130-
- name: postgres-db
131-
mountPath: /var/lib/postgresql/data
132-
# postgres recommends against mounting a volume directly here
133-
# So we put data in a subpath
134-
subPath: data
114+
# Configured using the env vars documented in https://hub.docker.com/_/postgres/
115+
# Postgres is only listening on localhost, so we can trust all connections that come to it
116+
- name: POSTGRES_HOST_AUTH_METHOD
117+
value: "trust"
118+
# The name of the default user in our user image is jovyan, so the postgresql superuser
119+
# should also be called that
120+
- name: POSTGRES_USER
121+
value: "jovyan"
122+
securityContext:
123+
runAsUser: 1000
124+
volumeMounts:
125+
# Mount the user homedirectory in the postgres db container as well, so postgres commands
126+
# that load data into the db from disk work
127+
- name: home
128+
mountPath: /home/jovyan
129+
subPath: "{username}"
130+
- name: postgres-db
131+
mountPath: /var/lib/postgresql/data
132+
# postgres recommends against mounting a volume directly here
133+
# So we put data in a subpath
134+
subPath: data
135135
```
136136
137137
## Cleanup created disks after use

docs/topic/infrastructure/storage-layer.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ Parts of the *home* volume are mounted in different places for the users:
9797
singleuser:
9898
storage:
9999
extraVolumeMounts:
100-
- name: home
101-
mountPath: /home/jovyan/shared-public
102-
subPath: _shared-public
103-
readOnly: false
104-
- name: home
105-
mountPath: /home/jovyan/shared
106-
subPath: _shared
107-
readOnly: true
100+
- name: home
101+
mountPath: /home/jovyan/shared
102+
subPath: _shared
103+
readOnly: true
104+
- name: home
105+
mountPath: /home/jovyan/shared-public
106+
subPath: _shared-public
107+
readOnly: false
108108
initContainers:
109109
- name: volume-mount-ownership-fix
110110
image: busybox

0 commit comments

Comments
 (0)