DockerSpawner volume parameter

48 views
Skip to first unread message

Maria Julia Lima

unread,
Aug 17, 2017, 1:06:22 PM8/17/17
to Project Jupyter
Hello

I am a beginner in Jupyterhub and I am investigating an integration of a web application to Jupyterhub. This application has its on file repository and each user has access to its on path. I have implemented an Authenticator that receives a query parameter with the user's path and I would like to transfer this path to the DockerSpawner in order to be used as the volume parameter for the container. 

If someone could give me a suggestion that would be great.

Thanks in advance.
Julia

MinRK

unread,
Aug 18, 2017, 2:13:01 AM8/18/17
to Project Jupyter

Authenticator.pre_spawn_start might be what you are after. It’s called prior to each Spawner starting.

def pre_spawn_start(self, spawner):
    user = spawner.user
    volumes = self.volumes_for_user(user.name)
    spawner.volumes.update(volumes)

-Min


--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/fb80b68e-0c78-4621-8c05-2efceb9d697b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Maria Julia Lima

unread,
Aug 21, 2017, 12:01:02 PM8/21/17
to Project Jupyter
Many thanks, Min.

My authenticator uses a customized handle that processes the query parameters received from the http request. 
Can the authenticator have access to this handle reference?
 
By the way, I implemented a solution using user.auth_state and it works. 

-- Julia

Em sexta-feira, 18 de agosto de 2017 03:13:01 UTC-3, Min RK escreveu:

Authenticator.pre_spawn_start might be what you are after. It’s called prior to each Spawner starting.

def pre_spawn_start(self, spawner):
    user = spawner.user
    volumes = self.volumes_for_user(user.name)
    spawner.volumes.update(volumes)

-Min

On Thu, Aug 17, 2017 at 7:06 PM, Maria Julia Lima <mjuli...@gmail.com> wrote:
Hello

I am a beginner in Jupyterhub and I am investigating an integration of a web application to Jupyterhub. This application has its on file repository and each user has access to its on path. I have implemented an Authenticator that receives a query parameter with the user's path and I would like to transfer this path to the DockerSpawner in order to be used as the volume parameter for the container. 

If someone could give me a suggestion that would be great.

Thanks in advance.
Julia

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.

MinRK

unread,
Aug 21, 2017, 1:11:18 PM8/21/17
to Project Jupyter
On Mon, Aug 21, 2017 at 6:01 PM, Maria Julia Lima <mjuli...@gmail.com> wrote:
Many thanks, Min.

My authenticator uses a customized handle that processes the query parameters received from the http request. 
Can the authenticator have access to this handle reference? 
 
By the way, I implemented a solution using user.auth_state and it works. 


It can be passed the Handler during authenticate, but not during spawn. This is exactly what auth_state is for - Authenticators saving info during authentication to pass to spawn. I'm glad you got it working!

-Min

 

-- Julia

Em sexta-feira, 18 de agosto de 2017 03:13:01 UTC-3, Min RK escreveu:

Authenticator.pre_spawn_start might be what you are after. It’s called prior to each Spawner starting.

def pre_spawn_start(self, spawner):
    user = spawner.user
    volumes = self.volumes_for_user(user.name)
    spawner.volumes.update(volumes)

-Min


On Thu, Aug 17, 2017 at 7:06 PM, Maria Julia Lima <mjuli...@gmail.com> wrote:
Hello

I am a beginner in Jupyterhub and I am investigating an integration of a web application to Jupyterhub. This application has its on file repository and each user has access to its on path. I have implemented an Authenticator that receives a query parameter with the user's path and I would like to transfer this path to the DockerSpawner in order to be used as the volume parameter for the container. 

If someone could give me a suggestion that would be great.

Thanks in advance.
Julia

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/fb80b68e-0c78-4621-8c05-2efceb9d697b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.

To post to this group, send email to jup...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages