Commit graph

217 commits

Author SHA1 Message Date
Massimiliano Culpo
9ceec7e219 Harden shell detection when procfs is available (#13950) 2019-12-16 14:51:58 -08:00
Massimiliano Culpo
f80491826b
Travis exits at the first failing test, pin codecov at v4.5.4 (#14179)
Before this commit we used to run the entire unit test suite
in the presence of a failure. Since we currently rely a lot
on the state of the filesystem etc. the end report was most
of the time showing spurious failures that were a consequence
of the first failing test.

This PR makes unit tests exit at the first failing test

Also, pin codecov at v4.5.4 (last one supporting Python 2.6)
2019-12-16 10:56:54 +01:00
Scott Wittenburg
2520806df2 docker: add file, adjust locale, and use python3 for ubuntu (#13508)
* docker: add missing module to ubuntu images
* docker: fix issue with missing locale
* docker: one package per line + rm python2 support
* docker: ubuntu image also needs 'file' for buildcache creation
2019-12-13 10:22:20 -08:00
Zack Galbreath
0f5724e908 Split out CDash options to a separate help document (#13704)
Prevent `spack help install` from getting too cluttered with CDash-specific documentation.
2019-12-13 10:15:22 -08:00
Axel Huebl
7a81c37bde
Package Index: Build in Dockerhub (#13810)
* Package Index: Build in Dockerhub

Prepare to build the package index service, packages.spack.io,
on Dockerhub.

Local build (in spack root dir):
```
docker build -t spack/packages.spack.io:latest -f share/spack/docker/package-index/Dockerfile .
```

Local test:
```
docker run -p 8080:80 spack/packages.spack.io:latest
```

* Travis-CI: Remove Docker

Remove leftover docker stages from Travis-CI.

* Simplify Split Call
2019-11-26 10:11:29 -07:00
Greg Becker
6c55a7c85f
cmd/install: remove unused install_status option (#13751)
* cmd/install: remove unused install_status option

* update bash completions for spack install
2019-11-22 11:17:37 -07:00
Todd Gamblin
e0b94dba14
completion: add bash completion for spack spec --json (#13433) 2019-10-25 11:02:52 -07:00
Massimiliano Culpo
3d77ecd92e Bootstrap environment modules optimizing for generic architectures (#13105)
fixes #13073

Since #3206 was merged bootstrapping environment-modules was using the architecture of the current host or the best match supported by the default compiler. The former case is an issue since shell integration was looking for a spec targeted at the host microarchitecture.

1. Bootstrap an env modules targeted at generic architectures
2. Look for generic targets in shell integration scripts
3. Add a new entry in Travis to test shell integration
2019-10-21 11:20:05 -07:00
Massimiliano Culpo
d33b0ffc50 lmod: module files are written in a root folder named by target family (#13121)
fixes #13005

This commit fixes an issue with the name of the root directory for
module file hierarchies. Since #3206 the root folder was named after
the microarchitecture used for the spec, which is too specific and
not backward compatible for lmod hierarchies. Here we compute the
root folder name using the target family instead of the target name
itself and we add target information in the 'whatis' portion of the
module file.
2019-10-15 11:20:49 -07:00
Massimiliano Culpo
76b9c56110 Remove support for generating dotkit files (#11986)
Dotkit is being used only at a few sites and has been deprecated on new
machines. This commit removes all the code that provide support for the
generation of dotkit module files.

A new validator named "deprecatedProperties" has been added to the
jsonschema validators. It permits to prompt a warning message or exit
with an error if a property that has been marked as deprecated is
encountered.

* Removed references to dotkit in the docs
* Removed references to dotkit in setup-env-test.sh
* Added a unit test for the 'deprecatedProperties' schema validator
2019-10-02 22:15:01 -07:00
Massimiliano Culpo
1b18ec90ab Add all compatible system types directory to module paths
fixes #12915
closes #12916

Since Spack has support for specific targets it might happen that
software is built for targets that are not exactly the host because
it was either an explicit user request or the compiler being used is
too old to support the host.

Modules for different targets are written into different directories
and by default Spack was adding to MODULEPATH only the directory
corresponding to the current host. This PR modifies this behavior to
add all the directories that are **compatible** with the current host.
2019-10-01 19:18:27 -07:00
Glenn Johnson
5397606b34 Add --known-targets to bash completion for arch command (#12887)
This PR adds the new --known-targets flag to the `spack arch` command.
2019-09-20 20:09:44 +02:00
Scott Wittenburg
fabbb3d58a Refactor release-jobs cmd based on use of environments (no docker either) 2019-09-13 22:57:15 -07:00
Tyler Reddy
25dbc9fb8e BUG: recursively load modules with tcsh (#12664)
* for tcsh and csh, spack load -r package
should now correctly load recursively instead
of only loading the target package without any
dependencies
2019-09-12 11:11:27 -06:00
Axel Huebl
113365744e
packages service: fix docker build again (#12774)
CD is hard.
2019-09-09 18:24:16 -07:00
Axel Huebl
0d270e0d2a
packages service: fix docker build (#12773)
The build instructions I cloned from did not work ;)
2019-09-09 16:41:04 -07:00
Axel Huebl
221acadc7d
packages build: fix path to spack (#12772)
Fix docker build for packages.spack.io
2019-09-09 14:52:36 -07:00
Axel Huebl
8ea358d849
Fix CD: Packages Service First (#12764)
* Fix CD: Packages Service First

Build the packages.spack.io service images first, so they are
guaranteed to be pushed even if further images fail to build.

Fix the query to the `spack` script executed in later builds.

* CD: Remove Spack Images

Now done on Dockerhub.
2019-09-09 13:22:47 -07:00
Axel Huebl
02931a82fd Add CORS for spack.packages.io
Add the HTTP header `Access-Control-Allow-Origin: *` for our NGINX
service that is serving static JSON content on
https://spack.packages.io .
2019-09-08 17:19:37 -07:00
Todd Gamblin
1b877e8e0f tests and completions for spack find --json and spack find --format 2019-09-02 19:24:48 -07:00
Todd Gamblin
b0abbfecb8 new command: spack maintainers queries package maintainers
- We don't currently make enough use of the maintainers field on
  packages, though we could use it to assign reviews.

- add a command that allows maintainers to be queried
  - can ask who is maintaining a package or packages
  - can ask what packages users are maintaining
  - can list all maintained or unmaintained packages

- add tests for the command
2019-07-24 14:10:08 -07:00
Omar Padron
1d5ab13be8 docker: fix builds, remove extra distros, add ci builds (#11621)
* fix docker builds/remove extra builds/add ci builds
* preinstall vim in CI builder images
* simplify & streamline docker resources
* restore os-container-mapping.yaml file
2019-07-20 14:46:06 -07:00
Todd Gamblin
993ee7f199 environments: add activate/deactivate tests, work wtih set -u
- [x] Add shell tests to ensure that `spack env activate`, `spack env
  deactivate`, and `despacktivate` continue to work.

- [x] Also ensure that activate and deactivate both work with `set -u`
2019-07-20 00:36:56 -07:00
Greg Becker
5cf8878185 feature: Allow developers to use Spack for partial builds (#12006)
Added new diy option.
2019-07-17 11:46:56 -07:00
Todd Gamblin
3f47c5967d
bugfix: fix module() function in setup-env.sh (#12030)
Modify `setup-env.sh` to export fewer variables but to still set the module() function correctly.
2019-07-15 22:43:53 -07:00
Adam J. Stewart
41f5b09a98
Fix typo in module template (#12028) 2019-07-15 20:54:20 -05:00
Oliver Breitwieser
d1af7ae5ab Copy --{use,no}-cache from install to bootstrap (#11786) 2019-07-12 16:30:12 -07:00
Tamara Dahlgren
d615d0a1ec Add template creation test, --skip-editor option (#11970)
* Add template creation test
* Added --skip-editor option to "spack create": normally
  "spack create" opens an editor for the user after generating a
  package file; when the --skip-editor option is used, "spack create"
  only generates the package file and does not open an editor
* Added --skip-editor option to bash completion
2019-07-12 11:22:09 -07:00
Todd Gamblin
e8e030a518
bugfix: setup-env.sh detects bash even when bash is run as sh (#11994)
- `setup-env.sh` was not properly detecting a bash shell when bash was run
  as /bin/sh.

- Detection routine now always reports bash when bash is run as sh, and
  no longer parses the path to the executable indicated in `$BASH`.
2019-07-12 08:33:23 -07:00
Todd Gamblin
5686c2a544 setup-env.sh: make setup scripts work with set -u
- Add set -u to the setup-env.sh test script

- Refactor lines in setup-env.sh that tested potentially undefined
  variables to use the `[ -z ${var+x} ]` construct
2019-07-05 12:54:17 -07:00
Todd Gamblin
47e9f7aac9 tests: add tests for setup-env.sh
- tests use a shell-script harness and test all Spack commands that
  require special shell support.

- tests work in bash, zsh, and dash

- run setup-env.sh tests on macos and linux builds.
  - we run them on macos and linux
2019-07-05 12:54:17 -07:00
Todd Gamblin
e625ee3ffd setup-env.sh: now compatible with bash, zsh, and dash
- replace use of [[ with [

- replace function foo { .. } with foo() { .. }

- wrap some long lines

- add lsof and /proc/fd magic so that we can find the sourced file even in dash

- only do the complicated shell checks in one place; test $_sp_shell
  elsewhere.
2019-07-05 12:54:17 -07:00
Todd Gamblin
600f3c1104 setup-env.sh: send cd output to /dev/null when it affects Spack
- We've seen this a few times now where users have set up `cd` to echo
  the new directory, and it screws up `setup-env.sh`

- In the past we've said this is user error.

- Here, we just fix it by sending `cd` output to /dev/null where needed.
  - this works in bash, zsh, and dash
2019-06-29 19:01:44 -07:00
Axel Huebl
d4008db75d
CD: Package Index (#11665)
Build the docker image for the new package index REST API on each
merge/push to develop and master.
2019-06-10 18:21:33 +02:00
Todd Gamblin
20e5f81653
tests: restore spack spec mpileaks in test output for Python 2 (#11664)
- also remove coverage calls of these commands
- we JUST want coverage to tell us what is in the test suite.
2019-06-08 13:04:44 -07:00
Todd Gamblin
3bd854f991 travis: disable spack spec for python 2.7 as well as 2.6
- keep this disabled until the `compiler find` fork bomb is fixed.
2019-06-05 22:41:28 -07:00
Todd Gamblin
2a51e07fde
commands: completion for new --update and --header options (#11566) 2019-05-27 14:13:58 -07:00
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