summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGreg Becker <becker33@llnl.gov>2020-11-05 09:59:44 -0800
committerGitHub <noreply@github.com>2020-11-05 18:59:44 +0100
commit8b96e10ecc6052c53e5296a56947b9072693acff (patch)
treef368ee711a9b237d63d38c08072eb9b18ca054a4 /lib
parentdcd514c3215d4760e154b194cfe9f187720e5476 (diff)
downloadspack-8b96e10ecc6052c53e5296a56947b9072693acff.tar.gz
spack-8b96e10ecc6052c53e5296a56947b9072693acff.tar.bz2
spack-8b96e10ecc6052c53e5296a56947b9072693acff.tar.xz
spack-8b96e10ecc6052c53e5296a56947b9072693acff.zip
Remove hardcoded version numbers from container logic (#19716)
Previously, we hardcoded a list of Spack versions which could be used by the containerize command. This PR removes that list. It's a maintenance burden when cutting a release, and prevents older versions of Spack from creating containers to be used by newer versions.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/docs/developer_guide.rst14
-rw-r--r--lib/spack/spack/container/images.json48
-rw-r--r--lib/spack/spack/container/images.py3
-rw-r--r--lib/spack/spack/schema/container.py8
-rw-r--r--lib/spack/spack/test/container/images.py8
5 files changed, 7 insertions, 74 deletions
diff --git a/lib/spack/docs/developer_guide.rst b/lib/spack/docs/developer_guide.rst
index 1341a196b4..7fd4d1ec6e 100644
--- a/lib/spack/docs/developer_guide.rst
+++ b/lib/spack/docs/developer_guide.rst
@@ -620,13 +620,6 @@ for a major release, the steps to make the release are as follows:
#. Bump the version in ``lib/spack/spack/__init__.py``. See `this example from 0.13.0
<https://github.com/spack/spack/commit/8eeb64096c98b8a43d1c587f13ece743c864fba9>`_
-#. Update the release version lists in these files to include the new version:
-
- * ``lib/spack/spack/schema/container.py``
- * ``lib/spack/spack/container/images.json``
-
-.. TODO: We should get rid of this step in some future release.
-
#. Update ``CHANGELOG.md`` with major highlights in bullet form. Use
proper markdown formatting, like `this example from 0.15.0
<https://github.com/spack/spack/commit/d4bf70d9882fcfe88507e9cb444331d7dd7ba71c>`_.
@@ -721,13 +714,6 @@ release:
#. Bump the version in ``lib/spack/spack/__init__.py``. See `this example from 0.14.1
<https://github.com/spack/spack/commit/ff0abb9838121522321df2a054d18e54b566b44a>`_.
-#. Updaate the release version lists in these files to include the new version:
-
- * ``lib/spack/spack/schema/container.py``
- * ``lib/spack/spack/container/images.json``
-
- **TODO**: We should get rid of this step in some future release.
-
#. Update ``CHANGELOG.md`` with a list of bugfixes. This is typically just a
summary of the commits you cherry-picked onto the release branch. See
`the changelog from 0.14.1
diff --git a/lib/spack/spack/container/images.json b/lib/spack/spack/container/images.json
index b08cbc90a4..efaedc68b8 100644
--- a/lib/spack/spack/container/images.json
+++ b/lib/spack/spack/container/images.json
@@ -6,17 +6,7 @@
"environment": [],
"build": "spack/ubuntu-bionic",
"build_tags": {
- "develop": "latest",
- "0.14": "0.14",
- "0.14.0": "0.14.0",
- "0.14.1": "0.14.1",
- "0.14.2": "0.14.2",
- "0.15": "0.15",
- "0.15.0": "0.15.0",
- "0.15.1": "0.15.1",
- "0.15.2": "0.15.2",
- "0.15.3": "0.15.3",
- "0.15.4": "0.15.4"
+ "develop": "latest"
}
},
"ubuntu:16.04": {
@@ -26,17 +16,7 @@
"environment": [],
"build": "spack/ubuntu-xenial",
"build_tags": {
- "develop": "latest",
- "0.14": "0.14",
- "0.14.0": "0.14.0",
- "0.14.1": "0.14.1",
- "0.14.2": "0.14.2",
- "0.15": "0.15",
- "0.15.0": "0.15.0",
- "0.15.1": "0.15.1",
- "0.15.2": "0.15.2",
- "0.15.3": "0.15.3",
- "0.15.4": "0.15.4"
+ "develop": "latest"
}
},
"centos:7": {
@@ -46,17 +26,7 @@
"environment": [],
"build": "spack/centos7",
"build_tags": {
- "develop": "latest",
- "0.14": "0.14",
- "0.14.0": "0.14.0",
- "0.14.1": "0.14.1",
- "0.14.2": "0.14.2",
- "0.15": "0.15",
- "0.15.0": "0.15.0",
- "0.15.1": "0.15.1",
- "0.15.2": "0.15.2",
- "0.15.3": "0.15.3",
- "0.15.4": "0.15.4"
+ "develop": "latest"
}
},
"centos:6": {
@@ -66,17 +36,7 @@
"environment": [],
"build": "spack/centos6",
"build_tags": {
- "develop": "latest",
- "0.14": "0.14",
- "0.14.0": "0.14.0",
- "0.14.1": "0.14.1",
- "0.14.2": "0.14.2",
- "0.15": "0.15",
- "0.15.0": "0.15.0",
- "0.15.1": "0.15.1",
- "0.15.2": "0.15.2",
- "0.15.3": "0.15.3",
- "0.15.4": "0.15.4"
+ "develop": "latest"
}
}
}
diff --git a/lib/spack/spack/container/images.py b/lib/spack/spack/container/images.py
index 421fc24425..f702781d32 100644
--- a/lib/spack/spack/container/images.py
+++ b/lib/spack/spack/container/images.py
@@ -43,7 +43,8 @@ def build_info(image, spack_version):
# Try to check if we have a tag for this Spack version
try:
- build_tag = image_data['build_tags'][spack_version]
+ # Translate version from git to docker if necessary
+ build_tag = image_data['build_tags'].get(spack_version, spack_version)
except KeyError:
msg = ('the image "{0}" has no tag for Spack version "{1}" '
'[valid versions are {2}]')
diff --git a/lib/spack/spack/schema/container.py b/lib/spack/spack/schema/container.py
index 83e04788a0..d534afee08 100644
--- a/lib/spack/spack/schema/container.py
+++ b/lib/spack/spack/schema/container.py
@@ -29,13 +29,7 @@ container_schema = {
},
'spack': {
'type': 'string',
- 'enum': [
- 'develop',
- '0.14', '0.14.0', '0.14.1', '0.14.2',
- '0.15', '0.15.0', '0.15.1', '0.15.2',
- '0.15.3', '0.15.4',
- ]
- }
+ },
},
'required': ['image', 'spack']
},
diff --git a/lib/spack/spack/test/container/images.py b/lib/spack/spack/test/container/images.py
index 808676c39a..6af69e0c83 100644
--- a/lib/spack/spack/test/container/images.py
+++ b/lib/spack/spack/test/container/images.py
@@ -18,14 +18,6 @@ def test_build_info(image, spack_version, expected):
assert output == expected
-@pytest.mark.parametrize('image,spack_version', [
- ('ubuntu:18.04', 'doesnotexist')
-])
-def test_build_info_error(image, spack_version):
- with pytest.raises(ValueError, match=r"has no tag for"):
- spack.container.images.build_info(image, spack_version)
-
-
@pytest.mark.parametrize('image', [
'ubuntu:18.04'
])