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

Handle connection key being empty to support Google Colaboratory #329

Merged
merged 2 commits into from
Mar 8, 2019

Conversation

shadaj
Copy link
Contributor

@shadaj shadaj commented Mar 7, 2019

When running kernels on Google Colaboratory, the key value in connection.json is empty to indicate that authentication and signature checking should be disabled (noted in the official docs). This PR updates ZeromqSocketImpl to handle the situation where key is empty by using an empty string as the signature when sending a message and skipping the signature check when receiving a message. With these changes, Almond works perfectly inside Colaboratory.

@alexarchambault
Copy link
Member

alexarchambault commented Mar 7, 2019

Thanks @shadaj!

Maybe we could add a test case for it in ZeromqSocketTests, to prevent regressions. I guess a test like the current simple one, but with an empty key, should be enough.

@shadaj
Copy link
Contributor Author

shadaj commented Mar 7, 2019

@alexarchambault just added in a unit test!

@alexarchambault
Copy link
Member

Thanks, merging!

@alexarchambault alexarchambault merged commit 548dc10 into almond-sh:master Mar 8, 2019
@laughedelic
Copy link

How can I enable Almond in Colab?

@alexarchambault
Copy link
Member

alexarchambault commented Mar 11, 2019

@laughedelic I've been installing it by running this notebook. Then importing a notebook (e.g. from the example repo) seems to work.

@alexarchambault
Copy link
Member

alexarchambault commented Mar 11, 2019

Don't know if @shadaj does it this way.

@laughedelic
Copy link

Cool! Thanks for sharing! I didn't know that I can import notebooks.

@shadaj
Copy link
Contributor Author

shadaj commented Mar 11, 2019

Working on a blog post coming soon :)

@alexarchambault
Copy link
Member

Looking forward to it!

I mentioned Colaboratory in the release notes for 0.3.1. They are on their way to the blog (once the CI has pushed them there).

@shadaj shadaj deleted the colab-support branch March 12, 2019 22:47
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 this pull request may close these issues.

3 participants