Skip to content

Commit

Permalink
Clean up (#1009)
Browse files Browse the repository at this point in the history
  • Loading branch information
dominichofer authored Oct 25, 2024
1 parent efa8a43 commit 5302b86
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 87 deletions.
1 change: 1 addition & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ pipeline {
}
}
stage('Bootstrap spack') {
// Bootstrapping spack is a separate stage to avoid problems with concurrently bootstrapping spack in the tests.
steps {
sh """
source env/bin/activate
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ After an update we advice to rebuild packages, preferably in a new shell so that
| | Command |
| --- | --- |
| Clone | `git clone --depth 1 --recurse-submodules --shallow-submodules -b <branch/tag> https://github.com/C2SM/spack-c2sm.git` |
| Load | `. spack-c2sm/setup-env.sh` autodetects machine <br>or<br>`. spack-c2sm/setup-env.sh <machine>` forces machine<br>or<br>`. spack-c2sm/setup-env.sh unknown` uses blank config<br>`spack compiler find` [autodetects compilers](https://spack.readthedocs.io/en/v0.18.1/command_index.html?highlight=spack%20load#spack-compiler-find)<br>`spack external find --all` [autodetects externally installed packages](https://spack.readthedocs.io/en/v0.18.1/command_index.html?highlight=spack%20load#spack-external-find)|
| Update | `git pull`<br>`git submodule update --recursive` |
| Clean | `spack uninstall -a` [uninstalls all packages](https://spack.readthedocs.io/en/v0.18.1/command_index.html?highlight=spack%20load#spack-uninstall)<br>`spack clean -a` [cleans all misc caches](https://spack.readthedocs.io/en/v0.18.1/command_index.html?highlight=spack%20load#spack-clean)<br>`rm -rf ~/.spack` removes user scope data |
| Load | `. spack-c2sm/setup-env.sh` to run without an upstream<br>or<br>`. spack-c2sm/setup-env.sh /user-environment` to use `/user-environment` as an upsream<br>`spack compiler find` [autodetects compilers](https://spack.readthedocs.io/en/v0.21.1/command_index.html?highlight=spack%20load#spack-compiler-find)<br>`spack external find --all` [autodetects externally installed packages](https://spack.readthedocs.io/en/v0.21.1/command_index.html?highlight=spack%20load#spack-external-find)|
| Clean | `spack uninstall -a` [uninstalls all packages](https://spack.readthedocs.io/en/v0.21.1/command_index.html?highlight=spack%20load#spack-uninstall)<br>`spack clean -a` [cleans all misc caches](https://spack.readthedocs.io/en/v0.21.1/command_index.html?highlight=spack%20load#spack-clean)|

[**Spec syntax**](https://spack.readthedocs.io/en/v0.18.1/basic_usage.html#specs-dependencies): `<package>`[`@<version>`](https://spack.readthedocs.io/en/v0.18.1/basic_usage.html#version-specifier)[`%<compiler>`](https://spack.readthedocs.io/en/v0.18.1/basic_usage.html#compiler-specifier)[`+<variant> ~<variant>`](https://spack.readthedocs.io/en/v0.18.1/basic_usage.html#variants)[`^<sub-package> +<sub-package-variant>`](https://spack.readthedocs.io/en/v0.18.1/basic_usage.html#specs-dependencies)[`<compiler flags>`](https://spack.readthedocs.io/en/v0.18.1/basic_usage.html#compiler-flags)
[**Spec syntax**](https://spack.readthedocs.io/en/v0.21.1/basic_usage.html#specs-dependencies): `<package>`[`@<version>`](https://spack.readthedocs.io/en/v0.21.1/basic_usage.html#version-specifier)[`%<compiler>`](https://spack.readthedocs.io/en/v0.21.1/basic_usage.html#compiler-specifier)[`+<variant> ~<variant>`](https://spack.readthedocs.io/en/v0.21.1/basic_usage.html#variants)[`^<sub-package> +<sub-package-variant>`](https://spack.readthedocs.io/en/v0.21.1/basic_usage.html#specs-dependencies)[`<compiler flags>`](https://spack.readthedocs.io/en/v0.21.1/basic_usage.html#compiler-flags)

| | Command |
| --- | --- |
Expand All @@ -79,7 +79,7 @@ After an update we advice to rebuild packages, preferably in a new shell so that
| Spec | `spack spec <spec>` concretizes abstract spec (unspecfied variant = **any**)<br>*Spack is not required to use the default of an unspecified variant. The default value is only a tiebreaker for the concretizer.* |
| Install | `spack install <spec>` |
| Locate | `spack location --install-dir <spec>` prints location of **all** installs that satisfy the spec |
| [Load env](https://spack.readthedocs.io/en/v0.18.1/command_index.html?highlight=spack%20load#spack-load) | `spack load <spec>` loads run environment |
| [Activate env](https://spack.readthedocs.io/en/v0.18.1/environments.html) | `spack env activate <env_name>` |
| [Deactivate env](https://spack.readthedocs.io/en/v0.18.1/environments.html) | `spack deactivate` |
| [Load env](https://spack.readthedocs.io/en/v0.21.1/command_index.html?highlight=spack%20load#spack-load) | `spack load <spec>` loads run environment |
| [Activate env](https://spack.readthedocs.io/en/v0.21.1/environments.html) | `spack env activate <env_name>` |
| [Deactivate env](https://spack.readthedocs.io/en/v0.21.1/environments.html) | `spack deactivate` |

22 changes: 7 additions & 15 deletions docs/InstanceManagement.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Versions

Generally, we recommend to host a released version of spack-c2sm and upgrade to newer versions when you see fit.
But if you fancy the latest developments before they are released, you may follow the branch ``main``.
For automated systems that regularly set up a new Spack instance, using a fixed version and updating on demand, is more robust and limits the dependencies of your project. Following ``main`` on the other hand automatically updates to the newest features but breaks upon API chaning commits in spack-c2sm.
For automated systems that regularly set up a new Spack instance, using a fixed version and updating on demand, is more robust and limits the dependencies of your project. Following ``main`` on the other hand automatically updates to the newest features but breaks upon API changing commits in spack-c2sm.

Create a new Spack instance
---------------------------
Expand All @@ -29,20 +29,13 @@ To get an instance, clone spack-c2sm and its submodule spack.
$ git clone --depth 1 --recurse-submodules --shallow-submodules -b <branch/tag> https://github.com/C2SM/spack-c2sm.git
The arguments ``--depth 1`` and ``--shallow-submodules`` are optional, but they reduce the amount of downloaded data.
It is recommended to clone ``spack-c2sm`` in a location that does **not** undergo a
regular cleanup.
It is recommended to clone ``spack-c2sm`` in a location that does **not** undergo a regular cleanup.

Setup Spack environment
-----------------------

``setup-env.sh`` automatically detects the machine it is running on, or falls back to a generic configuration called 'unknown'.
``setup-env.sh <machine>`` forces a machine. This also works with 'unknown' as a machine, which is useful in a container.
It prints which machine it detected.
You may simply execute

.. code-block:: console
$ . spack-c2sm/setup-env.sh
``setup-env.sh <upstream>`` loads spack with the provided upstream to look for preinstalled software and configurations.
``setup-env.sh`` loads spack without an upstream.


Update Spack instance
Expand All @@ -61,10 +54,9 @@ This is required after upgrades at CSCS or if you need new features of a package
Clean Spack instance
--------------------

To clean a Spack instance, empty the caches, uninstall everything and remove misc caches:
To clean a Spack instance, empty the caches and uninstall everything:

.. code-block:: console
$ spack clean -a #[cleans all misc caches](https://spack.readthedocs.io/en/v0.18.1/command_index.html?highlight=spack%20load#spack-clean)
$ spack uninstall -a #[uninstalls all packages](https://spack.readthedocs.io/en/v0.18.1/command_index.html?highlight=spack%20load#spack-uninstall)
$ rm -rf ~/.spack #removes user scope data
$ spack clean -a #[cleans all misc caches](https://spack.readthedocs.io/en/v0.21.1/command_index.html?highlight=spack%20load#spack-clean)
$ spack uninstall -a #[uninstalls all packages](https://spack.readthedocs.io/en/v0.21.1/command_index.html?highlight=spack%20load#spack-uninstall)
29 changes: 0 additions & 29 deletions docs/UpstreamManagement.rst

This file was deleted.

1 change: 0 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ and deploy our software on supercomputers, mostly at the
InstanceManagement
SpackCommands
Testing
UpstreamManagement
CodeDevelopment
SpackChoice

1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
requests
pytest-xdist
5 changes: 0 additions & 5 deletions src/__init__.py

This file was deleted.

18 changes: 0 additions & 18 deletions src/machine.py

This file was deleted.

12 changes: 0 additions & 12 deletions src/machine.sh

This file was deleted.

0 comments on commit 5302b86

Please sign in to comment.