Skip to content

Commit

Permalink
Merge branch 'master' into rtd
Browse files Browse the repository at this point in the history
  • Loading branch information
scanon committed Jun 3, 2020
2 parents 638d635 + d6370b6 commit 7c38df1
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 87 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ compiler:
- clang
- gcc
# command to install dependencies
env:
- PATH
before_install:
- sudo chmod 755 /var/log
- sudo add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/ precise universe multiverse"
Expand Down
100 changes: 62 additions & 38 deletions doc/install/centos6.rst
Original file line number Diff line number Diff line change
@@ -1,35 +1,45 @@
=============================================================
Installing Shifter on a RHEL/Centos/Scientific Linux 6 System
*************************************************************
=============================================================


-------------
Building RPMs
=============
-------------

First, ensure your build system has all necessary packages installed:

First, ensure your build system has all necessary packages installed::
.. code-block:: bash
yum install epel-release
yum install rpm-build gcc glibc-devel munge libcurl-devel json-c \
json-c-devel pam-devel munge-devel libtool autoconf automake \
gcc-c++ python-pip xfsprogs squashfs-tools python-devel
Next, if not using a prepared source tarball, generate one from the repo::
Next, if not using a prepared source tarball, generate one from the repo:

.. code-block:: bash
git clone https://github.com/NERSC/shifter.git
[[ perform any needed git operations to get a particular branch or commit
you require ]]
# checkout a particular branch or commit you require
VERSION=$(grep Version: shifter/shifter.spec | awk '{print $2}')
cp -rp shifter "shifter-$VERSION"
tar cf "shifter-$VERSION.tar.gz" "shifter-$VERSION"
Build the RPMs from your tarball::
Build the RPMs from your tarball:

.. code-block:: bash
rpmbuild -tb "shifter-$VERSION.tar.gz"
*Note about Slurm support*
To build with Slurm support do::
.. note:: To build with Slurm support, execute:

rpmbuild -tb "shifter-$VERSION.tar.gz" --define "with_slurm /usr"
.. code-block:: bash
rpmbuild -tb "shifter-$VERSION.tar.gz" --define "with_slurm /usr"
Change ``/usr`` to the base path Slurm is installed in.

Change "/usr" to the base path Slurm is installed in.

Installing the Image Manager
============================
Expand All @@ -39,39 +49,48 @@ cluster so long as it is running munge using the same munge key as all the
compute nodes (and login nodes) and all nodes can access the imagegwapi port
(typically 5000) on the image manager system.

Install the needed dependencies and shifter RPMs::
Install the needed dependencies and shifter RPMs:

.. code-block:: bash
yum install epel-release
yum install python python-pip munge json-c squashfs-tools
rpm -i /path/to/rpmbuild/RPMS/x86_64/shifter-imagegw-$VERSION.rpm
## shifter-runtime is optional, but recommended on the image gateway system
``shifter-runtime`` is optional, but is recommended on the image gateway system

.. code-block:: bash
rpm -i /path/to/rpmbuild/RPMS/x86_64/shifter-runtime-$VERSION.rpm
Configuring the Image Manager
=============================
Copy /etc/shifter/imagemanager.json.example to /etc/shifter/imagemanager.json.
Copy ``/etc/shifter/imagemanager.json.example`` to ``/etc/shifter/imagemanager.json``.
At minimum you should check that:

* "MongoDBURI" is correct URL to shifter imagegw mongodb server
* "CacheDirectory" exists, semi-permanent storage for docker layers
* "ExpandDirectory" exists, temporary storage for converting images
* Change "mycluster" under "Platforms" to match your system name, should match the "system" configuration in udiRoot.conf
* Ensure the "imageDir" is set correctly for your system
* ``MongoDBURI`` is correct URL to shifter imagegw mongodb server.
* ``CacheDirectory`` exists, semi-permanent storage for docker layers.
* ``ExpandDirectory`` exists, temporary storage for converting images.
* Change ``mycluster`` under ``Platforms`` to match your system name,
should match the ``system`` configuration in ``udiRoot.conf``.
* Ensure the ``imageDir`` is set correctly for your system.

The imageDir should be a network volume accessible on all nodes in the system.
The CacheDirectory and ExpandDirectory need only be visible on the imagegw
The ``imageDir`` should be a network volume accessible on all nodes in the system.
The ``CacheDirectory`` and ``ExpandDirectory`` need only be visible on the imagegw
system.

See TODO:FutureDocument for more information on imagegw configuration.
.. note:: See TODO:FutureDocument for more information on imagegw configuration.

Installing the Shifter Runtime
==============================

The shifter runtime needs to be installed on the login nodes as well as the
compute nodes.

Install the needed dependencies and shifter RPMs::
Install the needed dependencies and shifter RPMs:

