Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jupyter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ARM
k8s
jupyter
Merge requests
!18
add log msgs
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
add log msgs
dev
into
prod
Overview
0
Commits
1
Pipelines
2
Changes
1
Merged
Ihli, Monica
requested to merge
dev
into
prod
1 year ago
Overview
0
Commits
1
Pipelines
2
Changes
1
Expand
0
0
Merge request reports
Compare
prod
prod (base)
and
latest version
latest version
515a1f4a
1 commit,
1 year ago
1 file
+
5
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
additional_functions.py
+
5
−
4
Options
@@ -15,8 +15,9 @@ ARM_LDAP_GID_ATTR = 'gidNumber'
def
get_profiles
(
spawner
):
auth_state
=
yield
spawner
.
user
.
get_auth_state
()
profile_list
=
[]
spawner
.
log
.
info
(
"
@
"
*
80
)
# either internal profile OR science profile, no need for both
spawner
.
log
.
info
(
f
"
GROUPS:
{
auth_state
[
'
oauth_user
'
][
'
groups
'
]
}
"
)
if
'
ace-jupyter-infrastructure
'
in
auth_state
[
'
oauth_user
'
][
'
groups
'
]
or
\
'
ars-research-adc-users
'
in
auth_state
[
'
oauth_user
'
][
'
groups
'
]:
profile_list
.
append
(
profiles
.
internal_profile
)
@@ -27,7 +28,7 @@ def get_profiles(spawner):
profile_list
.
append
(
profiles
.
educational_profile
)
profile_list
.
append
(
profiles
.
default_profile
)
# everyone gets access
spawner
.
log
.
info
(
"
@
"
*
80
)
return
profile_list
@@ -38,7 +39,7 @@ def get_profiles(spawner):
def
set_env
(
spawner
):
auth_state
=
yield
spawner
.
user
.
get_auth_state
()
spawner
.
log
.
info
(
f
"
ORIGINAL AUTH STATE:
{
auth_state
}
"
)
spawner
.
log
.
info
(
"
@
"
*
80
+
f
"
\n
ORIGINAL AUTH STATE:
{
auth_state
}
\n
"
+
"
@
"
*
80
)
spawner
.
uid
=
int
(
auth_state
[
'
oauth_user
'
][
'
uid
'
])
spawner
.
run_as_uid
=
int
(
auth_state
[
'
oauth_user
'
][
'
uid
'
])
spawner
.
gid
=
int
(
auth_state
[
'
oauth_user
'
][
'
gid
'
])
@@ -55,8 +56,8 @@ def set_env(spawner):
spawner
.
environment
[
'
USER
'
]
=
auth_state
[
'
oauth_user
'
][
'
preferred_username
'
]
# This XDG env variable needed to play nice with matplotlib
spawner
.
environment
[
'
XDG_CACHE_HOME
'
]
=
f
'
/home/
{
spawner
.
user
.
name
}
/.cache/
'
spawner
.
disable_user_config
=
False
spawner
.
log
.
info
(
"
@
"
*
80
+
f
"
\n
NEW AUTH STATE:
{
auth_state
}
\n
"
+
"
@
"
*
80
)
# Because keycloak OIDC service doesn't have the LDAP group GIDs, we have to manually pull this.
# Since Jhub gets the group names, we can use those to get the GIDs to hand to the spawner
Loading