> For the complete documentation index, see [llms.txt](https://workshop.dukeieee.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://workshop.dukeieee.org/workshops/jetstream-2-tutorial.md).

# Jetstream 2 tutorial

{% hint style="warning" %}
Requires a Duke NetID and registration with the Duke Campus Champions allocation. Registration for the Intro to Supercomputing workshop will automatically give you access to the allocation.&#x20;
{% endhint %}

## Jetstream 2

Jetstream2 is a cloud-based infrastructure designed to support research, education, and scientific computing. It provides virtual machines and storage resources, allowing users to easily access and manage customized computing environments for a wide range of applications. Jetstream2 is particularly useful for those who need flexible and scalable computing resources without the complexity of traditional high-performance computing (HPC) systems. It supports projects in various fields such as data analysis, modeling, and research collaboration, making advanced computing more accessible to the academic community.

## login to Jetstream

<figure><img src="/files/UYn9oXaD9m4oEH6FJWrd" alt=""><figcaption></figcaption></figure>

Go to <https://jetstream2.exosphere.app/exosphere/home>

click add allocation

<figure><img src="/files/Dj5Nfw5p7sYGha8NV2zu" alt=""><figcaption></figcaption></figure>

click add ACCESS account&#x20;

<figure><img src="/files/8IlL6FaFpXMp0GOtHibX" alt=""><figcaption></figcaption></figure>

&#x20;select Duke as the provider

<figure><img src="/files/fN9JVQELBDYC8YxwOMTt" alt=""><figcaption></figcaption></figure>

Registering for the intro to supercomputing workshop should have added you to the Duke Campus Champion allocation. Email <sanjeev.chauhan@duke.edu> if you are not part of it.&#x20;

<figure><img src="/files/ziGcrdBgXEq4uURbu8mV" alt=""><figcaption></figcaption></figure>

Create a new instance, add a name, pick ubuntu 22.04 and pick the smallest parameters as shown below.&#x20;

<figure><img src="/files/7wcb1G709i9oksvratQO" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/aUbmGQYMpvA7frlIbP0I" alt=""><figcaption></figcaption></figure>

Wait for your instance to build and then click connect to and web terminal to connect to it.&#x20;

## Launching Jupyter on Jetstream2

**Using Web Desktop in Exosphere**

For a seamless experience with Jupyter notebooks on Jetstream2, initiate an instance through Exosphere, ensuring the web desktop option is activated.

1. Start an instance and wait for allocation.&#x20;
2. Launch a web terminal or ssh into the machine.

**Accessing Jupyter through Web Shell or SSH Session**

Given that a virtual machine is generally unaware of its public IP, Jetstream2 provides a script that retrieves your VM’s IP and integrates it into the URL provided by Jupyter.

To remotely initiate Jupyter via web shell or SSH:

1. Input the commands:

   ```bash
   module load anaconda
   jupyter-ip.sh
   ```
2. You should observe an output concluding with details resembling:

   ```
   To access the notebook, open this file in a browser:
       file:///home/exouser/.local/share/jupyter/runtime/nbserver-100997-open.html
   Or utilize one of these URLs:
       http://neatly-trusting-chow-gui:8888/?token=723fa5a01f6dc27b0ec655846572513757e921aaf247cbb7
   or http://149.165.154.8:8888/?token=723fa5a01f6dc27b0ec655846572513757e921aaf247cbb7
   ```
3. The final URL with the IP address (e.g., `149.165.xxx.xxx`) is the link you'll require for your browser.

#### Managing and Accessing  Instances

**SSH Access to the virtual machine**

To SSH into an Exosphere instance:

1. Obtain the public IP address of your instance from the Exosphere dashboard.
2. Use your terminal or SSH client with the command:

   ```bash
   ssh [username]@[instance_IP_address]
   ```

**Using the Virtual Desktop**

Exosphere provides a virtual desktop option for a more interactive experience. To utilize the virtual desktop:

1. Navigate to your Exosphere dashboard.
2. Select your active instance and click on the "Web Desktop" option.
3. This will open a new window with a full desktop environment accessible via your browser.

**Managing Instance Credits**

To optimize your ACCESS credits:

* **Shelving:** When not using an instance, you can "shelve" it. This action temporarily suspends the instance, preserving its state but not consuming credits.
* **Resizing:** Exosphere allows resizing of instances based on your needs. If you require more or fewer resources, navigate to the instance settings and select a different size. This flexibility ensures you only consume credits based on your actual resource requirements.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://workshop.dukeieee.org/workshops/jetstream-2-tutorial.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
