Skip to content

Commit 50da06e

Browse files
authored
Merge branch 'main' into feat/beginners-tutorial
2 parents 36db078 + 7f44dfe commit 50da06e

16 files changed

+1172
-124
lines changed

docs/source/alternative_install.rst

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
:orphan:
2+
3+
.. _alternative_install:
4+
5+
.. jinja:: first_ctx
6+
7+
#################################
8+
Alternative installation methods
9+
#################################
10+
11+
******************
12+
{{ app_name }} CLI
13+
******************
14+
15+
The {{ app_name }} CLI can be installed on Linux, macOS, and Windows through a terminal
16+
or shell prompt:
17+
18+
.. tab-set::
19+
20+
.. tab-item:: Linux/macOS
21+
22+
Open a terminal, paste the command shown below and press enter.
23+
24+
.. code-block:: bash
25+
26+
(touch tmp.sh && curl -fsSL https://raw.githubusercontent.com/hpcflow/install-scripts/main/src/install-{{ app_package_name }}.sh > tmp.sh && bash tmp.sh --prerelease --path --univlink) ; rm tmp.sh
27+
28+
.. tab-item:: Windows
29+
30+
Open a Powershell terminal, paste the command shown below and press enter.
31+
32+
.. code-block:: powershell
33+
34+
& $([scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/hpcflow/install-scripts/main/src/install-{{ app_package_name }}.ps1'))) -PreRelease -UnivLink
35+
36+
.. admonition:: What does this script do?
37+
:class: note dropdown
38+
39+
The above command downloads a script from the {{ app_name }} GitHub repository and runs it. The script does the following:
40+
41+
#. It downloads the latest prerelease version of {{ app_name }} zip archived in a single folder.
42+
#. The archive is extracted and the folder placed in an accessible location. The location depends on the operating system. In Linux it is ``/.local/share/{{ app_package_name }}``. In macOS it is ``~/Library/Application Support/{{ app_package_name }}``. In Windows it is ``Username\AppData\Local\{{ app_package_name }}``.
43+
#. A symbolic link (Linux/macOS) or an alias pointing to the file is created. This allows {{ app_name }} to be run by entering a simple command.
44+
#. A command is added to ``.bashrc``/``.zshrc`` (linux/macOS) or the Powershell profile (Windows) that allows {{ app_name }} to be run from any folder.
45+
46+
If the script detects that the version of {{ app_name }} it is trying to install is already there, it will stop
47+
running and exit.
48+
49+
50+
51+
.. hint::
52+
53+
If you are installing {{ app_name }} on an HPC resource, check that you can connect
54+
to the internet first. You might need to load a proxy module, for example.
55+
56+
57+
********************************
58+
Download CLI binaries (advanced)
59+
********************************
60+
61+
Binaries are available in two formats, corresponding to the two different formats that
62+
PyInstaller `can generate <https://pyinstaller.org/en/stable/usage.html#what-to-generate>`_:
63+
64+
* A single executable file containing everything.
65+
* A folder containing an executable and supporting files.
66+
67+
Click below to download the {{ app_name }} binary for your platform:
68+
69+
.. raw:: html
70+
71+
{{ download_links_table_html }}

docs/source/conf.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ def prepare_task_schema_action_info(app: BaseApp):
229229
with open("../../pyproject.toml") as fp:
230230
dist_name = tomlkit.load(fp)["tool"]["poetry"]["name"]
231231
supported_python_versions = tomlkit.load(fp)["tool"]["poetry"]["dependencies"]["python"]
232+
pyproject_config = tomlkit.load(fp)
233+
dist_name = pyproject_config["tool"]["poetry"]["name"]
234+
supported_python = pyproject_config["tool"]["poetry"]["dependencies"]["python"]
232235

233236
extensions = [
234237
"sphinx.ext.autodoc",
@@ -276,7 +279,7 @@ def prepare_task_schema_action_info(app: BaseApp):
276279
"download_links_table_html": generate_download_links_table(),
277280
"github_user": github_user,
278281
"github_repo": github_repo,
279-
"supported_python": supported_python_versions,
282+
"supported_python": supported_python,
280283
}
281284
}
282285

docs/source/installation.rst

Lines changed: 54 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -22,90 +22,69 @@
2222

2323
The CLI and the Python package can be used simultaneously.
2424

25-
******************
26-
{{ app_name }} CLI
27-
******************
28-
29-
The {{ app_name }} CLI can be installed on Linux, macOS, and Windows through a terminal
30-
or shell prompt:
31-
32-
.. tab-set::
33-
34-
.. tab-item:: Linux/macOS
35-
36-
Open a terminal, paste the command shown below and press enter.
37-
38-
.. code-block:: bash
39-
40-
(touch tmp.sh && curl -fsSL https://raw.githubusercontent.com/hpcflow/install-scripts/main/src/install-{{ app_package_name }}.sh > tmp.sh && bash tmp.sh --prerelease --path --univlink) ; rm tmp.sh
41-
42-
.. tab-item:: Windows
43-
44-
Open a Powershell terminal, paste the command shown below and press enter.
45-
46-
.. code-block:: powershell
47-
48-
& $([scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/hpcflow/install-scripts/main/src/install-{{ app_package_name }}.ps1'))) -PreRelease -UnivLink
49-
50-
.. admonition:: What does this script do?
51-
:class: note dropdown
52-
53-
The above command downloads a script from the {{ app_name }} GitHub repository and runs it. The script does the following:
54-
55-
#. It downloads the latest prerelease version of {{ app_name }} zip archived in a single folder.
56-
#. The archive is extracted and the folder placed in an accessible location. The location depends on the operating system. In Linux it is ``/.local/share/{{ app_package_name }}``. In macOS it is ``~/Library/Application Support/{{ app_package_name }}``. In Windows it is ``Username\AppData\Local\{{ app_package_name }}``.
57-
#. A symbolic link (Linux/macOS) or an alias pointing to the file is created. This allows {{ app_name }} to be run by entering a simple command.
58-
#. A command is added to ``.bashrc``/``.zshrc`` (linux/macOS) or the Powershell profile (Windows) that allows {{ app_name }} to be run from any folder.
59-
60-
If the script detects that the version of {{ app_name }} it is trying to install is already there, it will stop
61-
running and exit.
62-
63-
64-
65-
.. hint::
66-
67-
If you are installing {{ app_name }} on an HPC resource, check that you can connect
68-
to the internet first. You might need to load a proxy module, for example.
69-
70-
.. _def_python_versions:
71-
72-
*****************************
73-
{{ app_name }} Python package
74-
*****************************
75-
76-
{{ app_name }} is compatible with Python versions {{ supported_python }}.
77-
7825
Using pip
7926
==========================
8027

81-
Use pip to install the Python package from PyPI::
82-
83-
pip install {{ dist_name }}=="{{ app_version }}"
28+
The recommended way to install {{ app_name }} is to
29+
use pip to install the Python package from PyPI::
8430

85-
Using conda
86-
===========
31+
pip install {{ dist_name }}
8732

88-
Coming soon!
89-
90-
********************************
91-
Download CLI binaries (advanced)
92-
********************************
93-
94-
Binaries are available in two formats, corresponding to the two different formats that
95-
PyInstaller `can generate <https://pyinstaller.org/en/stable/usage.html#what-to-generate>`_:
96-
97-
* A single executable file containing everything.
98-
* A folder containing an executable and supporting files.
99-
100-
Click below to download the {{ app_name }} binary for your platform:
101-
102-
.. raw:: html
103-
104-
{{ download_links_table_html }}
33+
This installs the python package, which also gives the CLI version of {{ app_name }}.
10534

10635
*************
10736
Release notes
10837
*************
10938

11039
Release notes for this version ({{app_version}}) are `available on GitHub <https://github.com/{{ github_user }}/{{ github_repo }}/releases/tag/v{{ app_version }}>`_.
11140
Use the version switcher in the top-right corner of the page to download/install other versions.
41+
42+
Alternative installation methods
43+
================================
44+
Although *not currently recommended*,
45+
advanced users may wish to use one of the :ref:`alternative installation methods <alternative_install>`.
46+
47+
48+
#############
49+
Configuration
50+
#############
51+
52+
{{ app_name }} uses a config file to control details of how it executes workflows.
53+
A :ref:`default config file <default_config>` will be created the first time you submit a workflow.
54+
This will work without modification on a personal machine,
55+
however if you are using {{ app_name }} on HPC you will likely need to make some
56+
modifications to describe the job scheduler, and settings for multiple cores,
57+
and to point to your {{ app_name }} environments file.
58+
59+
`Some examples <https://github.com/hpcflow/matflow-configs>`_ are given
60+
for the University of Manchester's CSF.
61+
62+
The path to your config file can be found using ``{{ app_module }} manage get-config-path``,
63+
or to open the config file directly, use ``{{ app_module }} open config``.
64+
65+
#############
66+
Environments
67+
#############
68+
69+
{{ app_name }} has the concept of environments, similar to python virtual environments.
70+
These are required so that tasks can run using the specific software they require.
71+
Your {{ app_name }} environments must be defined in your environments (YAML) file before {{ app_name }}
72+
can run workflows, and this environment file must be pointed to in the config file
73+
via the ``environment_sources`` key.
74+
Once this has been done, your environment file can be be opened using ``{{ app_module }} open env-source``.
75+
76+
Below is an example environments file that defines an environment for running Pyton scripts.
77+
Domain-specific tools can be added to the environments file as required, each with their own
78+
setup instructions for loading that tool on your machine.
79+
80+
.. code-block:: yaml
81+
82+
- name: python_env
83+
executables:
84+
- label: python_script
85+
instances:
86+
- command: python "<<script_path>>" <<args>>
87+
num_cores:
88+
start: 1
89+
stop: 32
90+
parallel_mode: null

docs/source/reference/config_file.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ Configuration file
33

44
Configurable settings that can be set within the configuration file are listed here.
55

6+
.. _default_config:
7+
68
Default config file
79
~~~~~~~~~~~~~~~~~~~
810

docs/source/reference/glossary.rst

Lines changed: 89 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,91 @@
1-
Glossary
2-
========
1+
.. jinja:: first_ctx
32

4-
workflow
5-
--------
3+
Glossary
4+
========
65

7-
A pipeline that processes data in some way.
6+
API
7+
---
8+
9+
Application programming interface. {{ app_name }}'s API allows us to design and execute workflows from within a Python interpreter or Jupyter notebook.
10+
11+
.. _def_command_files:
12+
13+
Command files
14+
-------------
15+
If you want to refer to any files that are used as inputs or output,
16+
they should be listed under ``command_files`` in the workflow file
17+
18+
.. code-block:: console
19+
20+
command_files:
21+
- label: new_inp_file
22+
name:
23+
name: friction_conductance.inp
24+
25+
26+
CLI
27+
---
28+
29+
Command line interface. The CLI is typically how we interact with {{ app_name }} on HPC systems.
30+
31+
cluster
32+
-------
33+
34+
See HPC
35+
36+
37+
Environment/virtual environment
38+
-------------------------------
39+
40+
An environment is an isolated set of installed software.
41+
Using environments allows you to have multiple copies of the same software installed in different environments so you can run different versions, or to run two pieces of software with competing dependencies on the same machine.
42+
Using and sharing environments helps make your work reproducible because someone can use the same environment on a different machine and be sure they have the same versions of everything.
43+
44+
45+
HPC
46+
---
47+
48+
High-performance computer/computing
49+
50+
51+
jobscript
52+
---------
53+
54+
A job submission script that is used to queue a job on a batch scheduler system, such as SLURM or SGE.
55+
Jobscripts are generated by {{ app_name }} during workflow submission.
56+
57+
.. _def_task:
58+
59+
Tasks
60+
-------------
61+
These are actual usages of a :ref:`task schema <def_task_schema>`, run with defined inputs.
62+
63+
.. _def_task_schema:
64+
65+
Task schema
66+
-------------
67+
This is a template for a task you want to run,
68+
with definitions of the input and outputs that are expected.
69+
70+
{{ app_name }} has many :ref:`built-in task schemas <task_schemas>`, but you may want to write your own.
71+
72+
.. _def_workflow:
73+
74+
Workflow
75+
--------
76+
77+
A pipeline that processes data in some way.
78+
A workflow is a list of tasks that run one after the other.
79+
80+
81+
.. _def_workflow_template:
82+
83+
Workflow template
84+
------------------
85+
86+
A workflow template parameterises a workflow,
87+
providing the required input values for the task schemas of the workflow.
88+
However, it doesn't actually run the :ref:`workflow <def_workflow>`.
89+
A workflow template is usually just the list of tasks,
90+
but can optionally include {{ app_name }} environment,
91+
the :ref:`task schemas <def_task_schema>`, and the :ref:`command files <def_command_files>`.

docs/source/reference/index.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Reference
2+
=========
3+
4+
.. toctree::
5+
:maxdepth: 2
6+
7+
Python API <api>
8+
Command-line interface <cli>
9+
Template components <template_components>
10+
Demo workflows <workflows>
11+
Configuration file <config_file>
12+
Glossary <glossary>

docs/source/reference/template_components/task_schemas.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _task_schemas:
2+
13
Task schemas
24
============
35

0 commit comments

Comments
 (0)