Commit 411b2ad4 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

Merge branch 'mnt/new-cuda-versions' into 'master'

New CUDA versions

See merge request fsl/fsl-ci-rules!84
parents 7f61d4ef dc5c4a62
......@@ -48,6 +48,8 @@ variables:
FSL_CI_IMAGE_LINUX_64_CUDA_9_2: fsldevelopment/fsl-linux-64-cuda-9.2
FSL_CI_IMAGE_LINUX_64_CUDA_10_2: fsldevelopment/fsl-linux-64-cuda-10.2
FSL_CI_IMAGE_LINUX_64_CUDA_11_0: fsldevelopment/fsl-linux-64-cuda-11.0
FSL_CI_IMAGE_LINUX_64_CUDA_11_1: fsldevelopment/fsl-linux-64-cuda-11.1
FSL_CI_IMAGE_LINUX_64_CUDA_11_3: fsldevelopment/fsl-linux-64-cuda-11.3
# The following variables are assumed to be set via the gitlab
# web interface on all FSL project and recipe repositories:
......
......@@ -325,9 +325,12 @@ platform names are:
- `linux-64`
- `macos-64`
- `noarch`
- `linux-64-cuda` (skips all CUDA builds)
- `linux-64-cuda-9.2`
- `linux-64-cuda-10.2`
- `linux-64-cuda-11.0`
- `linux-64-cuda-11.1`
- `linux-64-cuda-11.3`
## Configuration
......@@ -572,10 +575,28 @@ to control / customise the behaviour of the FSL CI rules.
| `CI_RULES_BRANCH` | Both | No | Install CI rules from a branch other than `master`. |
Valid values for the `FSLCONDA_SKIP_PLATFORM` variable are:
- `linux-64`
- `macos-64`
- `noarch`
- `linux-64-cuda-9.2`
- `linux-64-cuda-10.2`
- `linux-64-cuda-11.0`
## Adding support for a new CUDA version
Just follow these simple steps:
1. Create a `Dockerfile` for the new CUDA version in the `docker`
sub-directory.
2. Add a `build-docker-image-linux-64-cuda-X.Y` job to the
`rules/fsl-ci-management-rules.yml` file.
3. Add a `build-linux-64-cuda-X.Y-conda-package` job to the
`rules/fsl-ci-build-rules.yml` file.
4. Add a `deploy-linux-64-cuda-X.Y-conda-package` job to the
`rules/fsl-ci-deploy-rules.yml` file.
5. Update the `$FSLCONDA_SKIP_PLATFORM` clause in the
`.fsl-ci-conda-build-job-base` job template in the
`rules/fsl-ci-build-rules.yml` file.
6. Update the `$FSLCONDA_SKIP_PLATFORM` clause in the `.deploy-conda-package`
job template in the `rules/fsl-ci-deploy-rules.yml` file.
7. Update the `CUDA_VERSIONS` list in `fsl_ci/platform.py`.
8. Update the `cuda` list in the `fsl-release.yml` file, used to
generate FSL release manifests, in the fsl/conda/manifest> project.
9. Update the `test-environment:linux-64_cudaX.Y` and
`test-manifest:linux-64_cudaX.Y` jobs in the `manifest-gitlab-ci.yml` file,
in the fsl/conda/manifest-rules> project.
# This image is used for linux-64/cuda 11.3
# builds of FSL packages.
FROM nvidia/cuda:11.3-devel-centos7
LABEL maintainer: "FSL development team <https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/>"
ENV PATH "/opt/conda/bin:${PATH}"
ENV CUDA_VER 11.3
ENV CUDA_HOME /usr/local/cuda
COPY /install_system_deps.sh /install_system_deps.sh
COPY /install_miniconda.sh /install_miniconda.sh
COPY /entrypoint /fsl-ci-rules-entrypoint
COPY /environment.yml /fsl-ci-rules-environment.yml
RUN localedef -i en_GB -f UTF-8 C.UTF-8
RUN /bin/bash /install_system_deps.sh
RUN /bin/bash /install_miniconda.sh
ENTRYPOINT [ "/opt/conda/bin/tini", "--", "/fsl-ci-rules-entrypoint" ]
CMD [ "/bin/bash" ]
\ No newline at end of file
......@@ -19,7 +19,7 @@ import subprocess as sp
import yaml
__version__ = '0.15.3'
__version__ = '0.16.0'
"""Current version of the fsl-ci-rules."""
......
......@@ -15,7 +15,7 @@ from typing import List
# Note: These lists must be updated whenever new
# platforms / CUDA versions become supported.
COMPILATION_TARGETS = ['linux-64', 'macos-64']
CUDA_VERSIONS = ['9.2', '10.2', '11.0']
CUDA_VERSIONS = ['9.2', '10.2', '11.0', '11.1', '11.3']
def get_platform(meta : dict) -> str:
......@@ -109,10 +109,10 @@ def get_skip_platform(meta : dict) -> str:
"""Generates a value for the FSLCONDA_SKIP_PLATFORM variable. """
pkgtype = get_platform(meta)
binaries = ' '.join(COMPILATION_TARGETS)
cudas = ' '.join([f'linux-64-cuda-{ver}' for ver in CUDA_VERSIONS])
cuda = 'linux-64-cuda'
if pkgtype == 'noarch': return ' '.join((binaries, cudas))
elif pkgtype == 'binary': return ' '.join(('noarch', cudas))
if pkgtype == 'noarch': return ' '.join((binaries, cuda))
elif pkgtype == 'binary': return ' '.join(('noarch', cuda))
elif pkgtype == 'cuda': return ' '.join(('noarch', binaries))
raise ValueError(f'Unknown platform {pkgtype}')
......
......@@ -5,6 +5,8 @@
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
#
from unittest import mock
import pytest
import fsl_ci.platform as platform
......@@ -98,13 +100,9 @@ def test_get_skip_platform():
tests = [
(noarch_meta, ('linux-64 '
'macos-64 '
'linux-64-cuda-9.2 '
'linux-64-cuda-10.2 '
'linux-64-cuda-11.0')),
'linux-64-cuda')),
(binary_meta, ('noarch '
'linux-64-cuda-9.2 '
'linux-64-cuda-10.2 '
'linux-64-cuda-11.0')),
'linux-64-cuda')),
(cuda_meta, ('noarch '
'linux-64 '
'macos-64'))
......@@ -126,7 +124,11 @@ def test_get_platform_ids():
(binary_meta, ['linux-64', 'macos-64']),
(cuda_meta, ['linux-64-cuda-9.2',
'linux-64-cuda-10.2',
'linux-64-cuda-11.0'])]
for input, expected in tests:
assert platform.get_platform_ids(input) == expected
'linux-64-cuda-11.0',
'linux-64-cuda-11.1',
'linux-64-cuda-11.3'])]
with mock.patch('fsl_ci.platform.CUDA_VERSIONS',
['9.2', '10.2', '11.0', '11.1', '11.3']):
for input, expected in tests:
assert platform.get_platform_ids(input) == expected
......@@ -182,12 +182,18 @@ update-conda-recipe:
$FSLCONDA_SKIP_PLATFORM =~ /(^| )linux-64($| )/) ||
($CI_JOB_NAME == "build-macos-64-conda-package" &&
$FSLCONDA_SKIP_PLATFORM =~ /(^| )macos-64($| )/) ||
($CI_JOB_NAME =~ /^build-linux-64-cuda-.*-conda-package$/ &&
$FSLCONDA_SKIP_PLATFORM =~ /(^| )linux-64-cuda($| )/) ||
($CI_JOB_NAME == "build-linux-64-cuda-9.2-conda-package" &&
$FSLCONDA_SKIP_PLATFORM =~ /(^| )linux-64-cuda-9.2($| )/) ||
($CI_JOB_NAME == "build-linux-64-cuda-10.2-conda-package" &&
$FSLCONDA_SKIP_PLATFORM =~ /(^| )linux-64-cuda-10.2($| )/) ||
($CI_JOB_NAME == "build-linux-64-cuda-11.0-conda-package" &&
$FSLCONDA_SKIP_PLATFORM =~ /(^| )linux-64-cuda-11.0($| )/)'
$FSLCONDA_SKIP_PLATFORM =~ /(^| )linux-64-cuda-11.0($| )/) ||
($CI_JOB_NAME == "build-linux-64-cuda-11.1-conda-package" &&
$FSLCONDA_SKIP_PLATFORM =~ /(^| )linux-64-cuda-11.1($| )/) ||
($CI_JOB_NAME == "build-linux-64-cuda-11.3-conda-package" &&
$FSLCONDA_SKIP_PLATFORM =~ /(^| )linux-64-cuda-11.3($| )/)'
when: never
# This job is only run on branches
......@@ -278,3 +284,19 @@ build-linux-64-cuda-11.0-conda-package:
tags:
- fsl-ci
- docker
build-linux-64-cuda-11.1-conda-package:
image: $FSL_CI_IMAGE_LINUX_64_CUDA_11_1
extends: .fsl-ci-conda-build-job
tags:
- fsl-ci
- docker
build-linux-64-cuda-11.3-conda-package:
image: $FSL_CI_IMAGE_LINUX_64_CUDA_11_3
extends: .fsl-ci-conda-build-job
tags:
- fsl-ci
- docker
......@@ -37,12 +37,18 @@
$FSLCONDA_SKIP_PLATFORM =~ /(^| )linux-64($| )/) ||
($CI_JOB_NAME == "deploy-macos-64-conda-package" &&
$FSLCONDA_SKIP_PLATFORM =~ /(^| )macos-64($| )/) ||
($CI_JOB_NAME =~ /^deploy-linux-64-cuda-.*-conda-package$/ &&
$FSLCONDA_SKIP_PLATFORM =~ /(^| )linux-64-cuda($| )/) ||
($CI_JOB_NAME == "deploy-linux-64-cuda-9.2-conda-package" &&
$FSLCONDA_SKIP_PLATFORM =~ /(^| )linux-64-cuda-9.2($| )/) ||
($CI_JOB_NAME == "deploy-linux-64-cuda-10.2-conda-package" &&
$FSLCONDA_SKIP_PLATFORM =~ /(^| )linux-64-cuda-10.2($| )/) ||
($CI_JOB_NAME == "deploy-linux-64-cuda-11.0-conda-package" &&
$FSLCONDA_SKIP_PLATFORM =~ /(^| )linux-64-cuda-11.0($| )/)'
$FSLCONDA_SKIP_PLATFORM =~ /(^| )linux-64-cuda-11.0($| )/) ||
($CI_JOB_NAME == "deploy-linux-64-cuda-11.1-conda-package" &&
$FSLCONDA_SKIP_PLATFORM =~ /(^| )linux-64-cuda-11.1($| )/) ||
($CI_JOB_NAME == "deploy-linux-64-cuda-11.3-conda-package" &&
$FSLCONDA_SKIP_PLATFORM =~ /(^| )linux-64-cuda-11.3($| )/)'
when: never
# This job is only run on master branch of recipe
......@@ -94,6 +100,17 @@ deploy-linux-64-cuda-11.0-conda-package:
- build-linux-64-cuda-11.0-conda-package
deploy-linux-64-cuda-11.1-conda-package:
extends: .deploy-conda-package
dependencies:
- build-linux-64-cuda-11.1-conda-package
deploy-linux-64-cuda-11.3-conda-package:
extends: .deploy-conda-package
dependencies:
- build-linux-64-cuda-11.3-conda-package
# Open a MR on the fsl/conda/manifest repository
# to update the project version number in the FSL
......
......@@ -119,6 +119,11 @@ build-docker-image-linux-64-cuda-11.1:
variables:
BUILDDIR: docker/linux-64-cuda-11.1
build-docker-image-linux-64-cuda-11.3:
extends: .build-docker-image
variables:
BUILDDIR: docker/linux-64-cuda-11.3
# This job can be manually invoked to purge
# and re-generate the conda channel indexes,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment