You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
in the bootstrap_pre_spawn function, you loop over courses and create formgrade-groups and roles as below:
groupsToCreate = {}
base_port = 9000
idx = 0
for course, instructors in COURSES.items():
# "outbound" must exist before starting a singleuser
if not os.path.exists(f'/mnt/exchange/{course}/outbound'):
os.makedirs(f"/mnt/exchange/{course}/outbound")
if not os.path.exists(f'/mnt/exchange/{course}/inbound'):
os.makedirs(f"/mnt/exchange/{course}/inbound")
if not os.path.exists(f'/mnt/exchange/{course}/feedback_public'):
os.makedirs(f"/mnt/exchange/{course}/feedback_public")
with open(f"/mnt/exchange/{course}/nbgrader_config.py", "w") as f:
f.write("c = get_config()\n")
f.write(f"c.CourseDirectory.root = '/mnt/exchange/{course}'\n")
f.write(f"c.CourseDirectory.course_id = '{course}'\n")
c.JupyterHub.services.append(
{
"name": course,
"url": f"http://course-svc:{base_port + idx}",
"command": ["jupyterhub-singleuser", f"--group=formgrade-{course}", f"--port={base_port + idx}", "--debug", "--ServerApp.ip=0.0.0.0"],
"cwd": f"/mnt/exchange/{course}",
"oauth_no_confirm": True,
"environment" : {
# Here nbgrader.auth.JupyterHubAuthPlugin needs a user, that always exists
"JUPYTERHUB_USER": "admin"
}
}
)
groupsToCreate[f"nbgrader-{course}"] = []
groupsToCreate[f"formgrade-{course}"] = instructors
c.JupyterHub.load_roles.append({
"name": f"formgrade-{course}",
"groups": [f"formgrade-{course}"],
"services": [course],
"scopes": [
f"access:services!service={course}",
f"read:services!service={course}",
f"list:services!service={course}",
"groups",
"users"
]
})
idx += 1
c.JupyterHub.load_groups = groupsToCreate
what should I add if I want to create nbgrader- groups for students as well? in particular, should I create a service and add a role?
what rbac scopes should the role have?
best
The text was updated successfully, but these errors were encountered:
Hi,
in the
bootstrap_pre_spawn
function, you loop over courses and create formgrade-groups and roles as below:what should I add if I want to create nbgrader- groups for students as well? in particular, should I create a service and add a role?
what rbac scopes should the role have?
best
The text was updated successfully, but these errors were encountered: