Remove 'spack bootstrap' and associated docs (#15179)
fixes #15145 This commit removes the outdated `spack bootstrap` command and any reference to it in the documentation and unit tests.
This commit is contained in:
parent
4c666034dc
commit
43c9ad3421
@ -22,11 +22,6 @@ jobs:
|
|||||||
os: linux
|
os: linux
|
||||||
language: python
|
language: python
|
||||||
env: TEST_SUITE=flake8
|
env: TEST_SUITE=flake8
|
||||||
# Shell integration with module files
|
|
||||||
- python: '3.8'
|
|
||||||
os: linux
|
|
||||||
language: python
|
|
||||||
env: [ TEST_SUITE=bootstrap ]
|
|
||||||
- stage: 'unit tests + documentation'
|
- stage: 'unit tests + documentation'
|
||||||
python: '2.6'
|
python: '2.6'
|
||||||
dist: trusty
|
dist: trusty
|
||||||
|
@ -71,10 +71,6 @@ This automatically adds Spack to your ``PATH`` and allows the ``spack``
|
|||||||
command to be used to execute spack :ref:`commands <shell-support>` and
|
command to be used to execute spack :ref:`commands <shell-support>` and
|
||||||
:ref:`useful packaging commands <packaging-shell-support>`.
|
:ref:`useful packaging commands <packaging-shell-support>`.
|
||||||
|
|
||||||
If :ref:`environment-modules <InstallEnvironmentModules>` is
|
|
||||||
installed and available, the ``spack`` command can also load and unload
|
|
||||||
:ref:`modules <modules>`.
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^
|
||||||
Clean Environment
|
Clean Environment
|
||||||
^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^
|
||||||
@ -900,9 +896,8 @@ Core Spack Utilities
|
|||||||
^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
Core Spack uses the following packages, mainly to download and unpack
|
Core Spack uses the following packages, mainly to download and unpack
|
||||||
source code, and to load generated environment modules: ``curl``,
|
source code: ``curl``, ``env``, ``git``, ``go``, ``hg``, ``svn``,
|
||||||
``env``, ``git``, ``go``, ``hg``, ``svn``, ``tar``, ``unzip``,
|
``tar``, ``unzip``, ``patch``
|
||||||
``patch``, ``environment-modules``.
|
|
||||||
|
|
||||||
As long as the user's environment is set up to successfully run these
|
As long as the user's environment is set up to successfully run these
|
||||||
programs from outside of Spack, they should work inside of Spack as
|
programs from outside of Spack, they should work inside of Spack as
|
||||||
@ -910,10 +905,6 @@ well. They can generally be activated as in the ``curl`` example above;
|
|||||||
or some systems might already have an appropriate hand-built
|
or some systems might already have an appropriate hand-built
|
||||||
environment module that may be loaded. Either way works.
|
environment module that may be loaded. Either way works.
|
||||||
|
|
||||||
If you find that you are missing some of these programs, ``spack`` can
|
|
||||||
build some of them for you with ``spack bootstrap``. Currently supported
|
|
||||||
programs are ``environment-modules``.
|
|
||||||
|
|
||||||
A few notes on specific programs in this list:
|
A few notes on specific programs in this list:
|
||||||
|
|
||||||
""""""""""""""""""""""""""
|
""""""""""""""""""""""""""
|
||||||
@ -941,45 +932,6 @@ other programs will also not work, because they also rely on OpenSSL.
|
|||||||
Once ``curl`` has been installed, you can similarly install the others.
|
Once ``curl`` has been installed, you can similarly install the others.
|
||||||
|
|
||||||
|
|
||||||
.. _InstallEnvironmentModules:
|
|
||||||
|
|
||||||
"""""""""""""""""""
|
|
||||||
Environment Modules
|
|
||||||
"""""""""""""""""""
|
|
||||||
|
|
||||||
In order to use Spack's generated module files, you must have
|
|
||||||
installed ``environment-modules`` or ``lmod``. The simplest way
|
|
||||||
to get the latest version of either of these tools is installing
|
|
||||||
it as part of Spack's bootstrap procedure:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ spack bootstrap
|
|
||||||
|
|
||||||
.. warning::
|
|
||||||
At the moment ``spack bootstrap`` is only able to install ``environment-modules``.
|
|
||||||
Extending its capabilities to prefer ``lmod`` where possible is in the roadmap,
|
|
||||||
and likely to happen before the next release.
|
|
||||||
|
|
||||||
Alternatively, on many Linux distributions, you can install a pre-built binary
|
|
||||||
from the vendor's repository. On Fedora/RHEL/CentOS, for example, this can be
|
|
||||||
done with the command:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ yum install environment-modules
|
|
||||||
|
|
||||||
Once you have the tool installed and available in your path, you can source
|
|
||||||
Spack's setup file:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ source share/spack/setup-env.sh
|
|
||||||
|
|
||||||
This activates :ref:`shell support <shell-support>` and makes commands like
|
|
||||||
``spack load`` available for use.
|
|
||||||
|
|
||||||
|
|
||||||
^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^
|
||||||
Package Utilities
|
Package Utilities
|
||||||
^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^
|
||||||
|
@ -17,22 +17,16 @@ Spack integrates with `Environment Modules
|
|||||||
<http://lmod.readthedocs.io/en/latest/>`_ by
|
<http://lmod.readthedocs.io/en/latest/>`_ by
|
||||||
providing post-install hooks that generate module files and commands to manipulate them.
|
providing post-install hooks that generate module files and commands to manipulate them.
|
||||||
|
|
||||||
.. note::
|
|
||||||
|
|
||||||
If your machine does not already have a module system installed,
|
|
||||||
we advise you to use either Environment Modules or LMod. See :ref:`InstallEnvironmentModules`
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
.. _shell-support:
|
.. _shell-support:
|
||||||
|
|
||||||
----------------------------
|
----------------------------
|
||||||
Using module files via Spack
|
Using module files via Spack
|
||||||
----------------------------
|
----------------------------
|
||||||
|
|
||||||
If you have installed a supported module system either manually or through
|
If you have installed a supported module system you should be able to
|
||||||
``spack bootstrap``, you should be able to run either ``module avail`` or
|
run either ``module avail`` or ``use -l spack`` to see what module
|
||||||
``use -l spack`` to see what module files have been installed. Here is
|
files have been installed. Here is sample output of those programs,
|
||||||
sample output of those programs, showing lots of installed packages:
|
showing lots of installed packages:
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
@ -93,9 +87,7 @@ Note that in the latter case it is necessary to explicitly set ``SPACK_ROOT``
|
|||||||
before sourcing the setup file (you will get a meaningful error message
|
before sourcing the setup file (you will get a meaningful error message
|
||||||
if you don't).
|
if you don't).
|
||||||
|
|
||||||
When ``bash`` and ``ksh`` users update their environment with ``setup-env.sh``, it will check for spack-installed environment modules and add the ``module`` command to their environment; This only occurs if the module command is not already available. You can install ``environment-modules`` with ``spack bootstrap`` as described in :ref:`InstallEnvironmentModules`.
|
If you want to have Spack's shell support available on the command line at
|
||||||
|
|
||||||
Finally, if you want to have Spack's shell support available on the command line at
|
|
||||||
any login you can put this source line in one of the files that are sourced
|
any login you can put this source line in one of the files that are sourced
|
||||||
at startup (like ``.profile``, ``.bashrc`` or ``.cshrc``). Be aware though
|
at startup (like ``.profile``, ``.bashrc`` or ``.cshrc``). Be aware though
|
||||||
that the startup time may be slightly increased because of that.
|
that the startup time may be slightly increased because of that.
|
||||||
|
@ -1442,8 +1442,7 @@ The following functionality is prepared:
|
|||||||
|
|
||||||
#. Base image: the example starts from a minimal ubuntu.
|
#. Base image: the example starts from a minimal ubuntu.
|
||||||
|
|
||||||
#. Pre-install the spack dependencies, including modules from the packages.
|
#. Pre-install the spack dependencies.
|
||||||
This avoids needing to build those from scratch via ``spack bootstrap``.
|
|
||||||
Package installs are followed by a clean-up of the system package index,
|
Package installs are followed by a clean-up of the system package index,
|
||||||
to avoid outdated information and it saves space.
|
to avoid outdated information and it saves space.
|
||||||
|
|
||||||
|
@ -1,80 +0,0 @@
|
|||||||
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
|
||||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
||||||
|
|
||||||
import llnl.util.cpu
|
|
||||||
import llnl.util.tty as tty
|
|
||||||
|
|
||||||
import spack.repo
|
|
||||||
import spack.spec
|
|
||||||
import spack.cmd.common.arguments as arguments
|
|
||||||
|
|
||||||
description = "Bootstrap packages needed for spack to run smoothly"
|
|
||||||
section = "admin"
|
|
||||||
level = "long"
|
|
||||||
|
|
||||||
|
|
||||||
def setup_parser(subparser):
|
|
||||||
arguments.add_common_arguments(subparser, ['jobs'])
|
|
||||||
subparser.add_argument(
|
|
||||||
'--keep-prefix', action='store_true', dest='keep_prefix',
|
|
||||||
help="don't remove the install prefix if installation fails")
|
|
||||||
subparser.add_argument(
|
|
||||||
'--keep-stage', action='store_true', dest='keep_stage',
|
|
||||||
help="don't remove the build stage if installation succeeds")
|
|
||||||
arguments.add_common_arguments(subparser, ['no_checksum'])
|
|
||||||
subparser.add_argument(
|
|
||||||
'-v', '--verbose', action='store_true', dest='verbose',
|
|
||||||
help="display verbose build output while installing")
|
|
||||||
|
|
||||||
cache_group = subparser.add_mutually_exclusive_group()
|
|
||||||
cache_group.add_argument(
|
|
||||||
'--use-cache', action='store_true', dest='use_cache', default=True,
|
|
||||||
help="check for pre-built Spack packages in mirrors (default)")
|
|
||||||
cache_group.add_argument(
|
|
||||||
'--no-cache', action='store_false', dest='use_cache', default=True,
|
|
||||||
help="do not check for pre-built Spack packages in mirrors")
|
|
||||||
cache_group.add_argument(
|
|
||||||
'--cache-only', action='store_true', dest='cache_only', default=False,
|
|
||||||
help="only install package from binary mirrors")
|
|
||||||
|
|
||||||
cd_group = subparser.add_mutually_exclusive_group()
|
|
||||||
arguments.add_common_arguments(cd_group, ['clean', 'dirty'])
|
|
||||||
|
|
||||||
|
|
||||||
def bootstrap(parser, args, **kwargs):
|
|
||||||
kwargs.update({
|
|
||||||
'keep_prefix': args.keep_prefix,
|
|
||||||
'keep_stage': args.keep_stage,
|
|
||||||
'install_deps': 'dependencies',
|
|
||||||
'verbose': args.verbose,
|
|
||||||
'dirty': args.dirty,
|
|
||||||
'use_cache': args.use_cache,
|
|
||||||
'cache_only': args.cache_only
|
|
||||||
})
|
|
||||||
|
|
||||||
# Define requirement dictionary defining general specs which need
|
|
||||||
# to be satisfied, and the specs to install when the general spec
|
|
||||||
# isn't satisfied.
|
|
||||||
requirement_dict = {
|
|
||||||
# Install environment-modules with generic optimizations
|
|
||||||
'environment-modules': 'environment-modules~X target={0}'.format(
|
|
||||||
llnl.util.cpu.host().family
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
for requirement in requirement_dict:
|
|
||||||
installed_specs = spack.store.db.query(requirement)
|
|
||||||
if(len(installed_specs) > 0):
|
|
||||||
tty.msg("Requirement %s is satisfied with installed "
|
|
||||||
"package %s" % (requirement, installed_specs[0]))
|
|
||||||
else:
|
|
||||||
# Install requirement
|
|
||||||
spec_to_install = spack.spec.Spec(requirement_dict[requirement])
|
|
||||||
spec_to_install.concretize()
|
|
||||||
tty.msg("Installing %s to satisfy requirement for %s" %
|
|
||||||
(spec_to_install, requirement))
|
|
||||||
kwargs['explicit'] = True
|
|
||||||
package = spack.repo.get(spec_to_install)
|
|
||||||
package.do_install(**kwargs)
|
|
@ -1,37 +0,0 @@
|
|||||||
#!/bin/bash -e
|
|
||||||
#
|
|
||||||
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
|
||||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
||||||
|
|
||||||
#
|
|
||||||
# Description:
|
|
||||||
# Checks that Spack shell integration with modules works correctly.
|
|
||||||
#
|
|
||||||
# Usage:
|
|
||||||
# run-bootstrap-tests
|
|
||||||
#
|
|
||||||
. "$(dirname $0)/setup.sh"
|
|
||||||
check_dependencies ${coverage} git hg svn
|
|
||||||
|
|
||||||
# Fetch the sources in a mirror, and add it to Spack
|
|
||||||
mkdir -p ~/.mirror
|
|
||||||
bin/spack mirror add travis ~/.mirror
|
|
||||||
bin/spack mirror create -D -d ~/.mirror environment-modules~X
|
|
||||||
|
|
||||||
|
|
||||||
# Move to root directory of Spack
|
|
||||||
# Allows script to be run from anywhere
|
|
||||||
cd "$SPACK_ROOT"
|
|
||||||
|
|
||||||
# Print compiler information
|
|
||||||
spack config get compilers
|
|
||||||
|
|
||||||
# Run some build smoke tests, potentially with code coverage
|
|
||||||
${coverage_run} bin/spack bootstrap
|
|
||||||
|
|
||||||
# Check module integration
|
|
||||||
. "share/spack/setup-env.sh"
|
|
||||||
module av || exit 1
|
|
||||||
spack load tcl || exit 1
|
|
@ -313,7 +313,7 @@ _spack() {
|
|||||||
then
|
then
|
||||||
SPACK_COMPREPLY="-h --help -H --all-help --color -C --config-scope -d --debug --timestamp --pdb -e --env -D --env-dir -E --no-env --use-env-repo -k --insecure -l --enable-locks -L --disable-locks -m --mock -p --profile --sorted-profile --lines -v --verbose --stacktrace -V --version --print-shell-vars"
|
SPACK_COMPREPLY="-h --help -H --all-help --color -C --config-scope -d --debug --timestamp --pdb -e --env -D --env-dir -E --no-env --use-env-repo -k --insecure -l --enable-locks -L --disable-locks -m --mock -p --profile --sorted-profile --lines -v --verbose --stacktrace -V --version --print-shell-vars"
|
||||||
else
|
else
|
||||||
SPACK_COMPREPLY="activate add arch blame bootstrap build build-env buildcache cd checksum ci clean clone commands compiler compilers concretize config configure containerize create deactivate debug dependencies dependents deprecate dev-build diy docs edit env extensions external fetch find flake8 gc gpg graph help info install license list load location log-parse maintainers mirror module patch pkg providers pydoc python reindex remove rm repo resource restage setup spec stage test uninstall unload upload-s3 url verify versions view"
|
SPACK_COMPREPLY="activate add arch blame build build-env buildcache cd checksum ci clean clone commands compiler compilers concretize config configure containerize create deactivate debug dependencies dependents deprecate dev-build diy docs edit env extensions external fetch find flake8 gc gpg graph help info install license list load location log-parse maintainers mirror module patch pkg providers pydoc python reindex remove rm repo resource restage setup spec stage test uninstall unload upload-s3 url verify versions view"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -348,10 +348,6 @@ _spack_blame() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
_spack_bootstrap() {
|
|
||||||
SPACK_COMPREPLY="-h --help -j --jobs --keep-prefix --keep-stage -n --no-checksum -v --verbose --use-cache --no-cache --cache-only --clean --dirty"
|
|
||||||
}
|
|
||||||
|
|
||||||
_spack_build() {
|
_spack_build() {
|
||||||
if $list_options
|
if $list_options
|
||||||
then
|
then
|
||||||
|
Loading…
Reference in New Issue
Block a user