Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Child spawner cmd overridden #30

Open
rcthomas opened this issue Jun 21, 2019 · 5 comments
Open

Child spawner cmd overridden #30

rcthomas opened this issue Jun 21, 2019 · 5 comments

Comments

@rcthomas
Copy link
Contributor

I was a bit late to the party to test #27; I have a WrapSpawner implementation that has a custom cmd in the child profiles, and they are now getting overridden by c.Spawner.cmd. I have a profilespawner-like setup and the spawn command is different on different profiles.

Could we modify the directional link logic so that traits set and explicitly passed to the child spawner constructor aren't linked maybe? I can experiment with it next week.

@rkdarst
Copy link
Contributor

rkdarst commented Jun 24, 2019

How are you setting cmd overall, are you setting anything directly on a c.Spawner also? I'm also setting a cmd in ProfileSpawner using the overrides and no where else, and it seems to still work.

@rcthomas
Copy link
Contributor Author

Indeed I'd been setting c.Spawner.cmd and then in the profile setting cmd to something else. If I leave it alone and only set cmd in the profiles then it's OK. I haven't looked into the logic behind the trait values and directional link but I guess traitlets knows if the value's been changed from the default in WrapSpawner (c.Spawner). That was a surprise, we thought what should happen would be a child spawner value would be overridden by the profile regardless of whether the parent had been set in the config by us.

@cexen
Copy link

cexen commented May 15, 2020

Hello,
I encountered a similar issue. For me, notebook_dir and disable_user_config in profiles had no effect on the child spawner.

This is an issue related to #27. By experiment, I confirmed that the directional_link setting overwrites the trait value of self.child_spawner with that of self.

I've created a small PR #39 that restores the overwritten values with a naive approach. I'm not familiar with traitlets; There might be more elegant ways.

@Aethylred
Copy link

I have a WrapSpawner implementation that has a custom cmd in the child profiles

Can you please post an example of this? We're looking at a use case where the spawner chooses to launch custom binary.

@rcthomas
Copy link
Contributor Author

@Aethylred Have a look at the ProfilesSpawner example in the README; you just need to add cmd: "whatever" to the dict being passed there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants