-
Notifications
You must be signed in to change notification settings - Fork 41
add terminal docs #65
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
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,78 @@ | ||
| [](){#ref-guides-terminal} | ||
| # Terminal usage on Alps | ||
|
|
||
| This documentation is a collection of guides, hints and tips for setting up your terminal environment on Alps. | ||
bcumming marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| [](){#ref-guides-terminal-shells} | ||
| ## Shells | ||
|
|
||
| Every user has a shell that will be used when they log in, with [bash](https://www.gnu.org/software/bash/) as the default shell for new users at CSCS. | ||
|
|
||
| At CSCS the vast majority of users stick with the default `bash`: at the time of writing, with over 1200 users on Daint, 4 were using C shell, 2 were using zsh, and the rest were using Bash. | ||
|
|
||
bcumming marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| !!! example "what shell am I using?" | ||
bcumming marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Run the following command after logging in: | ||
|
|
||
| ```terminal | ||
| $ getent passwd | grep $USER | ||
| bcumming:*:22008:1000:Benjamin Cumming, CSCS:/users/bcumming:/usr/local/bin/bash | ||
| ``` | ||
|
|
||
| the last entry in the output points to the bash of the user, in this case `/usr/local/bin/bash`. | ||
bcumming marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| !!! tip | ||
| If you would like to change your shell, for example to zsh, you have to open a service desk ticket to request the change (you can't make the change yourself). | ||
bcumming marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| !!! warning | ||
| Because `bash` is used by all CSCS staff and the overwhelming majority of users, it is the best tested, and safest default. | ||
|
|
||
| We strongly recommend against using cshell - tools like uenv are not tested against it. | ||
|
|
||
| [](){#ref-guides-terminal-arch} | ||
| ## Managing x86 and ARM | ||
|
|
||
| Alps has nodes with different CPU architectures, for example [Santis][ref-cluster-santis] has ARM (Grace `aarch64`) processors, and [Eiger][ref-cluster-eiger] uses X86 (AMD Rome `x86_64`) processors. | ||
bcumming marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Binary applications are generally not portable, for example if you compile or install a tool compiled for `x86_64` on Eiger, you will get an error when you run it on an `aarch64` node. | ||
|
|
||
| ??? warning "cannot execute binary file: Exec format error" | ||
| You will see this error message if you try to execute an executable built for a different architecture. | ||
|
|
||
| In this case, the `rg` executable built for `aarch64` (for the Grace-Hopper nodes) is run on an `x86_64` node on [Eiger][ref-cluster-eiger]: | ||
bcumming marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ``` | ||
| $ ~/.local/aarch64/bin/rg | ||
| -bash: ./rg: cannot execute binary file: Exec format error | ||
| ``` | ||
|
|
||
| A common pattern for installing local software, for example some useful command line utilities like [ripgrep](https://github.com/BurntSushi/ripgrep), is to install them in `$HOME/.local.bin`. | ||
bcumming marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| This approach won't work if the same home directory is mounted on two different clusters with different architectures: the version of ripgrep in our example would crash with `Exec format error` on one of the clusters. | ||
|
|
||
| Care needs to be taken to store executables, configuration and data for different architecures in separate locations, and automatically configure the login environment to use the correct location when you log into different systems. | ||
|
|
||
| The following example: | ||
| * sets architecture-specific `bin` path for installing programs | ||
| * sets architecture-specific paths for installing application data and configuration | ||
| * selects the correct path by running `uname -m` when you log in to a cluster | ||
|
|
||
| ```bash title=".bashrc" | ||
| # Set the "base" directory in which all architecture specific will be installed. | ||
| # The $(uname -m) command will generate either x86_64 or aarch64 to match the | ||
| # node type, when run during login. | ||
| xdgbase=$HOME/.local/$(uname -m) | ||
|
|
||
| # The XDG variables define where applications look for configurations | ||
| export XDG_DATA_HOME=$xdgbase/share | ||
| export XDG_CONFIG_HOME=$xdgbase/config | ||
| export XDG_STATE_HOME=$xdgbase/state | ||
|
|
||
| # set PATH to look for in architecture specific path: | ||
| # - on x86: $HOME/.local/x86_64/bin | ||
| # - on ARM: $HOME/.local/aarch64/bin | ||
| export ARCHPATH=$xdgbase/bin | ||
| export PATH=ARCHPATH:$PATH | ||
bcumming marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ``` | ||
|
|
||
| !!! note "XDG what?" | ||
| The [XDG base directory specification](https://specifications.freedesktop.org/basedir-spec/latest/) is used by most applications to determine where to look for configurations, and where to store data and temporary files. | ||
|
|
||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.