Skip to content

Commit

Permalink
Merge pull request #134 from gsbdarc/astorer/final
Browse files Browse the repository at this point in the history
Style guide and light edits on pages from Airtable
  • Loading branch information
alexstorer authored Jan 24, 2025
2 parents 24f50ea + e8c6658 commit ee6c10b
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 36 deletions.
3 changes: 0 additions & 3 deletions docs/_user_guide/best_practices_python_env.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ We highly recommend using `venv`, Python’s built-in tool for creating virtual
* **Fast and Resource-Efficient**: `venv` offers quicker environment creation and is more lightweight compared to tools like `conda`, making it ideal for shared systems where speed and efficient use of resources are important.
* **Ease of Reproducibility**: `venv` allows for easy replication of environments by using a `requirements.txt` file, ensuring that the code remains reproducible and consistent regardless of the platform.

!!!Tip
Utilize `venv` for Python Environment Management to create isolated environments, ensuring simplicity and avoiding conflicts between project dependencies.

## Creating a New Virtual Environment with `venv`

To ensure the virtual environment is shareable, create it in a shared location on the Yen system, such as a faculty project directory, rather than in a user’s home directory. The virtual environment only needs to be created once, and all team members with access to the project directory will be able to activate and use it.
Expand Down
42 changes: 26 additions & 16 deletions docs/_user_guide/best_practices_screen.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,41 @@
# Run a Job That Continues After Logging Out

We highly recommend that you first consider using the [Slurm scheduler](/_user_guide/slurm){:target="_blank"} to submit and run your jobs.
Slurm offers several benefits over screen, including better resource management, job prioritization, and the ability to queue jobs and monitor their status.
It also ensures that jobs are allocated the necessary resources and can run efficiently across multiple nodes.
We highly recommend that you consider using the [Slurm scheduler](/_user_guide/slurm){:target="_blank"} to submit and run jobs that persist after you log out.
Slurm offers several clear benefits over interactive jobs, including:

* better resource management
* job prioritization
* job queueing
* enhanced monitoring
* scaling across nodes

However, you can also run a job that continues after logging out by using `screen`.

## How to use screen
## How to use `screen`

[`screen`](https://www.gnu.org/software/screen/manual/screen.html){:target="_blank"} allows you to set up multiple virtual sessions within your terminal session. This can be useful for running multiple processes at the same time, but it can also be used to leave processes running after you log out of any Yens server.
[`screen`](https://www.gnu.org/software/screen/manual/screen.html){:target="_blank"} allows you to set up multiple virtual sessions within your terminal session. This can be useful for running multiple processes at the same time, but it can also be used to leave processes running after you log out of any Yen server.

To set up a screen, `ssh` in to the Yens through a terminal window and then type:
```title="Terminal Command"
screen -S <session_name>
```
where `<session_name>` is any name of your choice.

!!! Warning
Do not initiate a screen in a terminal on JupyterHub. The screen will time out and you will not be able to access it later. Please only initiate screens through a SSH connection to the Yens outside of JupyterHub.
!!! Warning "Do Not Initiate a Screen in a Terminal on JupyterHub"
The screen will time out and you will not be able to access it later. Please only initiate screens through a SSH connection to the Yens outside of JupyterHub.

!!! Note
Screens are not tied to your user, but rather to the specific Yen that you started the screen in. So do not expect your screen session on `yen1` to appear in `yen2`.
Screen sessions are tied to the specific Yen server where they were started, not to your user account. For example, a screen session started on `yen1` will not appear on `yen2`. Ensure you reconnect to the same server to access your screen session.






For example, let's name our session `npv`:

```title="Terminal Command"
$ screen -S npv
screen -S npv
```

This will take you to a new terminal with a blank view and a command prompt at the top of the page.
Expand All @@ -35,7 +45,7 @@ Let's run our serial R script again. This time, we will let it run in a screen (
starting a screen preserves these in the new terminal started by `screen`). So, we can start our R process:

```title="Terminal Command"
$ Rscript investment-npv-parallel.R
Rscript investment-npv-parallel.R
```

Once your script is going, you can exit out of this screen session with the keyboard shortcut ++ctrl+a+d++, which will return you to your original terminal.
Expand All @@ -48,7 +58,7 @@ You should see that the screen was detached:

You can list any screen sessions that you are running on the particular Yen server you are logged onto by typing:
```title="Terminal Command"
$ screen -ls
screen -ls
```

You should see something like:
Expand All @@ -62,13 +72,13 @@ If you exit out of the server here, you can be assured that the scripts in your

To return to any existing screen session, you simply need to type:
```title="Terminal Command"
$ screen -r <session_name>
screen -r <session_name>
```

For example, to go back to the screen we detached from earlier:

```title="Terminal Command"
$ screen -r npv
screen -r npv
```

If you are actively printing to the console in your script, you may notice that you cannot scroll up through the log of print statements when you are in a screen.
Expand All @@ -82,20 +92,20 @@ When you log back onto the Yens and try to reconnect to that session again, you
In order to return to that session, you can just use this command:

```title="Terminal Command"
$ screen -dr <session_name>
screen -dr <session_name>
```
This detaches the previous connection to that screen session and then returns you to the screen.

## How to exit `screen`

Finally, once you are finished with a screen session, all you have to do is type:
```title="Terminal Command"
$ exit
exit
```

Check that you no longer have screen sessions running:
```title="Terminal Command"
$ screen -ls
screen -ls
```

```{.yaml .no-copy title="Terminal Output"}
Expand Down
15 changes: 7 additions & 8 deletions docs/_user_guide/julia.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,26 +45,25 @@ where `<your-script.jl>` is your Julia script.
## Installing Packages
Launch Julia REPL by running `julia` in the terminal. Even though the Julia software is installed system-wide, every user keeps their own library of packages that they need to run their code.

!!! note
The packages need to be installed once, then can be loaded in subsequent code runs.

To install packages, Press `]` to enter the package manager mode in the Julia REPL. You'll see the prompt change from `julia>` to `pkg>`. Use the `add` command followed by the package name:
```julia title="Example Package Installation"
pkg> add DataFrames
```
This will download and install the package along with any necessary dependencies.

!!! note "Package Installation is Persistent"
The packages need to be installed once, then can be loaded in subsequent code runs.

!!! tip
To switch back from the package manager mode (indicated by the `pkg>` prompt) to the Julia REPL (indicated by the `julia>` prompt), press the `delete` or `Backspace` key. Alternatively, you can press `Ctrl+C`, which will also return you to the regular Julia prompt.

To use the installed package, run:
To switch back from the package manager mode (indicated by the `pkg>` prompt) to the Julia REPL (indicated by the `julia>` prompt), press the `delete` or `Backspace` key. Alternatively, you can press `Ctrl+C`, which will also return you to the regular Julia prompt.

```julia title="Load Installed Package"
To use the installed package:

