diff --git a/.gitignore b/.gitignore index 04c7fd320b19a3da2344057a2fd78ef420e71499..24174aef30f4d80865755184ff44cc29458bbfaf 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ *node_modules **venv/ doc.zih.tu-dresden.de/public/ +*mermaid.min.js diff --git a/Dockerfile b/Dockerfile index b272bf553212534167e23e083d4a0c088700a025..623a7f7be68402ec5bb79a82b929b22a7b0bf0ca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ RUN pip install mkdocs>=1.1.2 mkdocs-material>=7.1.0 # Linter # ########## -RUN apt update && apt install -y nodejs npm aspell git +RUN apt-get update && apt-get install -y nodejs npm aspell git RUN npm install -g markdownlint-cli markdown-link-check @@ -29,6 +29,14 @@ RUN echo $'# gitlab.hrz.tu-chemnitz.de:22 SSH-2.0-OpenSSH_7.4\n\ gitlab.hrz.tu-chemnitz.de ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDNixJ1syD506jOtiLPxGhAXsNnVfweFfzseh9/WrNxbTgIhi09fLb5aZI2CfOOWIi4fQz07S+qGugChBs4lJenLYAu4b0IAnEv/n/Xnf7wITf/Wlba2VSKiXdDqbSmNbOQtbdBLNu1NSt+inFgrreaUxnIqvWX4pBDEEGBAgG9e2cteXjT/dHp4+vPExKEjM6Nsxw516Cqv5H1ZU7XUTHFUYQr0DoulykDoXU1i3odJqZFZQzcJQv/RrEzya/2bwaatzKfbgoZLlb18T2LjkP74b71DeFIQWV2e6e3vsNwl1NsvlInEcsSZB1TZP+mKke7JWiI6HW2IrlSaGqM8n4h\n\ gitlab.hrz.tu-chemnitz.de ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ/cSNsKRPrfXCMjl+HsKrnrI3HgbCyKWiRa715S99BR\n' > ~/.ssh/known_hosts +#Make sure that mermaid is integrated... +RUN echo '#!/bin/bash' > /entrypoint.sh +RUN echo 'test \! -e /docs/tud_theme/javascripts/mermaid.min.js && test -x /docs/util/download-newest-mermaid.js.sh && /docs/util/download-newest-mermaid.js.sh' >> /entrypoint.sh +RUN echo 'exec "$@"' >> /entrypoint.sh +RUN chmod u+x /entrypoint.sh + WORKDIR /docs CMD ["mkdocs", "build", "--verbose", "--strict"] + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/doc.zih.tu-dresden.de/docs/contrib/contribute_container.md b/doc.zih.tu-dresden.de/docs/contrib/contribute_container.md index 568724e6537962f9e227b58542f91d18ef72a44f..15382289e3b0b7abcfb9621fcbb33cde302dc1fc 100644 --- a/doc.zih.tu-dresden.de/docs/contrib/contribute_container.md +++ b/doc.zih.tu-dresden.de/docs/contrib/contribute_container.md @@ -31,13 +31,15 @@ Add the original repository as a so-called remote: 1. `git pull origin preview` 1. `git pull upstream-zih preview` (only required when you forked the project) 1. Create a new feature branch for you to work in. Ideally, name it like the file you want to -modify or the issue you want to work on, e.g.: `git checkout -b issue-174`. (If you are uncertain -about the name of a file, please look into `mkdocs.yaml`.) +modify or the issue you want to work on, e.g.: +`git checkout -b 174-check-contribution-documentation` for issue 174 with title "Check contribution +documentation". (If you are uncertain about the name of a file, please look into `mkdocs.yaml`.) 1. Improve the documentation with your preferred editor, i.e. add new files and correct mistakes. 1. Use `git add <FILE>` to select your improvements for the next commit. 1. Commit the changes with `git commit -m "<DESCRIPTION>"`. The description should be a meaningful description of your changes. If you work on an issue, please also add "Closes 174" (for issue 174). -1. Push the local changes to the GitLab server, e.g. with `git push origin issue-174`. +1. Push the local changes to the GitLab server, e.g. with +`git push origin 174-check-contribution-documentation`. 1. As an output you get a link to create a merge request against the preview branch. 1. When the merge request is created, a continuous integration (CI) pipeline automatically checks your contributions. @@ -57,6 +59,7 @@ Building a container could be done with the following steps: ```bash cd hpc-wiki +doc.zih.tu-dresden.de/util/download-newest-mermaid.js.sh docker build -t hpc-compendium . ``` @@ -64,7 +67,7 @@ To avoid a lot of retyping, use the following in your shell: ```bash alias wikiscript="docker run --name=hpc-compendium --rm -w /docs --mount src=$PWD,target=/docs,type=bind hpc-compendium" -alias wiki="docker run --name=hpc-compendium -p 8000:8000 --rm -w /docs --mount src=$PWD/doc.zih.tu-dresden.de,target=/docs,type=bind hpc-compendium bash -c" +alias wiki="docker run --name=hpc-compendium -p 8000:8000 --rm -w /docs --mount src=$PWD/doc.zih.tu-dresden.de,target=/docs,type=bind hpc-compendium" ``` ## Working with the Docker Container @@ -76,7 +79,7 @@ Here is a suggestion of a workflow which might be suitable for you. The command(s) to start the dockerized web server is this: ```bash -wiki "mkdocs serve -a 0.0.0.0:8000" +wiki mkdocs serve -a 0.0.0.0:8000 ``` You can view the documentation via `http://localhost:8000` in your browser, now. @@ -137,7 +140,7 @@ Read on if you want to run a specific check. If you want to check whether the markdown files are formatted properly, use the following command: ```bash -wiki 'markdownlint docs' +wiki markdownlint docs ``` #### Spell Checker diff --git a/doc.zih.tu-dresden.de/docs/jobs_and_resources/slurm.md b/doc.zih.tu-dresden.de/docs/jobs_and_resources/slurm.md index 6d4032a0e5fcc9628b8cd928e0afc58813b31462..98e37b5acedbe228def7a3094d3167bf98cce62b 100644 --- a/doc.zih.tu-dresden.de/docs/jobs_and_resources/slurm.md +++ b/doc.zih.tu-dresden.de/docs/jobs_and_resources/slurm.md @@ -6,6 +6,28 @@ setup experiments, and edit and prepare jobs. The login nodes are not suited for computational work! From the login nodes, you can interact with the batch system, e.g., submit and monitor your jobs. +A typical workflow would look like this: + +```mermaid +sequenceDiagram + user ->>+ login node: run programm + login node ->> login node: kill after 5 min + login node ->>- user: Killed! + user ->> login node: salloc [...] + login node ->> Slurm: Request resources + Slurm ->> user: resources + user ->>+ allocated resources: srun [options] [command] + allocated resources ->> allocated resources: run command (on allocated nodes) + allocated resources ->>- user: program finished + user ->>+ allocated resources: srun [options] [further_command] + allocated resources ->> allocated resources: run further command + allocated resources ->>- user: program finished + user ->>+ allocated resources: srun [options] [further_command] + allocated resources ->> allocated resources: run further command + Slurm ->> allocated resources: Job limit reached/exceeded + allocated resources ->>- user: Job limit reached +``` + ??? note "Batch System" The batch system is the central organ of every HPC system users interact with its compute diff --git a/doc.zih.tu-dresden.de/mkdocs.yml b/doc.zih.tu-dresden.de/mkdocs.yml index b83abfa0004addec170fd6f1aa6d03effe9c89e9..a32ab1a8491cfc865feaa5846e91093180a42c09 100644 --- a/doc.zih.tu-dresden.de/mkdocs.yml +++ b/doc.zih.tu-dresden.de/mkdocs.yml @@ -180,11 +180,16 @@ extra_css: extra_javascript: - javascripts/extra.js + - javascripts/mermaid.min.js markdown_extensions: - admonition - pymdownx.details - - pymdownx.superfences + - pymdownx.superfences: + custom_fences: + - name: mermaid + class: mermaid + format: !!python/name:pymdownx.superfences.fence_code_format - pymdownx.highlight - toc: permalink: True @@ -193,7 +198,6 @@ markdown_extensions: - pymdownx.tabbed: alternate_style: True - #plugins: # - mkdocs-video extra: diff --git a/doc.zih.tu-dresden.de/util/download-newest-mermaid.js.sh b/doc.zih.tu-dresden.de/util/download-newest-mermaid.js.sh new file mode 100755 index 0000000000000000000000000000000000000000..9986ad6f49e2e739f8a53d7911f4e346196d21a4 --- /dev/null +++ b/doc.zih.tu-dresden.de/util/download-newest-mermaid.js.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -euo pipefail + +scriptpath=${BASH_SOURCE[0]} +basedir=`dirname "$scriptpath"` +basedir=`dirname "$basedir"` +cd $basedir/tud_theme/javascripts +wget https://unpkg.com/mermaid/dist/mermaid.min.js