Skip to content

Support bash kernel in notebook-http mode #382

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

Merged

Conversation

kevin-bates
Copy link
Member

While looking into #381, it was found that the execution request sent to the kernel to initialize the REQUEST information into the kernel's state, was triggering a command not found exception because bash variable initialization doesn't tolerate space-separated initialization and, as a result, took the following statement as an attempt to execute the command REQUEST:

REQUEST = "{\\"body\\": \\"\\", \\"args\\": {}, \\"path\\": {}, \\"headers\\": {\\"Host\\": \\"127.0.0.1:10100\\", \\"User-Agent\\": \\"curl/7.85.0\\", \\"Accept\\": \\"*/*\\"}}"

This pull request adds an additional format statement unique to bash kernels that removes the spaces around the statement, resulting in an execution request of:

REQUEST="{\\"body\\": \\"\\", \\"args\\": {}, \\"path\\": {}, \\"headers\\": {\\"Host\\": \\"127.0.0.1:10100\\", \\"User-Agent\\": \\"curl/7.85.0\\", \\"Accept\\": \\"*/*\\"}}"

Resolves #381

@codecov
Copy link

codecov bot commented Feb 7, 2023

Codecov Report

Patch coverage: 96.00% and project coverage change: +0.08 🎉

Comparison is base (c72803a) 95.69% compared to head (7e934a4) 95.77%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #382      +/-   ##
==========================================
+ Coverage   95.69%   95.77%   +0.08%     
==========================================
  Files          31       31              
  Lines        2251     2273      +22     
==========================================
+ Hits         2154     2177      +23     
+ Misses         97       96       -1     
Impacted Files Coverage Δ
kernel_gateway/tests/test_jupyter_websocket.py 99.45% <ø> (ø)
kernel_gateway/gatewayapp.py 84.66% <88.88%> (+0.68%) ⬆️
kernel_gateway/notebook_http/request_utils.py 100.00% <100.00%> (ø)
..._gateway/tests/notebook_http/test_request_utils.py 100.00% <100.00%> (ø)
kernel_gateway/tests/test_gatewayapp.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@kevin-bates kevin-bates merged commit 7d592e7 into jupyter-server:master Mar 2, 2023
@kevin-bates kevin-bates deleted the support-bash-kernel-http-mode branch March 2, 2023 17:56
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.

Using bash kernel in notebook-http mode
2 participants