/julia-hpc-tutorial-sc24

Primary LanguageHTMLBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

plot

The Julia Language for Productive High-Performance Computing Tutorial @ SC24

This repository contains the material used for The Julia Language for Productive High-Performance Computing Tutorial @ Supercomputing 2024.

Apply for your Training at a DOE Supercomputer Now!

We will post a signup form soon. Please check here again at least one month before the start of SC24

Julia for HPC Birds of a Feather session @ SC24

We will again host a Julia for HPC BoF at SC24

Running JupyterLab

Locally

Note

This is our recommended option, as you will more easily be able to keep playing with the notebook afterwards.

Clone this repository (make sure to install Git) and then enter inside the new directory by running the following commands in a terminal (we recommend using PowerShell if on Windows):

git clone https://github.com/JuliaParallel/julia-hpc-tutorial-sc24
cd julia-hpc-tutorial-sc24

After installing Julia, start it with

julia --project=.

and then inside the Julia REPL you can run JupyterLab with

# Necessary only the first time, to instantiate the environment
using Pkg
Pkg.instantiate()

# Run the notebook
import IJulia
IJulia.jupyterlab()

This should open a tab in your default browser showing the JupyterLab interface.

Using a Docker container

We also provide a Docker image (built for linux/amd64 and linux/arm64) for running the notebook, which you can pull with

docker pull ghcr.io/juliaparallel/julia-hpc-tutorial-sc24:main

JupyterLab can then be run on MacOS or Linux with

docker run -p 8888:8888 ghcr.io/juliaparallel/julia-hpc-tutorial-sc24:main julia -e 'import Conda; run(`$(joinpath(Conda.SCRIPTDIR, "jupyter")) lab --allow-root --ip 0.0.0.0 --port 8888`)'

or if using PowerShell on Windows with

docker run -p 8888:8888 ghcr.io/juliaparallel/julia-hpc-tutorial-sc24:main julia -e 'import Conda; run(`$(joinpath(Conda.SCRIPTDIR, """""jupyter""""")) lab --allow-root --ip 0.0.0.0 --port 8888`)'

This will launch JupyterLabl within the container, and if successful you should see a message similar to

    To access the server, open this file in a browser:
        file:///root/.local/share/jupyter/runtime/jpserver-13-open.html
    Or copy and paste one of these URLs:
        http://7a88b848fcf0:8888/lab?token=4775e74fd85e95632e1cfeb32753eb3d009ca0fb76fca3b0
        http://127.0.0.1:8888/lab?token=4775e74fd85e95632e1cfeb32753eb3d009ca0fb76fca3b0

where 4775e74fd85e95632e1cfeb32753eb3d009ca0fb76fca3b0 in the URL will be replaced with another random alphanumeric string. The JupyterLab environment is accessed as a web app, so you should open a browser window and navigate to the http://127.0.0.1:8888/lab?token=.... URL indicated in the message to open the JupyterLab interface. If you get Unable to connect message or similar when trying to open the URL, you may need to replace the 0.0.0.0 component with localhost, so for the example above you would navigate to http://localhost:8888/lab?token=4775e74fd85e95632e1cfeb32753eb3d009ca0fb76fca3b0.

GitHub Codespaces

You can also take advantage of the ability of GitHub Codespaces to run custom web apps. Go go the Codespaces page of this repository, click on the green button on the top right "Create codespace on main" and wait a few seconds for the codespace to start. In the bottom panel, go to the "Terminal" tab (other tabs should be "Problems", "Output", "Debug console", "Ports") and when you see the message (this can take a few seconds to appear after the codespace started, hold on)

    To access the server, open this file in a browser:
        file:///root/.local/share/jupyter/runtime/jpserver-13-open.html
    Or copy and paste one of these URLs:
        http://7a88b848fcf0:8888/lab
        http://127.0.0.1:8888/lab

go to the "Ports" tab, right click on the port 8888 and click on "Open in browser" (alternatively, click on the globe-shaped button under the "Forwarded Addresses" column). This will open the JupyterLab landing page in a new tab in your browser.

If you want to make your app accessible to others (please remember to make sure there's no sensitive or private data in it!), navigate to the "Ports" tab, right click on the port 8888 and then "Port visibility" -> "Public".

The .devcontainer used here has been adapted from the Julia workshop for the UCL Festival of Digital Research & Scholarship 2024, in turn based on the Zero-setup R workshops with GitHub Codespaces repository presented at rstudio::conf 2022.