-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Install Pluto.jl and jupyter-pluto-proxy (#1929)
* Install Pluto.jl and jupyter-pluto-proxy [Pluto.jl](https://plutojl.org/) is an alternative reactive notebook frontend focused specifically on Julia. I think shipping this by default in the julia-enabled images helps serve the Julia community better, particularly when used with JupyterHub. For context, I am working with the Julia users of the [Jupyter Meets the Earth](https://jupytearth.org/) project, and trying to understand how to best serve their needs on a JupyterHub. We currently maintain a massive image that 'has everything', but I'm trying to instead work upstream wherever possible so everyone working in these subfields can benefit. Meeting Julia users where they are at seems a useful path forward here. * Add note about Pluto.jl to selecting.md * Default to replacing - with _ in package imports * Add jupyter-pluto-proxy to package import mapping * Add Pluto.jl to datascience-notebook image * Add test for pluto proxy starting correctly * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update test_packages.py --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
- Loading branch information
1 parent
127004a
commit 39582f7
Showing
5 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import logging | ||
import secrets | ||
import time | ||
|
||
import requests | ||
|
||
from tests.conftest import TrackedContainer, find_free_port | ||
|
||
LOGGER = logging.getLogger(__name__) | ||
|
||
|
||
def test_pluto_proxy( | ||
container: TrackedContainer, http_client: requests.Session | ||
) -> None: | ||
"""Pluto proxy starts Pluto correctly""" | ||
host_port = find_free_port() | ||
token = secrets.token_hex() | ||
container.run_detached( | ||
command=[ | ||
"start.sh", | ||
"jupyter", | ||
"lab", | ||
"--port=8888", | ||
f"--LabApp.token={token}", | ||
], | ||
ports={"8888/tcp": host_port}, | ||
) | ||
# Give the server a bit of time to start | ||
time.sleep(3) | ||
resp = http_client.get(f"http://localhost:{host_port}/pluto?token={token}") | ||
resp.raise_for_status() | ||
assert "Pluto.jl notebooks" in resp.text, "Pluto.jl text not found in /pluto page" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import logging | ||
import secrets | ||
import time | ||
|
||
import requests | ||
|
||
from tests.conftest import TrackedContainer, find_free_port | ||
|
||
LOGGER = logging.getLogger(__name__) | ||
|
||
|
||
def test_pluto_proxy( | ||
container: TrackedContainer, http_client: requests.Session | ||
) -> None: | ||
"""Pluto proxy starts Pluto correctly""" | ||
host_port = find_free_port() | ||
token = secrets.token_hex() | ||
container.run_detached( | ||
command=[ | ||
"start.sh", | ||
"jupyter", | ||
"lab", | ||
"--port=8888", | ||
f"--LabApp.token={token}", | ||
], | ||
ports={"8888/tcp": host_port}, | ||
) | ||
# Give the server a bit of time to start | ||
time.sleep(3) | ||
resp = http_client.get(f"http://localhost:{host_port}/pluto?token={token}") | ||
resp.raise_for_status() | ||
assert "Pluto.jl notebooks" in resp.text, "Pluto.jl text not found in /pluto page" |