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
Commits
515a1f4a
Commit
515a1f4a
authored
1 year ago
by
Ihli, Monica
Browse files
Options
Downloads
Patches
Plain Diff
add log msgs
parent
11cfe0cc
No related branches found
No related tags found
1 merge request
!18
add log msgs
Pipeline
#362145
waiting for manual action
Stage: test
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
additional_functions.py
+5
-4
5 additions, 4 deletions
additional_functions.py
with
5 additions
and
4 deletions
additional_functions.py
+
5
−
4
View file @
515a1f4a
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment