diff options
author | Daniel Mensinger <daniel@mensinger-ka.de> | 2020-04-04 22:42:16 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2020-04-05 22:54:29 +0300 |
commit | c7326aa098ca3dcebde45d90d956cbfae03709fd (patch) | |
tree | 9c2072b096c07488b79df147c069f925e4b68e7e /ci | |
parent | 7896d945ff910ca90ab6a662256ecdcbc72623f5 (diff) | |
download | meson-c7326aa098ca3dcebde45d90d956cbfae03709fd.zip meson-c7326aa098ca3dcebde45d90d956cbfae03709fd.tar.gz meson-c7326aa098ca3dcebde45d90d956cbfae03709fd.tar.bz2 |
ci: Added cuda image (Arch Linux based)
Diffstat (limited to 'ci')
-rwxr-xr-x | ci/ciimage/build.py | 6 | ||||
-rw-r--r-- | ci/ciimage/cuda/image.json | 5 | ||||
-rwxr-xr-x | ci/ciimage/cuda/install.sh | 18 |
3 files changed, 28 insertions, 1 deletions
diff --git a/ci/ciimage/build.py b/ci/ciimage/build.py index 5e25e36..f57e8d7 100755 --- a/ci/ciimage/build.py +++ b/ci/ciimage/build.py @@ -26,6 +26,7 @@ class ImageDef: assert isinstance(data['env'], dict) self.base_image: str = data['base_image'] + self.args: T.List[str] = data.get('args', []) self.env: T.Dict[str, str] = data['env'] class BuilderBase(): @@ -64,6 +65,9 @@ class Builder(BuilderBase): out_file = self.temp_dir / 'env_vars.sh' out_data = '' + # run_tests.py parameters + self.image_def.env['CI_ARGS'] = ' '.join(self.image_def.args) + for key, val in self.image_def.env.items(): out_data += f'export {key}="{val}"\n' @@ -153,7 +157,7 @@ class ImageTester(BuilderBase): test_cmd = [ self.docker, 'run', '--rm', '-t', 'meson_test_image', - '/usr/bin/bash', '-c', 'source /ci/env_vars.sh; cd meson; ./run_tests.py' + '/usr/bin/bash', '-c', 'source /ci/env_vars.sh; cd meson; ./run_tests.py $CI_ARGS' ] if subprocess.run(test_cmd).returncode != 0: raise RuntimeError('Running tests failed') diff --git a/ci/ciimage/cuda/image.json b/ci/ciimage/cuda/image.json new file mode 100644 index 0000000..d395e71 --- /dev/null +++ b/ci/ciimage/cuda/image.json @@ -0,0 +1,5 @@ +{ + "base_image": "archlinux:latest", + "args": ["--only", "cuda"], + "env": {} +} diff --git a/ci/ciimage/cuda/install.sh b/ci/ciimage/cuda/install.sh new file mode 100755 index 0000000..011099d --- /dev/null +++ b/ci/ciimage/cuda/install.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -e + +pkgs=( + python python-setuptools python-wheel python-pytest-xdist python-jsonschema + ninja gcc gcc-objc git cmake + cuda zlib pkgconf +) + +PACMAN_OPTS='--needed --noprogressbar --noconfirm' + +pacman -Syu $PACMAN_OPTS "${pkgs[@]}" + +# Manually remove cache to avoid GitHub space restrictions +rm -rf /var/cache/pacman + +echo "source /etc/profile.d/cuda.sh" >> /ci/env_vars.sh |