.. code-block:: bash
yum install epel-release
yum install json-c munge
Expand All @@ -80,39 +99,44 @@ Install the needed dependencies and shifter RPMs::
Configuring the Shifter Runtime
===============================
Copy /etc/shifter/udiRoot.conf.example to /etc/shifter/udiRoot.conf
Copy ``/etc/shifter/udiRoot.conf.example`` to ``/etc/shifter/udiRoot.conf``
At minimum you need to change:

* set the value for "system" to match the platform name from
imagemanager.json
* set the value for ``system`` to match the platform name from
``imagemanager.json``
* set the URL for imageGateway to match your imagegw machine, no trailing slash

Generate a passwd and group file for all your shifter users and place in:
Generate a ``passwd`` and ``group`` file for all your shifter users and place in:

* ``/etc/shifter/etc_files/passwd``
* ``/etc/shifter/etc_files/group``

Often, these can be generated as easily as
``getent passwd > /etc/shifter/etc_files/passwd``, however you'll need to setup
:code:`getent passwd > /etc/shifter/etc_files/passwd`, however you'll need to setup
to match your local user management configuration. The path to these
share etc files for all shifter containers can be controlled with the *etcPath*
configuration in udiRoot.conf. It is recommended that it be on a network
share etc files for all shifter containers can be controlled with the ``etcPath``
configuration in ``udiRoot.conf``. It is recommended that it be on a network
volume to ease updating the passwd and group files.

See TODO:FutureDocument for more information on udiRoot.conf configuration.
.. note:: See TODO:FutureDocument for more information on ``udiRoot.conf`` configuration.

Starting the Image Manager
==========================

Ensure that mongod is running, if configured to be on the same host as
the imagegw, do something like:
Ensure that ``mongod`` is running. If configured to be on the same host as
the ``imagegw``, do something like:

1. ``yum install mongodb-server``
2. ``/etc/init.d/mongod start``
.. code-block:: bash
yum install mongodb-server
/etc/init.d/mongod start
.. note:: TODO: Put init scripts into RPM distribution

TODO: put init scripts into RPM distribution
Without init scripts, do something like:

``/usr/libexec/shifter/imagegwapi.py > /var/log/imagegwapi.log &``
.. code-block:: bash
/usr/libexec/shifter/imagegwapi.py > /var/log/imagegwapi.log &
* Ensure that CLUSTERNAME matches the values in udiRoot.conf (system) and imagemanger.json (platform)
Ensure that ``CLUSTERNAME`` matches the values in ``udiRoot.conf`` (system) and ``imagemanger.json`` (platform).
112 changes: 65 additions & 47 deletions doc/install/cle6.rst
Original file line number Diff line number Diff line change
@@ -1,91 +1,109 @@
================================================
Installing Shifter Runtime in Cray's CLE 6.0UP01
================================================

--------------------------------------
Setting up Compute node kernel support
--------------------------------------
1. Build compute node image
2. Boot compute node
3. Install appropriate kernel-sources and kernel-syms
e.g.,

zypper install --oldpackage kernel-source-3.12.51-52.31.1_1.0600.9146.67.1
zypper install --oldpackage kernel-syms.12.51-52.31.1_1.0600.9146.67.1
1. Build compute node image.
2. Boot compute node.
3. Install appropriate ``kernel-source`` and ``kernel-syms``. For example:

.. code-block:: bash
zypper install --oldpackage kernel-source-3.12.51-52.31.1_1.0600.9146.67.1
zypper install --oldpackage kernel-syms.12.51-52.31.1_1.0600.9146.67.1
4. :code:`rpmbuild -bb /path/to/shifter_cle6_kmod_deps.spec`
5. Put resulting RPM in a repo, pkgcoll, and update compute image.

4. rpmbuild -bb /path/to/shifter_cle6_kmod_deps.spec
6. Put resulting RPM in a repo, pkgcoll, and update compute image

--------------------------------------------
Configuring udiRoot with custom ansible play
--------------------------------------------

1. Refer to the sample ansible play/role in the shifter distribution under
extra/cle6/ansible
2. Make modifications to each of the following to meet your needs
- vars/main.yaml
- templates/udiRoot.conf.j2
- files/premount.sh
- files/postmount.sh
- vars/cluster.yaml
``extra/cle6/ansible``.
2. Make modifications to each of the following files to meet your needs

* ``vars/main.yaml``
* ``templates/udiRoot.conf.j2``
* ``files/premount.sh``
* ``files/postmount.sh``
* ``vars/cluster.yaml``

3. Ensure the tasks/main.yaml is appropriate for your site


+++++++++++++++++++++++++++++++++++++++++
Configuration considerations for DataWarp
+++++++++++++++++++++++++++++++++++++++++

For DataWarp mount points to be available in shifter containers, you'll need
to ensure that all mounts under `/var/opt/cray/dws` are imported into the
to ensure that all mounts under ``/var/opt/cray/dws`` are imported into the
container. Unfortunately, these mounts can sometimes come in after the
container is setup. Also, it is hard to predict the exact mount point,
thus, we use two mount flags:
- rec, enables a recursive mount of the path to pull in all mounts below it
- slave, propagates any changes from the external environment into the container

