Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
Jupyter Docker Stacks
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Jupyter Docker Stacks
Commits
185a9f74
Commit
185a9f74
authored
Mar 20, 2019
by
Peter Parente
Committed by
GitHub
Mar 20, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #833 from javabrett/chown-logging-and-tests
chown: add logging and a test
parents
0d96d933
e29f669f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
base-notebook/start.sh
base-notebook/start.sh
+2
-1
base-notebook/test/test_container_options.py
base-notebook/test/test_container_options.py
+17
-0
No files found.
base-notebook/start.sh
View file @
185a9f74
...
@@ -50,11 +50,12 @@ if [ $(id -u) == 0 ] ; then
...
@@ -50,11 +50,12 @@ if [ $(id -u) == 0 ] ; then
# Handle case where provisioned storage does not have the correct permissions by default
# Handle case where provisioned storage does not have the correct permissions by default
# Ex: default NFS/EFS (no auto-uid/gid)
# Ex: default NFS/EFS (no auto-uid/gid)
if
[[
"
$CHOWN_HOME
"
==
"1"
||
"
$CHOWN_HOME
"
==
'yes'
]]
;
then
if
[[
"
$CHOWN_HOME
"
==
"1"
||
"
$CHOWN_HOME
"
==
'yes'
]]
;
then
echo
"Changing ownership of /home/
$NB_USER
to
$NB_UID
:
$NB_GID
"
echo
"Changing ownership of /home/
$NB_USER
to
$NB_UID
:
$NB_GID
with options '
${
CHOWN_HOME_OPTS
}
'
"
chown
$CHOWN_HOME_OPTS
$NB_UID
:
$NB_GID
/home/
$NB_USER
chown
$CHOWN_HOME_OPTS
$NB_UID
:
$NB_GID
/home/
$NB_USER
fi
fi
if
[
!
-z
"
$CHOWN_EXTRA
"
]
;
then
if
[
!
-z
"
$CHOWN_EXTRA
"
]
;
then
for
extra_dir
in
$(
echo
$CHOWN_EXTRA
|
tr
','
' '
)
;
do
for
extra_dir
in
$(
echo
$CHOWN_EXTRA
|
tr
','
' '
)
;
do
echo
"Changing ownership of
${
extra_dir
}
to
$NB_UID
:
$NB_GID
with options '
${
CHOWN_EXTRA_OPTS
}
'"
chown
$CHOWN_EXTRA_OPTS
$NB_UID
:
$NB_GID
$extra_dir
chown
$CHOWN_EXTRA_OPTS
$NB_UID
:
$NB_GID
$extra_dir
done
done
fi
fi
...
...
base-notebook/test/test_container_options.py
View file @
185a9f74
...
@@ -61,6 +61,23 @@ def test_gid_change(container):
...
@@ -61,6 +61,23 @@ def test_gid_change(container):
assert
'groups=110(jovyan),100(users)'
in
logs
assert
'groups=110(jovyan),100(users)'
in
logs
def
test_chown_extra
(
container
):
"""Container should change the UID/GID of CHOWN_EXTRA."""
c
=
container
.
run
(
tty
=
True
,
user
=
'root'
,
environment
=
[
'NB_UID=1010'
,
'NB_GID=101'
,
'CHOWN_EXTRA=/opt/conda'
,
'CHOWN_EXTRA_OPTS=-R'
,
],
command
=
[
'start.sh'
,
'bash'
,
'-c'
,
'stat -c
\'
%
n:
%
u:
%
g
\'
/opt/conda/LICENSE.txt'
]
)
# chown is slow so give it some time
c
.
wait
(
timeout
=
120
)
assert
'/opt/conda/LICENSE.txt:1010:101'
in
c
.
logs
(
stdout
=
True
)
.
decode
(
'utf-8'
)
def
test_sudo
(
container
):
def
test_sudo
(
container
):
"""Container should grant passwordless sudo to the default user."""
"""Container should grant passwordless sudo to the default user."""
c
=
container
.
run
(
c
=
container
.
run
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment