Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/+local-host-probe.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
`check --probe-tools` on a `local` site warns when this host has no `eb` on PATH or no module tool that EasyBuild can use (Lmod through LMOD_CMD or `lmod`, or the tool EASYBUILD_MODULES_TOOL names).
1 change: 1 addition & 0 deletions changelog.d/+workstation-tutorial.doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
New tutorial, Build with EasyBuild on your own machine: the workstation template, `check --probe-tools`, and a module built with real EasyBuild and loaded.
1 change: 1 addition & 0 deletions docs/orgmode/index.org
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Nothing about a site lives in eb-pipeline: the site file holds it, and the envir

New here?
[[file:tutorials/first-build-list.org][Run your first build list]] installs eb-pipeline on one Linux machine, runs a build list against a stand-in for EasyBuild, and ends with a result file, a log for each line, and a line that fails without stopping the run.
[[file:tutorials/workstation-build.org][Build with EasyBuild on your own machine]] installs EasyBuild beside EESSI's Lmod, checks the machine with =check --probe-tools=, and builds and loads a module, with no cluster and no Slurm.

| You want to | Read |
|-----------------------------------+--------------------------------------------|
Expand Down
2 changes: 1 addition & 1 deletion docs/orgmode/reference/cli.org
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ An option with a variable in the table takes its value from that variable when t
|-----------------------------+-------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| =--site FILE= | =EB_PIPELINE_SITE= | The site file. Required unless =--check-from-commit= is set. |
| =--lists-dir DIR= | =EB_PIPELINE_LISTS_DIR= | A directory that must contain every file that the =build_lists= of a target names. A missing file is an error of the site file. |
| =--probe-tools= | | Start =BIN --version= for each sibling tool that an enabled phase calls, and fail when one cannot start, prints no version, or prints one below the =min_version= of its =[site.tools]= table. |
| =--probe-tools= | | Start =BIN --version= for each sibling tool that an enabled phase calls, and fail when one cannot start, prints no version, or prints one below the =min_version= of its =[site.tools]= table. On a =local= site with no module wrapper, also warn when this host has no =eb= on =PATH= or no module tool EasyBuild can use. |
| =--list FILE= | =EB_PIPELINE_LIST= | The build list or easystack passed to =--stack-checks= or =--check-from-commit=. |
| =--target NAME= | =EB_PIPELINE_TARGET= | Use only this target's =cpu_target= and expanded source paths. Requires =--stack-checks= when given as an option; =EB_PIPELINE_TARGET= alone is ignored without it. Without it, target-dependent values from every target are used. |
| =--stack-checks LIST= | | Comma-separated =files=, =arch=, =cuda-cc=, =generation=, =provided=, =known-failures= or =buildenv=. Each names an =eb-stack stack= subprocess. Requires =--list= and =--site=. |
Expand Down
2 changes: 1 addition & 1 deletion docs/orgmode/reference/templates.org
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ ERROR [main] -: cannot create small-cluster.toml: File exists (os error 17)
One machine with no scheduler, such as a workstation, a lab server or a continuous integration runner.
=kind = "local"= starts every command of a run on this host as a plain process, so no command goes through =srun=.
No module is loaded before a build: =eb= comes from =PATH=, for example from =pip install easybuild=.
EasyBuild still needs a module tool to write and find modules: source EESSI's init, which provides Lmod, or install Lmod, and set =EASYBUILD_MODULES_TOOL=Lmod=.
EasyBuild still needs a module tool to write and find modules: source EESSI's init, which provides Lmod, or install Lmod, and set =EASYBUILD_MODULES_TOOL=Lmod=. =eb-pipeline check --site site.toml --probe-tools= says when this host has neither =eb= nor the module tool.
Each line runs as its own =eb= command with the line's options only, so a line whose dependencies are not installed yet needs =--robot= on the line.