* ``rec``, enables a recursive mount of the path to pull in all mounts below it
* ``slave``, propagates any changes from the external environment into the container
slaved bind mounts are not functional in CLE5.2, but work in CLE6

Add the following to the udiRoot.conf siteFs:
/var/opt/cray/dws:/var/opt/cray/dws:rec:slave
Add the following to ``siteFs`` in your ``udiRoot.conf``::

/var/opt/cray/dws:/var/opt/cray/dws:rec:slave

Or, to the "compute" section of the "shifterSiteFsByType" variable in shifter
Or, to the "compute" section of the ``shifterSiteFsByType`` variable in shifter
ansible role.


++++++++++++++++++++++++++++++++++++
Configuration considerations for MPI
++++++++++++++++++++++++++++++++++++

To enable Cray-native MPI in shifter containers, there are a few needed changes
to the container environment.

1. Need to patch /var/opt/cray/alps and /etc/opt/cray/wlm_detect into the
container environment. /etc/opt/cray/wlm_detect is a NEW requirement in CLE6
2. To enable override of libmpi.so for client containers, run
extra/prep_cray_mpi_libs.py from the shifter distribution (also installed in
the %libexec% path if shifter-runtime RPM is used).

"""
mkdir -p /tmp/cray
cd /path/to/shifter/extra
python ./prep_cray_mpi_libs.py /tmp/cray
"""

You can then either copy /tmp/cray/mpich-<version> to
/usr/lib/shifter/opt/mpich-<version> or integrate the RPM in
/tmp/cray/RPMS/x86_64/shifter_cray_mpich_<version>....rpm into your
1. Need to patch ``/var/opt/cray/alps`` and ``/etc/opt/cray/wlm_detect`` into the
container environment. ``/etc/opt/cray/wlm_detect`` is a NEW requirement in CLE6
2. To enable override of ``libmpi.so`` for client containers, run
``extra/prep_cray_mpi_libs.py`` from the shifter distribution (also installed in
the ``%libexec%`` path if shifter-runtime RPM is used).

.. code-block:: bash
mkdir -p /tmp/cray
cd /path/to/shifter/extra
python ./prep_cray_mpi_libs.py /tmp/cray
You can then either copy ``/tmp/cray/mpich-<version>`` to
``/usr/lib/shifter/opt/mpich-<version>`` or integrate the RPM in
``/tmp/cray/RPMS/x86_64/shifter_cray_mpich_<version>....rpm`` into your
compute and login images.
3. Setup a shifter module to setup cray mpich by adding the following to
your udiRoot.conf:
your ``udiRoot.conf``::

module_mpich_copyPath = /usr/lib/shifter/opt/mpich-<version>
module_mpich_siteEnvPrepend = LD_LIBRARY_PATH=/opt/udiImage/modules/mpich/lib64
module_mpich_siteEnv = SHIFTER_MODULE_MPICH=1

4. If you wish the mpich module to load by default on every shifter invocation,
then add the following to your udiRoot.conf:
then add the following to your udiRoot.conf::

defaultModules = mpich

prep_cray_mpi_libs.py copies the shared libraries from the CrayPE cray-mpich
and cray-mpich-abi modules (for both PrgEnv-gnu and PrgEnv-intel), into the
``prep_cray_mpi_libs.py`` copies the shared libraries from the CrayPE ``cray-mpich``
and ``cray-mpich-abi`` modules (for both ``PrgEnv-gnu`` and ``PrgEnv-intel``), into the
target path. It then recursively identifies dependencies for those shared
libraries and copies those to target/dep. Finally it rewrites the RPATH entry
for all the shared libraries to /opt/udiImage/cray/lib64/dep; this allows the
target libraries to exist in /opt/udiImage/cray/lib64, and ONLY have that path
in LD_LIBRARY_PATH, minimizing search time. Also, since none of the dependency
libraries are copies to /opt/udiImage/cray/lib64, but to
/opt/udiImage/cray/lib64/dep, and those are accessed via the modified RPATH,
libraries and copies those to target/dep. Finally it rewrites the ``RPATH`` entry
for all the shared libraries to ``/opt/udiImage/cray/lib64/dep``; this allows the
target libraries to exist in ``/opt/udiImage/cray/lib64``, and ONLY have that path
in ``LD_LIBRARY_PATH``, minimizing search time. Also, since none of the dependency
libraries are copies to ``/opt/udiImage/cray/lib64``, but to
``/opt/udiImage/cray/lib64/dep``, and those are accessed via the modified ``RPATH``,
there is minimal bleedthrough of the dependency libraries into the container
environment.
prep_cray_mpi_libs.py requires patchelf (https://nixos.org/patchelf.html).
``prep_cray_mpi_libs.py`` requires `patchelf`_.

.. _patchelf: https://github.com/NixOS/patchelf

0 comments on commit 7c38df1

Please sign in to comment.