```julia title="Julia REPL Input"
using DataFrames
```

!!! warning
!!! warning "Julia Packages Vary By Version"
Every version of Julia has its own library of packages which means if you upgrade the version of Julia, you will need to reinstall the necessary packages for that version (once).

## Multithreading in Julia
Expand Down
2 changes: 1 addition & 1 deletion docs/blog/posts/2022-11-14_installing_software.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ categories:
authors:
- nrapstin
---
# Installing Software On The `yen`
# Installing Software On The Yen Servers

As a yen user, you can install your own custom software in your home directory or any location where you have permissions
(such as a shared project space). If you are working with other researchers on a shared project, it is a good idea to have
Expand Down
2 changes: 1 addition & 1 deletion docs/blog/posts/download_files_to_the_Yens.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ authors:
subtitle: Download Files Directly to the Yens Server
---

# Download Files Directly to the Yens Server
# Download Files Directly to the Yen Servers

Instead of downloading the file to your local machine and transferring it to the Yens, you can streamline the process by downloading it directly to the Yens server using the `wget` command.

Expand Down
14 changes: 7 additions & 7 deletions docs/blog/posts/rclone.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ rclone config
```

The configuration menu will then be presented:
```{.yaml .no-copy title="Terminal Output"}
```{.yaml .no-copy title="Interactive Terminal Output"}
No remotes found - make a new one
n) New remote
s) Set configuration password
Expand All @@ -48,7 +48,7 @@ Select `n` to make a new remote and give it a name when prompted. For example, `
Next, select the number corresponding to Google Drive (the menu changes with each `rclone` version so be careful to select
the right remote).

```{.yaml .no-copy title="Terminal Output"}
```{.yaml .no-copy title="Interactive Terminal Output"}
18 / Google Drive
\ (drive)
Expand All @@ -60,15 +60,15 @@ When prompted for the next two options, leave them blank and press Enter.
Then the next menu asks to select permissions you want to give `rclone`. Choose `1` for full read-write
access.

```{.yaml .no-copy title="Terminal Output"}
```{.yaml .no-copy title="Interactive Terminal Output"}
scope> 1
```

Then leave the next prompt blank and press Enter.

Choose `n` to not edit advanced config:

```{.yaml .no-copy title="Terminal Output"}
```{.yaml .no-copy title="Interactive Terminal Output"}
Edit advanced config? (y/n)
y) Yes
n) No (default)
Expand All @@ -77,7 +77,7 @@ y/n> n

Choose `n` again since we are working on the remote Yen server:

```{.yaml .no-copy title="Terminal Output"}
```{.yaml .no-copy title="Interactive Terminal Output"}
Remote config
Use auto config?
* Say Y if not sure
Expand All @@ -102,15 +102,15 @@ and paste it back into the Yen terminal after `config_token>`.
Next, you will be asked if you want to configure this as a team drive. Press `y` if you are connecting
to a shared Google Drive or press `n` if you are connecting to your Google Drive.

```{.yaml .no-copy title="Terminal Output"}
```{.yaml .no-copy title="Interactive Terminal Output"}
Configure this as a team drive?
y) Yes
n) No (default)
```

Finally, press Enter to complete the config.

```{.yaml .no-copy title="Terminal Output"}
```{.yaml .no-copy title="Interactive Terminal Output"}
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
Expand Down

0 comments on commit ee6c10b

Please sign in to comment.