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

Add support for jupyter-server-proxy #144

Closed
randomir opened this issue Dec 9, 2022 · 1 comment · Fixed by #145
Closed

Add support for jupyter-server-proxy #144

randomir opened this issue Dec 9, 2022 · 1 comment · Fixed by #145

Comments

@randomir
Copy link
Member

randomir commented Dec 9, 2022

Using proxy support implemented in #143, it should be easy to support jupyter-server-proxy for users that run Jupyter through reverse proxy.

@randomir
Copy link
Member Author

randomir commented Dec 23, 2022

To test, assuming jupyter-server-proxy is installed, run:

DWAVE_INSPECTOR_JUPYTER_SERVER_PROXY_EXTERNAL_URL='http://127.0.0.1:8888/' jupyter notebook --NotebookApp.token=''

Note: currently, jupyter-based auth is not supported (hence the token is unset above) (root cause: #150).

Open Jupyter notebook and run:

import dimod
import dwave.inspector
from dwave.system import DWaveSampler, EmbeddingComposite

# define problem
bqm = dimod.BQM.from_ising({}, {'ab': 1, 'bc': 1, 'ca': 1})

# get sampler
sampler = EmbeddingComposite(DWaveSampler(solver='Advantage_system4.1'))

# sample
sampleset = sampler.sample(bqm, num_reads=100)

then open the Inspector with:

dwave.inspector.show(sampleset)

Now notice that no request goes to http://localhost:18000 (the location of the inspector server) -- rather inspector requests are proxied via http://127.0.0.1:8888/proxy/18000/<...>.

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.

1 participant