sassoftware / sas-container-recipes

A collection of recipes and other resources for building containers that include SAS Viya software.
https://www.sas.com
Apache License 2.0
89 stars 42 forks source link

Jupyter Notebook kernels fail when running in Azure Container Instance #23

Closed alanzablocki closed 5 years ago

alanzablocki commented 5 years ago

Describe the bug I was able to build a local Docker image, and run SASStudio fine, and was able to run SAS and Python kernels in Jupyter Notebook locally. I then deployed this image to Azure (a hefty 25GB), and SAS Studio works fine so far, but neither SAS nor Python Kernel can connect. I attach the screenshot of the error. Are there some settings that need to change to be able to use Jupyter in Azure hosted Docker image?

To Reproduce Use the default auth and jupyter support addons, upload 25GB Docker image to Azure Container Registry and launch a Docker instance.

Expected behavior Jupyter should work just like it does locally, but it fails to connect

Screenshots Screenshot of Jupyter kernel error: kernels_die

Environment (please complete the applicable information): [azablocki@localhost sas-container-recipes-master]$ docker version Client: Version: 18.09.6 API version: 1.39 Go version: go1.10.8 Git commit: 481bc77156 Built: Sat May 4 02:34:58 2019 OS/Arch: linux/amd64 Experimental: false

Server: Docker Engine - Community Engine: Version: 18.09.6 API version: 1.39 (minimum version 1.12) Go version: go1.10.8 Git commit: 481bc77 Built: Sat May 4 02:02:43 2019 OS/Arch: linux/amd64 Experimental: false

Additional context Reading other issues I execed into the image and this is the information in my local /etc/httpd/conf.d/jpy3_proxy.conf . It is exactly the same in the Azure image, when I exec into that.

<Location /Jupyter> ProxyPass http://localhost:8888/Jupyter ProxyPassReverse http://localhost:8888/Jupyter RequestHeader set Origin "http://localhost:8888"

<Location /Jupyter/api/kernels> ProxyPass ws://localhost:8888/Jupyter/api/kernels ProxyPassReverse ws://localhost:8888/Jupyter/api/kernels

<Location /Jupyter/terminals/> ProxyPass ws://localhost:8888/Jupyter/terminals ProxyPassReverse ws://localhost:8888/Jupyter/terminals

Thank you

alanzablocki commented 5 years ago

I have found the reasons why this was failing, and they are quite simple. I think that initially, I did not launch an instance with port 8888, and thought all was well because a) I could actually reference .westus.azurecontainer.io/Jupyter without specifying ports and b) my local Jupyter kernels were working just fine.

Eventually I also found that the FQDN already appends port 80 to the IP address so that is why it was failing also (80 != 8888). Although one can run SASStudio from .westus.azurecontainer.io/SASStudio, to run Jupyter one needs to use the explicit combination of IP address and port 8888, as in

:8888/Jupyter, then all works well.