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.
This commit is contained in:
parent
dcd514c321
commit
8b96e10ecc
@ -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
|
||||
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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}]')
|
||||
|
@ -29,13 +29,7 @@
|
||||
},
|
||||
'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']
|
||||
},
|
||||
|
@ -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'
|
||||
])
|
||||
|
Loading…
Reference in New Issue
Block a user