|
| 1 | +# Deploying software with CVMFS |
| 2 | + |
| 3 | +**Home:** [Software management](INDEX.md) |
| 4 | + |
| 5 | +### Contents |
| 6 | + |
| 7 | +- [Introduction](#introduction) |
| 8 | +- [Development vs production repositories](#development-vs-production-repositories) |
| 9 | +- [How to deploy software on CVMFS](#how-to-deploy-software-on-cvmfs) |
| 10 | + - [Example](#example) |
| 11 | +- [Advanced options to the `rsnt-sync` script](#advanced-options-to-the-rsnt-sync-script) |
| 12 | +- [Examples of `rsnt-sync` commands](#examples-of-rsnt-sync-commands) |
| 13 | + |
| 14 | +## Introduction |
| 15 | + |
| 16 | +This page covers only essential information about using CVMFS with our |
| 17 | +infrastructure and software stack. For complete CVMFS documentation, see the |
| 18 | +[official website](https://cvmfs.readthedocs.io/en/stable/). |
| 19 | + |
| 20 | +There are three repositories to which we have access: |
| 21 | + |
| 22 | +- **dev:** `/cvmfs/soft-dev.computecanada.ca` |
| 23 | +- **prod:** `/cvmfs/soft.computecanada.ca` |
| 24 | +- **restricted:** `/cvmfs/restricted.computecanada.ca` |
| 25 | + |
| 26 | +You can use the dev version to push files and see that synchronization happens |
| 27 | +correctly. However, pushing installed software to the dev repository will not |
| 28 | +work transparently, because the installed software is not relocatable. |
| 29 | + |
| 30 | +## Development vs production repositories |
| 31 | + |
| 32 | +A new piece of software must always go first to the development repository |
| 33 | +before going to the production repository. Synchronization always happens: |
| 34 | + |
| 35 | +- From the build node to the development repository |
| 36 | +- From the development repository to the production repository |
| 37 | + |
| 38 | +The idea is that you first test your newly deployed software on the |
| 39 | +`cvmfs-client-dev.computecanada.ca` client before deploying it to the production |
| 40 | +repository. This is to ensure that you do not forget to synchronize some files, |
| 41 | +and to ensure that the piece of software actually works on a different |
| 42 | +environment than the build node. |
| 43 | + |
| 44 | +## How to deploy software on CVMFS |
| 45 | + |
| 46 | +**See also:** [Deploying restricted |
| 47 | +software](easybuild.md#deploying-posix-group-restricted-software-with-cvmfs) |
| 48 | + |
| 49 | +Switch to the user `libuser`: |
| 50 | + |
| 51 | +``` |
| 52 | +sudo su - libuser |
| 53 | +``` |
| 54 | + |
| 55 | +As `libuser`, start a transaction: |
| 56 | + |
| 57 | +``` |
| 58 | +sudo /etc/rsnt/start_transaction <dev|prod|restricted> |
| 59 | +``` |
| 60 | + |
| 61 | +Then synchronize the files needed. You can sync manually, but to avoid most |
| 62 | +mistakes, a wrapper script is provided to make it easier. Typically, you will |
| 63 | +want to run one of the commands below, with the most common at the top: |
| 64 | + |
| 65 | +``` |
| 66 | +# Note: <software name> must be lowercase module name, regardless of what the recipe is named ... |
| 67 | +/etc/rsnt/rsnt-sync --what easybuild --software <software name> --version <software version> |
| 68 | +/etc/rsnt/rsnt-sync --what nix |
| 69 | +/etc/rsnt/rsnt-sync --what custom --path <path> |
| 70 | +/etc/rsnt/rsnt-sync --what config |
| 71 | +/etc/rsnt/rsnt-sync --what easybuild-recipes |
| 72 | +``` |
| 73 | + |
| 74 | +Note: the option `custom-python` exists as a backward compatibility to |
| 75 | +synchronize all python wheels. |
| 76 | + |
| 77 | +For more advanced options, see the section below. |
| 78 | + |
| 79 | +**If you make a mistake, don’t panic, simply run:** |
| 80 | + |
| 81 | +``` |
| 82 | +sudo /etc/rsnt/abort_transaction <dev|prod|restricted> |
| 83 | +exit |
| 84 | +``` |
| 85 | + |
| 86 | +This will revert the changes and you can start over. |
| 87 | + |
| 88 | +Check that the changes rsynced match what you expect: |
| 89 | + |
| 90 | +``` |
| 91 | +ls /stratum0/cvmfs/soft.computecanada.ca/<sub path> |
| 92 | +``` |
| 93 | + |
| 94 | +or: |
| 95 | + |
| 96 | +``` |
| 97 | +ls /stratum0/cvmfs/soft-dev.computecanada.ca/<sub path> |
| 98 | +``` |
| 99 | + |
| 100 | +or: |
| 101 | + |
| 102 | +``` |
| 103 | +ls /stratum0/cvmfs/restricted.computecanada.ca/<sub path> |
| 104 | +``` |
| 105 | + |
| 106 | +Once you are confident that the changes in |
| 107 | +`/stratum0/cvmfs/{soft-dev,soft,restricted}.computecanada.ca/` represent what |
| 108 | +needed to be done, run: |
| 109 | + |
| 110 | +``` |
| 111 | +sudo /etc/rsnt/publish_transaction <dev|prod|restricted> |
| 112 | +exit |
| 113 | +``` |
| 114 | + |
| 115 | +Note that changes will propagate to the clusters within 30 minutes. |
| 116 | + |
| 117 | +### Example |
| 118 | + |
| 119 | +Here is a concrete example how to deploy deal.II 8.4.2: |
| 120 | + |
| 121 | +``` |
| 122 | +sudo su - libuser |
| 123 | +
|
| 124 | +sudo /etc/rsnt/start_transaction dev |
| 125 | +/etc/rsnt/rsnt-sync --what easybuild --software dealii --version 8.4.2 |
| 126 | +sudo /etc/rsnt/publish_transaction dev |
| 127 | +
|
| 128 | +sudo /etc/rsnt/start_transaction prod |
| 129 | +/etc/rsnt/rsnt-sync --what easybuild --software dealii --version 8.4.2 |
| 130 | +sudo /etc/rsnt/publish_transaction prod |
| 131 | +``` |
| 132 | + |
| 133 | +## Advanced options to the `rsnt-sync` script |
| 134 | + |
| 135 | +The `rsnt-sync` script accepts many options. The most current information about |
| 136 | +them is obtained by running: |
| 137 | + |
| 138 | +``` |
| 139 | +/etc/rsnt/rsnt-sync --help |
| 140 | +``` |
| 141 | + |
| 142 | +As of Sept. 6th, 2017, the options are: |
| 143 | + |
| 144 | +``` |
| 145 | +/etc/rsnt/rsnt-sync --what <nix|config|easybuild|custom> \ |
| 146 | + [--software <software name>] \ |
| 147 | + [--version <software version>] \ |
| 148 | + [--architecture <architecture>] \ |
| 149 | + [--root_path <software root path>] \ |
| 150 | + [--modules-only] [--software-only] [--no-size-only] \ |
| 151 | + [--repo <dev|prod>] \ |
| 152 | + [--path <source path>] |
| 153 | +``` |
| 154 | + |
| 155 | +Most of these options are useful only for synchronizing something installed via |
| 156 | +EasyBuild. The following are designed to be used with `--software <software |
| 157 | +name>`: |
| 158 | + |
| 159 | +- `--version <software version>`: will synchronize only a specific version |
| 160 | +- `--architecture <architecture>`: will synchronize only for a specific |
| 161 | + architecture |
| 162 | +- `--root_path <software root path>`: will synchronize only software installed |
| 163 | + within a specific root path below the `easybuild/{software,modules}` folders. |
| 164 | +- `--module-only`: will skip synchronizing the `software` folder |
| 165 | +- `--software-only`: will skip synchronizing the `modules` folder |
| 166 | + |
| 167 | +The option `--repo` allows you to specify a repository to synchronize to. |
| 168 | +Typically, this is automatically detected (provided that you have a transaction |
| 169 | +opened only on one repository). |
| 170 | + |
| 171 | +The option `--path` allows you to synchronize a specific path only. The path |
| 172 | +specified is relative to the repository (i.e. relative to |
| 173 | +`/cvmfs/soft.computecanada.ca/easybuild`) and should NOT include a trailing |
| 174 | +slash. |
| 175 | + |
| 176 | +## Examples of `rsnt-sync` commands |
| 177 | + |
| 178 | +- To synchronize all versions of GROMACS, for all architectures: |
| 179 | + |
| 180 | +``` |
| 181 | +/etc/rsnt/rsnt-sync --what easybuild --software gromacs |
| 182 | +``` |
| 183 | + |
| 184 | +- To synchronize all builds of GROMACS 5.1.4 for all architectures: |
| 185 | + |
| 186 | +``` |
| 187 | +/etc/rsnt/rsnt-sync --what easybuild --software gromacs --version 5.1.4 |
| 188 | +``` |
| 189 | + |
| 190 | +- To synchronize all builds of GROMACS 5.1.4 for architecture `avx`: |
| 191 | + |
| 192 | +``` |
| 193 | +/etc/rsnt/rsnt-sync --what easybuild --software gromacs --version 5.1.4 --architecture avx |
| 194 | +``` |
| 195 | + |
| 196 | +- To synchronize all builds of GROMACS 5.1.4 for architecture `avx2` under the |
| 197 | + `/cvmfs/soft.computecanada.ca/easybuild/{software,modules}/MPI/intel2016.4/openmpi2.0.2` |
| 198 | + path: |
| 199 | + |
| 200 | +``` |
| 201 | +/etc/rsnt/rsnt-sync --what easybuild --software gromacs --version 5.1.4 --architecture avx2 --root_path MPI/intel2016.4/openmpi2.0.2 |
| 202 | +``` |
| 203 | + |
| 204 | +- To synchronize the path |
| 205 | + `/cvmfs/soft.computecanada.ca/easybuild/software/2017/avx2/MPI/intel2016.4/openmpi2.0/boost`, |
| 206 | + you would run: |
| 207 | + |
| 208 | +``` |
| 209 | +/etc/rsnt/rsnt-sync --what easybuild --path software/2017/avx2/MPI/intel2016.4/openmpi2.0/boost |
| 210 | +``` |
| 211 | + |
| 212 | +You would then need to synchronize the corresponding path in the `modules` |
| 213 | +subdirectory to synchronize the module as well as the software: |
| 214 | + |
| 215 | +``` |
| 216 | +/etc/rsnt/rsnt-sync --what easybuild --path modules/2017/avx2/MPI/intel2016.4/openmpi2.0/boost |
| 217 | +``` |
| 218 | + |
| 219 | +- To synchronize some configuration files (in the subdirectory |
| 220 | + `soft.computecanada.ca/config`), use: |
| 221 | + |
| 222 | +``` |
| 223 | +/etc/rsnt/rsnt-sync --what config |
| 224 | +``` |
| 225 | + |
| 226 | +- To synchronize any Python wheels, use: |
| 227 | + |
| 228 | +``` |
| 229 | +/etc/rsnt/rsnt-sync --what custom --path python/wheelhouse |
| 230 | +``` |
| 231 | + |
| 232 | +- To synchronize specific Python wheels, use: |
| 233 | + |
| 234 | +``` |
| 235 | +/etc/rsnt/rsnt-sync --what custom --path python/wheelhouse --software numpy --version 1.18 |
| 236 | +``` |
0 commit comments