This outlines conventions and standards that are used in this documentation.
This documentation is in Markdown format. Although much of it can be viewed with any text editor, a richer experience will come from using a tool which can render the Markdown to show different font sizes, the use of bold and italics formatting, inclusion of diagrams and screen shots as image files, and to follow navigational links within a topic file and to other files.
There are many tools which render the Markdown format and provide these advantages. Any Internet search for Markdown tools will provide a long list of these tools. Some of the tools are better than others at displaying the images and allowing you to follow the navigational links.
Some of the installation instructions require updating files in JSON, YAML, or TOML format. These files should be updated with care because some file formats do not accept tab characters for indentation of lines. Refer to online documentation to learn more about the syntax of JSON, YAML, and TOML files. YAML does not support tab characters. The convention for JSON is to use four spaces rather than a tab character.
This style
indicates program code, reserved words, library functions, command-line prompts,
screen output, file/path names, and other software constructs.
\ (backslash) At the end of a command line, indicates the Linux shell line continuation character (lines joined by a backslash are parsed as a single line).
The host name in a command prompt indicates where the command must be run. The user account that must run the command is also indicated in the prompt.
root
or super-user account always has the # character at the end of the prompt.account@hostname
. A non-privileged account is referred to as user.The following list contains abbreviations for nodes used below:
ncn-m
- Master NCNncn-s
- Storage NCNncn-w
- Worker NCNncn-mw
in a command prompt indicates that the command may be run on a master or worker NCN.This lists the common command prompts and their meanings.
Prompt | Description |
---|---|
ncn# |
Run the command as root on any NCN, except an NCN which is functioning as an Application Node, such as a UAN. |
ncn-m# |
Run the command as root on any Kubernetes master NCN. |
ncn-m002# |
Run the command as root on the specific Kubernetes master NCN which has this hostname (ncn-m002 in this example). |
ncn-s# |
Run the command as root on any utility storage NCN. |
ncn-s003# |
Run the command as root on the specific utility storage NCN which has this hostname (ncn-s003 in this example). |
ncn-w# |
Run the command as root on any Kubernetes worker NCN. |
ncn-w001# |
Run the command as root on the specific Kubernetes worker NCN which has this hostname (ncn-w001 in this example). |
ncn-mw# |
Run the command as root on any Kubernetes master or worker NCN. |
ncn-ms# |
Run the command as root on any Kubernetes master or utility storage NCN. |
pit# |
Run the command as root on the PIT node. |
external# |
Run the command as root on a Linux host external to the supercomputer. |
uan# |
Run the command as root on any UAN. |
uan01# |
Run the command as root on hostname uan01 . |
user@uan> |
Run the command as any non-root user on any UAN. |
cn# |
Run the command as root on any CN. Note that a CN will have a hostname of the form nid124356 . That is, nid followed by a six digit, zero padded number. |
hostname# |
Run the command as root on the specified hostname. |
user@hostname> |
Run the command as any non-root user on the specified hostname. |
These prompts should be inserted into text before the fenced code block, rather than inside of it. This is a change from the documentation of CSM 1.2 and earlier.
An example of proper use of the command prompt:
(ncn#
) Lorem ipsum.
yes >/dev/null
An example of improper use of the command prompt:
Lorem ipsum.
ncn# yes >/dev/null
Some commands open new shells when they are executed (for example, chroot
, kubectl exec
, ssh
,
and sat bash
). When these commands are used, the command prompt changes to indicate that subsequent
commands are to be run inside the new shell.
chroot
example(hostname#
) Lorem ipsum.
chroot /path/to/chroot
(chroot-hostname#
) Lorem ipsum.
whoami
(chroot-hostname#
) Lorem ipsum.
exit
(hostname#
) Lorem ipsum!
kubectl exec
exampleIf executing a shell inside a container of a Kubernetes pod where the pod name is $podName
:
(ncn#
) Enter pod $podName
.
kubectl exec -it $podName /bin/sh
(pod#
) Run foo in the pod.
. /srv/foo && echo $bar
ssh
and chroot
exampleIf using SSH to access the image customization environment (a Kubernetes pod) during an image customization session, then the prompt
changes to indicate that it is inside this environment. This example uses $PORT
and $HOST
as environment variables with specific settings.
(hostname#
) Login to the image pod.
ssh -p $PORT root@$HOST
(pod#
) chroot
into the image.
chroot /mnt/image/image-root
(chroot-pod#
) Checkout the beard on this emoji.
echo $PS1
sat bash
exampleThe sat bash
command opens a shell inside the cray-sat
container image. The command prompt changes
to indicate the ID of the Podman container where the shell is executing.
(ncn-m#
) Enter a SAT shell.
sat bash
((CONTAINER_ID) sat-container#
) Execute the sat status
command inside the shell in the
cray-sat
container started by sat bash
.
sat status
Some documentation may involve running commands inside a Python virtual environment. When a Python virtual environment is activated, the command prompt changes to reflect the active virtual environment.
(user@hostname>
) Activate the Python virtual environment.
. venv/bin/activate
((venv) user@hostname>
) Open the Python 3 interpreter inside the virtual environment.
python3
Example prompts do not include the directory path, because long paths can reduce the clarity of examples. Most of the time, the
command can be executed from any directory. When it matters which directory the command is invoked within, the cd
command
is used to change into the directory, and the directory is referenced with a period (.) to indicate the current directory.
In procedures which take a long time, which involve a large number of steps, or which span different pages, the documentation should take care to help avoid errors caused by a user pausing the procedure and resuming it at a later time. In the intervening time they may have opened a new shell, or run other commands in the same shell.
For commands that need specific environment variables to be set, or to be run in a specific directory, it is important to do one of the following things:
Here is an example that makes it easy for a user to make mistakes if they are resuming from a short or long break. The context switches and a user cannot resume halfway without running commands in the wrong directory.
Change into a directory.
Do more things.
Do more things.
Do more things.
Do even more things.
Change into another directory.
Do more things.
Do more things.
Do even more things.
Return to the original directory.
Do more things.
Do more things.
Do even more things.
Here is an example that addresses the problems in the previous example by using shorter stretches of steps that are more easily paused and resumed. Note that every context switch is under a header, offering users a good place to pause without losing context.
Change into a directory.
Do more things.
Do more things.
Do more things.
Do even more things.
Change into another directory.
Do more things.
Do more things.
Do even more things.
The steps in this section require that the Other cool things section has been completed successfully.
Return to the original directory.
Do more things.
Do more things.
Do even more things.
The introduction/templates
folder supplies copy-paste boilerplate markdown examples.