#+INCLUDE: "../../../templates/workstation.toml" src toml
Expand Down
1 change: 1 addition & 0 deletions docs/orgmode/tutorials/index.org
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ It explains only what the next step needs; [[file:../explanation/index.org][Expl
:maxdepth: 1

first-build-list
workstation-build
#+end_export
187 changes: 187 additions & 0 deletions docs/orgmode/tutorials/workstation-build.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
#+TITLE: Build with EasyBuild on your own machine
#+OPTIONS: toc:nil todo:nil num:nil author:nil title:nil
#+STARTUP: content

* Build with EasyBuild on your own machine

By the end of this tutorial eb-pipeline will have driven EasyBuild on one Linux machine to install a package and write its module.
You will then load that module.
There is no cluster and no Slurm: the site file's =local= scheduler starts every phase on this machine.
The package is a bundle with no components, so the build takes seconds and downloads nothing; a real easyconfig goes through the same steps.

** What you will need

- A Linux machine with Python 3.9 or newer and =python3 -m venv=.
- EESSI mounted at =/cvmfs/software.eessi.io=, for its Lmod. EasyBuild needs a module tool to write and find modules; an Lmod you installed yourself works the same way.
- eb-pipeline on your =PATH=, as [[file:../howto/install.org][Install eb-pipeline]] describes.

** Make a directory to work in

Every step from here on runs in one directory, which the commands call =$WORK=:

#+begin_src bash
export WORK=$HOME/eb-workstation
mkdir -p "$WORK"
cd "$WORK"
#+end_src

** Give EasyBuild a module tool

Source EESSI's init, which puts Lmod on your =PATH= and sets =LMOD_CMD=, and tell EasyBuild to use Lmod:

#+begin_src bash
source /cvmfs/software.eessi.io/versions/2023.06/init/lmod/bash
export EASYBUILD_MODULES_TOOL=Lmod
#+end_src

#+begin_example
Module for EESSI/2023.06 loaded successfully
EESSI has selected x86_64/amd/zen4 as the compatible CPU target for EESSI/2023.06
#+end_example

The CPU target in the second line is your machine's.
Do this before the next step: EESSI's init puts a Python of its own on =PATH=, and EasyBuild must find the Python it is installed in first.

** Install EasyBuild

Install EasyBuild into a virtual environment and put it first on your =PATH=:

#+begin_src bash
python3 -m venv "$WORK/venv"
"$WORK/venv/bin/pip" install --quiet easybuild==5.4.2
export PATH="$WORK/venv/bin:$PATH"
eb --version
#+end_src

#+begin_example
This is EasyBuild 5.4.2 (framework: 5.4.2, easyblocks: 5.4.2) on host yourhost.
#+end_example

** Write a site file

=init= writes a site file from a template; =workstation= is the one for a single machine with no scheduler:

#+begin_src bash
eb-pipeline init --template workstation --out site.toml
sed -i "s|/srv/eb|$WORK|g" site.toml
#+end_src

#+begin_example
INFO [init] -: wrote template workstation to site.toml
#+end_example

Every path in the template sits under =/srv/eb=; =sed= moves them under =$WORK=, so EasyBuild builds in =$WORK/scratch= and installs in =$WORK/software=.

Check the file, and with =--probe-tools= check this machine too:

#+begin_src bash
eb-pipeline check --site site.toml --probe-tools
#+end_src

#+begin_example
INFO [check] workstation: site file is valid
#+end_example

On a =local= site, =--probe-tools= looks for =eb=, runs =eb --version=, and looks for the module tool, and prints a =WARN= line for each one it cannot find or start.
With the two steps above in the other order it prints:

#+begin_example
WARN [check] workstation: `eb --version` fails on this host: ERROR: No compatible 'python' command found via $PATH (EasyBuild requires Python 3.6+); set EB_PYTHON to the Python that has EasyBuild installed, or put its directory first on PATH
#+end_example

** Write an easyconfig and a build list

The easyconfig is a bundle with no components, built with the =SYSTEM= toolchain, so EasyBuild needs no compiler and no source:

#+begin_src bash
mkdir -p easyconfigs
cat > easyconfigs/Hello-1.0.eb <<'EOF'
easyblock = 'Bundle'

name = 'Hello'
version = '1.0'

homepage = 'https://easybuild.io'
description = "A bundle with no components: EasyBuild installs nothing and writes its module."

toolchain = SYSTEM

moduleclass = 'tools'
EOF
printf '%s\n' "$WORK/easyconfigs/Hello-1.0.eb" > software.list
#+end_src

The build list names one easyconfig per line; a path works as well as a name EasyBuild finds on its robot path.

** See what a run would start

#+begin_src bash
eb-pipeline run --site site.toml --list software.list --target cpu --build-type production --dry-run
#+end_src

#+begin_example
# [licences] not configured
# [shard] not configured
# [sources] not configured
# [admission] not configured
[build] eb $WORK/easyconfigs/Hello-1.0.eb
# [checks] not configured
# [caches] not configured
# [logs] not configured
INFO [run] cpu: dry run: nothing executed
#+end_example

The =build= phase starts =eb= directly, with no =srun= in front of it, because the scheduler is =local=.

** Build it

#+begin_src bash
eb-pipeline run --site site.toml --list software.list --target cpu --build-type production --result result.json
echo $?
#+end_src

#+begin_example
INFO [licences] cpu: not configured
INFO [shard] cpu: not configured
INFO [sources] cpu: not configured
INFO [admission] cpu: not configured
INFO [checks] cpu: not configured
INFO [caches] cpu: not configured
INFO [logs] cpu: not configured
INFO [build] cpu: Hello-1.0: start
INFO [build] cpu: Hello-1.0: ok
INFO [summary] cpu: summary.json and summary.html written in $WORK/logs/20261126_015425
0
#+end_example

=result.json= records the line as built, with the log EasyBuild wrote:

#+begin_src bash
grep -E '"log"|"status": "(success|failed)"' result.json
#+end_src

#+begin_example
"log": "$WORK/logs/20261126_015425/cpu/Hello-1.0.stdout.log",
"status": "success",
#+end_example

** Load the module

EasyBuild wrote the module under =$WORK/software/modules/all=:

#+begin_src bash
module use "$WORK/software/modules/all"
module load Hello/1.0
echo "$EBROOTHELLO"
#+end_src

#+begin_example
$WORK/software/software/Hello/1.0
#+end_example

** What you did

You installed EasyBuild beside EESSI's Lmod and wrote a site file for one machine.
=check --probe-tools= checked that machine, and =run= built a module you then loaded.
To build software of your own, put its easyconfigs in the build list: lines that EasyBuild resolves from its robot path, with any =eb= options after the name, as in [[file:first-build-list.org][Run your first build list]].
[[file:../reference/templates.org][The site file templates]] lists the other templates, and [[file:../howto/write-a-site-file.org][Write a site file]] goes through every table.
2 changes: 1 addition & 1 deletion share/completions/_eb-pipeline
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ buildenv\:"\`stack buildenv\` on a plain build list, failing while a toolchain o
'--easybuild-version=[EasyBuild release \`X.Y.Z\`. Overrides \`eb-X.Y.Z\` in the list file name]:EASYBUILD_VERSION:_default' \
'--gap-out=[Write eb-stack'\''s gap report files into this directory]:GAP_OUT:_files' \
'--generation=[Toolchain generation passed to \`eb-stack stack gap\`]:GENERATION:_default' \
'--probe-tools[Run each needed tool'\''s \`--version\` and enforce min_version]' \
'--probe-tools[Run each needed tool'\''s \`--version\` and enforce min_version. On a \`local\` site, also warn when this host lacks \`eb\` or the module tool EasyBuild uses]' \
'--check-from-commit[Ask \`eb-stack stack from-commit\` whether pins are already in the EasyBuild release tag]' \
'--shadow[Also write \`stack shadow\` JavaScript Object Notation (JSON) output to \`DIR/shadow.json\`]' \
'-h[Print help (see more with '\''--help'\'')]' \
Expand Down
2 changes: 1 addition & 1 deletion share/completions/eb-pipeline.fish
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ complete -c eb-pipeline -n "__fish_eb_pipeline_using_subcommand check" -l easybl
complete -c eb-pipeline -n "__fish_eb_pipeline_using_subcommand check" -l easybuild-version -d 'EasyBuild release `X.Y.Z`. Overrides `eb-X.Y.Z` in the list file name' -r
complete -c eb-pipeline -n "__fish_eb_pipeline_using_subcommand check" -l gap-out -d 'Write eb-stack\'s gap report files into this directory' -r -F
complete -c eb-pipeline -n "__fish_eb_pipeline_using_subcommand check" -l generation -d 'Toolchain generation passed to `eb-stack stack gap`' -r
complete -c eb-pipeline -n "__fish_eb_pipeline_using_subcommand check" -l probe-tools -d 'Run each needed tool\'s `--version` and enforce min_version'
complete -c eb-pipeline -n "__fish_eb_pipeline_using_subcommand check" -l probe-tools -d 'Run each needed tool\'s `--version` and enforce min_version. On a `local` site, also warn when this host lacks `eb` or the module tool EasyBuild uses'
complete -c eb-pipeline -n "__fish_eb_pipeline_using_subcommand check" -l check-from-commit -d 'Ask `eb-stack stack from-commit` whether pins are already in the EasyBuild release tag'
complete -c eb-pipeline -n "__fish_eb_pipeline_using_subcommand check" -l shadow -d 'Also write `stack shadow` JavaScript Object Notation (JSON) output to `DIR/shadow.json`'
complete -c eb-pipeline -n "__fish_eb_pipeline_using_subcommand check" -s h -l help -d 'Print help (see more with \'--help\')'
Expand Down
Loading
Loading