|
2 | 2 |
|
3 | 3 | # Installation |
4 | 4 |
|
5 | | -There are three options for installing `msprime`: |
| 5 | +There are two main options for installing `msprime`: |
6 | 6 |
|
7 | 7 | 1. {ref}`sec_installation_conda`: the recommended options for most users |
8 | 8 | 2. {ref}`sec_installation_pip`: more flexibility and control for advanced users |
9 | | -3. {ref}`sec_installation_container`: to use |
10 | | - `msprime` inside an extremely isolated environment |
11 | 9 |
|
12 | 10 | (sec_installation_conda)= |
13 | 11 |
|
@@ -233,112 +231,3 @@ With GSL installed, install from source by doing: |
233 | 231 | python3 -m pip install msprime --no-binary msprime |
234 | 232 | ``` |
235 | 233 |
|
236 | | -(sec_installation_container)= |
237 | | - |
238 | | -## Via Container |
239 | | - |
240 | | -An [open container](<https://opencontainers.org/>) image (aka docker image) is built on |
241 | | -[Dockerhub](<https://hub.docker.com/r/tskit/msprime>) for each release of |
242 | | -msprime. Each image is [tagged](<https://hub.docker.com/r/tskit/msprime/tags>) |
243 | | -with the corresponding release. For example, for msprime release 0.7.5, the |
244 | | -corresponding image tag is `tskit/msprime:0.7.5`. |
245 | | - |
246 | | -To run a container, you can use [docker](<https://www.docker.com/>), |
247 | | -[Singularity](<https://sylabs.io/singularity/>), |
248 | | -[podman](<https://podman.io/>) or similar tools supporting docker images. |
249 | | - |
250 | | -### docker |
251 | | - |
252 | | -`docker` requires root privilege to run a container: |
253 | | - |
254 | | -```{code-block} bash |
255 | | -
|
256 | | -$ sudo docker run -it tskit/msprime:<release> mspms 10 1 -T |
257 | | -
|
258 | | -``` |
259 | | - |
260 | | -### podman |
261 | | - |
262 | | -podman can run an msprime container without root privilege: |
263 | | - |
264 | | -```{code-block} bash |
265 | | -
|
266 | | -$ podman run -it docker.io/tskit/msprime:<release> mspms 10 1 -T |
267 | | -
|
268 | | -``` |
269 | | - |
270 | | -### Singularity |
271 | | - |
272 | | -A docker image can also be converted to a Singularity container and |
273 | | -then run without root privilege: |
274 | | - |
275 | | -```{code-block} bash |
276 | | -
|
277 | | -$ singularity pull docker://tskit/msprime:<release> msprime-<release>.simg |
278 | | -$ singularity exec msprime-<release>.simg mspms 10 1 -T |
279 | | -
|
280 | | -``` |
281 | | - |
282 | | -::::::{note} |
283 | | - |
284 | | -It is possible that your current environment may conflict with the environment in the singularity container. |
285 | | -There are two workarounds: |
286 | | - |
287 | | -1. Ignore your home with the conflicting environment with `--contain` or `-H </new/path/to/home> -e` |
288 | | - |
289 | | -```{code-block} bash |
290 | | -
|
291 | | -$ singularity shell --contain msprime-release-0.7.3.simg |
292 | | -Singularity: Invoking an interactive shell within container... |
293 | | -
|
294 | | -Singularity msprime-release-0.7.3.simg:~> python3 |
295 | | -Python 3.6.8 (default, Jan 14 2019, 11:02:34) |
296 | | -[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux |
297 | | -Type "help", "copyright", "credits" or "license" for more information. |
298 | | ->>> import msprime |
299 | | ->>> |
300 | | -
|
301 | | -``` |
302 | | - |
303 | | -or use a different path as your home that does not have a conflicting environment |
304 | | - |
305 | | -```{code-block} bash |
306 | | -
|
307 | | -$ singularity shell -H </new/path/to/home> -e msprime-release-0.7.3.simg |
308 | | -Singularity: Invoking an interactive shell within container... |
309 | | -
|
310 | | -Singularity msprime-release-0.7.3.simg:~/cnn_classify_demography> python3 |
311 | | -Python 3.6.8 (default, Jan 14 2019, 11:02:34) |
312 | | -[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux |
313 | | -Type "help", "copyright", "credits" or "license" for more information. |
314 | | ->>> import msprime |
315 | | ->>> |
316 | | -
|
317 | | -``` |
318 | | - |
319 | | -2. In python get rid of your local path |
320 | | - |
321 | | -```{code-block} bash |
322 | | -
|
323 | | -$ singularity shell msprime-release-0.7.3.simg |
324 | | -Singularity: Invoking an interactive shell within container... |
325 | | -
|
326 | | -Singularity msprime-release-0.7.3.simg:~> python3 |
327 | | -Python 3.6.8 (default, Jan 14 2019, 11:02:34) |
328 | | -[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux |
329 | | -Type "help", "copyright", "credits" or "license" for more information. |
330 | | ->>> import sys |
331 | | ->>> for _path in sys.path: |
332 | | -... if ".local" in _path: |
333 | | -... sys.path.remove(_path) |
334 | | -... |
335 | | ->>> import msprime |
336 | | ->>> |
337 | | -
|
338 | | -``` |
339 | | - |
340 | | -:::::: |
341 | | - |
342 | | -For more information on Singularity, see <https://www.sylabs.io/guides/3.6/user-guide/> |
343 | | - |
344 | | - |
0 commit comments