Commit graph

180 commits

Author SHA1 Message Date
Matthias Wolf
7fcf534b25 junit: escape remaining inputs. (#11382) 2019-05-16 14:40:07 +02:00
Todd Gamblin
dda90a5666 bugfix: Do not run spack spec in the test environment for Python 2.6
- Trying to get our Python 2.6 tests working again.
- This seems to crash travis in the 2.6 environment, for whatever reason.
2019-05-10 13:13:44 -07:00
Todd Gamblin
3903658bfc coverage: only run coverage for subset of unit tests
- Codecov cannot handle as many coverage reports as we are generating

- as a result, our PR coverage pages have been broken for a while, and
  it's hard to tell people where to enhance their testing in PR reviews.

- Scale back to only running coverage for 3.7 and 2.7 unit tests

- This is *probably* better.  We run the build tests for good measure,
  but we do not need to evaluate them for coverage.  The coverage reports
  are about unit tests.
2019-05-11 02:23:22 +09:00
Massimiliano Culpo
5ffb270714 Added a function that concretizes specs together (#11158)
* Added a function that concretizes specs together

* Specs concretized together are copied instead of being referenced

This makes the specs different objects and removes any reference to the
fake root package that is needed currently for concretization.

* Factored creating a repository for concretization into its own function

* Added a test on overlapping dependencies
2019-05-04 03:04:38 +09:00
Omar Padron
0bbd41c7f7
install spack under /opt/spack in docker images (#10969)
* install spack under /opt/spack
2019-05-02 12:05:42 -04:00
Toyohisa Kameyama
ac7f9ef93d Fix handling of MODULEPATH in setup-env.sh (#11274)
Usage of double quotes was preventing word-splitting when parsing
module roots in setup-env.sh, which lead to an error when multiple
module roots are used (in particular when Spack is pointed to use
an upstream module root in addition to its own).
2019-04-24 11:53:25 +09:00
paulanda
88cc895a70 setup-env.sh: fix zsh compatibility error (#11153)
Still look for BASH_SOURCE[0] first, but if it's not set,
_sp_source_file is initialized to an empty value addressing the
unset parameter error (line 217).
2019-04-16 12:33:02 -07:00
Peter Scheibel
99f35c3338 spack chain (#8772)
* initial work to make use of an 'upstream' spack installation: this uses the DB of the upstream installation to check if a package is installed

* need to query upstream dbs when adding new record to local db

* prevent reindexing upstream DBs

* set prefix on specs read from DB based on path stored in install record

* check that Spack does not install packages that are recorded as installed in an upstream db

* externals do not add their path to install records - need to use 'external_path' to get path of upstream externals

* views need to check for upstream installations when linking metadata

* package and spec now calculate upstream installation properties on-demand themselves rather than depending on concretization to set these properties up-front. The added tests for upstream installations don't work with this new strategy so they need to be updated

* only refresh modules for local specs (not those in upstream packages); optionally generate local module files for packages installed upstream

* when a user tries to locate a module file for a package installed upstream, tell them to use the upstream spack instance to locate it

* support recursive upstream databases (allow upstream databases to use their own upstream databases)

* separate upstream config into separate file with its own schema; each entry now also includes a name

* metadata_dir is no longer customizable on a per-instance basis for YamlDirectoryLayout

* treat metadata_dir as an instance variable but dont set it from kwargs; this follows several other hardcoded variables which must be consistent between upstream and downstream DBs. Also update DirectoryLayout.metadata_path to work entirely with Spec.prefix, since Spec.prefix is set from the DB when available (so metadata_path was duplicating that logic)
2019-03-27 13:06:46 -07:00
Omar Padron
57523c3f0b explicitly install unzip in all docker images (#10891) 2019-03-25 20:10:42 -05:00
Michael Kuhn
617c1a3706 Fix shell integration with environment-modules@4 (#10736) 2019-02-28 13:22:44 +01:00
Scott Wittenburg
a6e8e889b2 release workflow: Add spack command for generating the .gitlab-ci.yml
This spack command adds a new schema for a file which describes the
builder containers available, along with the compilers availabe on
each builder.  The release-jobs command then generates the .gitlab-ci.yml
file by first expanding the release spec set, concretizing each spec
(in an appropriate docker container if --this-machine-only argument is
not provided on command line), and then combining and staging all the
concrete specs as jobs to be run by gitlab.
2019-02-21 15:37:35 -06:00
Scott Wittenburg
05cdb5a0bb docker: Add Dockerfiles for images needed by AWS gitlab-runners
The built images are set up with fairly recent versions of gcc and
clang:

  - centos_7:     [ gcc@5.5.0 (built from src), clang@6.0.0 (spack-built from src) ]
  - ubuntu_18.04: [ gcc@5.5.0 (system), clang@6.0.0-1ubuntu2 (system) ]
2019-02-21 15:37:35 -06:00
Scott Wittenburg
fce1c4133f buildcache: Add sub-commands needed by release workflow
Adds four new sub-commands to the buildcache command:

1. save-yaml: Takes a root spec and a list of dependent spec names,
along with a directory in which to save yaml files, and writes out
the full spec.yaml for each of the dependent specs.  This only needs
to concretize the root spec once, then indexes it with the names of
the dependent specs.

2. check: Checks a spec (via either an abstract spec or via a full
spec.yaml) against remote mirror to see if it needs to be rebuilt.
Comparies full_hash stored on remote mirror with full_hash computed
locally to determine whether spec needs to be rebuilt.  Can also
generate list of specs to check against remote mirror by expanding
the set of release specs expressed in etc/spack/defaults/release.yaml.

3. get-buildcache-name: Makes it possible to attempt to read directly
the spec.yaml file on a remote or local mirror by providing the path
where the file should live based on concretizing the spec.

4. download: Downloads all buildcache files associated with a spec
on a remote mirror, including any .spack, .spec, and .cdashid files
that might exist.  Puts the files into the local path provided on
the command line, and organizes them in the same hierarchy found on
the remote mirror

This commit also refactors lib/spack/spack/util/web.py to expose
functionality allowing other modules to read data from a url.
2019-02-21 15:37:35 -06:00
Omar Padron
67415a1875 [Docker] more base images (#10560)
* Revert "work around an issue with docker/dockerhub (#10547)"

This reverts commit 0ef139ac4d.

* Add more docker base image configurations.

 - Renamed configs

   - "centos" -> "centos-7"
   - "fedora" -> "fedora-24"
   - "opensuse" -> "opensuse-tumbleweed"
   - "scilinux" -> "scilinux-7"
   - "ubuntu" -> "ubuntu-1804"

 - Added configs

   - "centos-6"
   - "fedora-29"
   - "opensuse-leap"
   - "scilinux-6"
   - "ubuntu-1604"

With these changes, our docker hub image
collection will consist of the following:

 - "spack/archlinux"
   - "latest"
 - "spack/centos"
   - "latest", "centos7", "7"
   - "centos6", "6"
 - "spack/fedora"
   - "latest", "29"
   - "24"
 - "spack/opensuse"
   - "latest", "tumbleweed"
   - "leap"
 - "spack/scilinux"
   - "latest", "7"
   - "6"
 - "spack/ubuntu"
   - "latest", "bionic", "18.04"
   - "xenial", "16.04"
2019-02-16 10:20:25 -05:00
Phil Carns
6971f8ae32 make SPACK_SHELL detection more robust (#9712)
Spack shell detection in setup-env.sh was originally based on
examining the executable name of $$ (from "ps"). In some cases this
does not actually give the name of the shell used, for example when
setup-env.sh was invoked from a script using "#!". To make shell
detection more robust, this adds a preliminary check for shell
variables which indicate that the shell is bash or zsh; the
executable name of $$ is retained as a fallback if those variables
are not defined.
2019-02-13 19:52:18 -06:00
Omar Padron
0ef139ac4d work around an issue with docker/dockerhub (#10547)
* try to workaround an issue with docker/dockerhub
* apply workaround only when running in travis
2019-02-08 16:39:40 -08:00
Omar Padron
7d64994cbd fix issue where docker images were being pushed without login (#10379) 2019-01-24 10:08:38 -08:00
Omar Padron
8e71ba8aa0 fix typo in docker test script (#10334) 2019-01-12 17:30:35 -08:00
Omar Padron
c2529358f2 fix archlinux docker build (#10289) 2019-01-12 00:52:50 -08:00
Adam J. Stewart
72a41a4918 spack versions: only list safe versions (#10004)
* spack versions: only list safe versions
* Add unit tests for spack versions -s
2019-01-10 00:32:47 -08:00
Todd Gamblin
6f50cd52ed copyright: update license headers for 2013-2019 copyright. 2019-01-01 00:44:28 -08:00
Todd Gamblin
d763e92141 commands: add spack resource command to inspect downloadable files
- currently just looks at patches
  - allows you to find out which package applied a patch to a spec

- intended to work with tarballs and resources in the future.

- add tab completion for `spack resource` and subcommands
2018-12-30 00:19:08 -08:00
Todd Gamblin
19b7b15929 coverage: use kcov to get coverage for our cc script 2018-12-29 23:47:29 -08:00
Omar Padron
60298787e4 Fix docker builds (#9805)
* move docker test logic to share/spack/qa
* update Dockerfile for archlinux
2018-12-20 11:17:46 -08:00
Omar Padron
56cb691fcc fix multiple issues with the docker images (#9718)
- fixed an issue where some undesirable parts of
   the spack source tree were being copied into
   the image context.

 - added a workaround for a tty ioctl warning on
   ubuntu

 - adjusted how the main images are built so that
   `RUN spack ...` works automatically for child
   images that base themselves on them.
2018-12-20 11:11:55 -08:00
Zack Galbreath
8d0872083c Report current git commit of Spack to CDash
When using the CDash reporter, upload a Update.xml file that
indicates the hash of Spack's current git commit.
2018-12-20 09:23:08 -08:00
Zack Galbreath
738d2bd77a Allow more customization for CDash reporter
Add new command line arguments to `spack install` that allow users
to set the build name, site name, and track in their CDash report.
2018-12-20 09:23:08 -08:00
Adam J. Stewart
29f26da04d
Update Spack's Bash completion script (#10114)
* Update Spack's Bash completion script

* spack mirror create options changed
2018-12-17 13:02:09 -06:00
Matthias Diener
9f528ccba0 env setup: support --help for cd/env commands (#10069) 2018-12-15 17:47:05 -08:00
Christoph Junghans
71a86bb840 .travis.yml: enable ccache (#6370) 2018-12-15 10:52:31 +01:00
Massimiliano Culpo
488e513e84 Turn on verbose output for MPICH builds in Travis (#10105)
Lately many CI runs for PRs are failing due to the `mpich` build that
times out on Travis (10 mins. without output). As the timeout seems to
happen consistently during the build phase, increasing the verbosity of
that test can help working around the issue.
2018-12-14 08:43:04 -08:00
Matthias Wolf
e3aa36f4cb fix: adapt junit template to escape std{out,err} (#9935) 2018-12-04 14:05:45 +01:00
Todd Gamblin
a1818f971f env: environments can be named or created in directories
- `spack env create <name>` works as before

- `spack env create <path>` now works as well -- environments can be
  created in their own directories outside of Spack.

- `spack install` will look for a `spack.yaml` file in the current
  directory, and will install the entire project from the environment

- The Environment class has been refactored so that it does not depend on
  the internal Spack environment root; it just takes a path and operates
  on an environment in that path (so internal and external envs are
  handled the same)

- The named environment interface has been hoisted to the
  spack.environment module level.

- env.yaml is now spack.yaml in all places.  It was easier to go with one
  name for these files than to try to handle logic for both env.yaml and
  spack.yaml.
2018-11-09 00:31:24 -08:00
Todd Gamblin
d14f7b82bb env: add spack env activate/deactivate and shell support
- `spack env activate foo`: sets SPACK_ENV to the current active env name

- `spack env deactivate`: unsets SPACK_ENV, deactivates the environment

- added support to setup_env.sh and setup_env.csh

- other env commands work properly with SPACK_ENV, as with an environment
  arguments.

- command-line --env arguments take precedence over the active
  environment, if given.
2018-11-09 00:31:24 -08:00
Bert Wesarg
c43689deb0 setup-env: Avoid different output format of ps (#9629)
setup-env includes a call to 'ps' to determine what shell is being
used. 'ps' can be instructed to use a different default output format
via the 'PS_FORMAT' env variable. Thus unset this variable before
calling 'ps'.
2018-10-29 11:16:55 -07:00
Omar Padron
aa1c814c75 docker: unite Dockerfiles; auto-deploy images to DockerHub (#9329)
* Unite Dockerfiles - add build/run/push scripts
* update docker documentation
* update .travis.yml
* switch to using a preprocessor on Dockerfiles
* skip building docker images on pull requests
* update files with copyright info
* tweak when travis builds for docker files are done
2018-10-26 10:15:05 -07:00
Todd Gamblin
e2e0b5df1c relicense: add spack license command
- `spack license list-files`: list all files that should have license headers
- `spack license list-lgpl`:  list files still under LGPL-2.1
- `spack license verify`:     check that license headers are correct

- Added `spack license verify` to style tests
2018-10-17 14:42:06 -07:00
Todd Gamblin
eea786f4e8 relicense: replace LGPL headers with Apache-2.0/MIT SPDX headers
- remove the old LGPL license headers from all files in Spack
- add SPDX headers to all files
  - core and most packages are (Apache-2.0 OR MIT)
  - a very small number of remaining packages are LGPL-2.1-only
2018-10-17 14:42:06 -07:00
Todd Gamblin
5aa05b8ef4
travis: require sudo in an attempt to avoid build timeouts (#9327)
- Many container builds are timing out frequently during Spack tests in
  Travis CI.

- Travis recommends to try `sudo: required` to see whether this is an
  infrastructure issue or something else.

- added `sudo: required` to all Linux builds.

- added --verbose to `spack test` invocation so that we can see more
  easily what tests it's timing out on.

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2018-09-24 14:55:36 -07:00
Matthias Diener
a1e08f009d Csh: fix load/use commands (#8971) 2018-08-14 09:28:43 +02:00
Micheal Quinn
203bd555a4 Fixing the addition curly brackets to conform to the rest of the templates usage of a literal curly bracket 2018-08-07 19:56:11 +02:00
Micheal Quinn
d163be6a13 Adding logic to the autoload if statement so it only fire if the module is being loaded. 2018-08-07 19:56:11 +02:00
Adam J. Stewart
7e0bd152b7 Generate coverage reports for all unit and build tests 2018-08-04 21:18:49 -07:00
Adam J. Stewart
4de301ebf2 Update bash completion with new spack arch flags 2018-08-03 11:32:08 -05:00
Stephen Herbein
de60e9d582 lmod: fix use of custom separator in prepend_path etc. (#8737)
fixes #8736
2018-08-01 12:58:54 +02:00
Michael Kuhn
53ddefa0df Fix shift warning on zsh (#8805)
When using zsh, trying to shift when there are no arguments left results
in warnings like this: spack:shift:22: shift count must be <= $#
2018-07-27 08:14:01 -05:00
Massimiliano Culpo
5b8b7a5873 The auto-completion file is now consistent with spack module 2018-07-24 11:27:17 -07:00
Massimiliano Culpo
35cef16974 Grouped all the module commands under spack module
As requested in the review all the commands meant to manage module
files have been grouped under the `spack module` command.

Unit tests have been refactored to match the new command structure.
2018-07-24 11:27:17 -07:00
Massimiliano Culpo
7cbe1aedb7 module file tutorial: rebuilt docker image and updated the script 2018-07-24 11:27:17 -07:00
Massimiliano Culpo
443d702971 spack load exits with 1 if module does not exist or is not installed
fixes #2215
fixes #2570
fixes #6676
fixes #7281
closes #3827

This PR reverts the use of `spack module loads` in favor of
`spack module find` when loading module files via Spack. After this PR
`spack load` will accept a single spec at a time, and will be able
to interpret correctly the `--dependencies` option.
2018-07-24 11:27:17 -07:00