Add Molecule CI test for nvidia driver role
Right now this is just a basic "does the install succeed?" test, with no special verification going on. - Add auto-generated molecule test - Configure Molecule to test all of - CUDA repo on CentOS 7 and 8 - CUDA repo on Ubuntu 18.04 and 20.04 - Canonical repo on Ubuntu 18.04 and 20.04 - Add Github Action to test in CI
This commit is contained in:
parent
c7aaa2e77f
commit
a096645458
15
.github/workflows/molecule.yml
vendored
Normal file
15
.github/workflows/molecule.yml
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
---
|
||||
on:
|
||||
- push
|
||||
- pull_request
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: "${{ github.repository }}"
|
||||
- name: molecule
|
||||
uses: robertdebock/molecule-action@2.7.2
|
@ -1,4 +1,5 @@
|
||||
galaxy_info:
|
||||
namespace: nvidia
|
||||
role_name: nvidia_driver
|
||||
author: Luke Yeager
|
||||
company: NVIDIA
|
||||
|
7
molecule/default/converge.yml
Normal file
7
molecule/default/converge.yml
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
tasks:
|
||||
- name: "Include ansible-role-nvidia-driver"
|
||||
include_role:
|
||||
name: "ansible-role-nvidia-driver"
|
81
molecule/default/molecule.yml
Normal file
81
molecule/default/molecule.yml
Normal file
@ -0,0 +1,81 @@
|
||||
---
|
||||
dependency:
|
||||
name: galaxy
|
||||
driver:
|
||||
name: docker
|
||||
platforms:
|
||||
|
||||
- name: ubuntu-1804-canonical
|
||||
image: geerlingguy/docker-ubuntu1804-ansible
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
||||
command: /sbin/init
|
||||
pre_build_image: true
|
||||
privileged: true
|
||||
groups:
|
||||
- canonical_repo
|
||||
- ubuntu
|
||||
|
||||
- name: ubuntu-1804-cuda
|
||||
image: geerlingguy/docker-ubuntu1804-ansible
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
||||
command: /sbin/init
|
||||
pre_build_image: true
|
||||
privileged: true
|
||||
groups:
|
||||
- cuda_repo
|
||||
- ubuntu
|
||||
|
||||
- name: ubuntu-2004-canonical
|
||||
image: geerlingguy/docker-ubuntu2004-ansible
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
||||
command: /sbin/init
|
||||
pre_build_image: true
|
||||
privileged: true
|
||||
groups:
|
||||
- canonical_repo
|
||||
- ubuntu
|
||||
|
||||
- name: ubuntu-2004-cuda
|
||||
image: geerlingguy/docker-ubuntu2004-ansible
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
||||
command: /sbin/init
|
||||
pre_build_image: true
|
||||
privileged: true
|
||||
groups:
|
||||
- cuda_repo
|
||||
- ubuntu
|
||||
|
||||
- name: centos-7
|
||||
image: geerlingguy/docker-centos7-ansible
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
||||
command: /sbin/init
|
||||
pre_build_image: true
|
||||
privileged: true
|
||||
|
||||
- name: centos-8
|
||||
image: geerlingguy/docker-centos8-ansible
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
||||
command: /sbin/init
|
||||
pre_build_image: true
|
||||
privileged: true
|
||||
|
||||
provisioner:
|
||||
name: ansible
|
||||
ansible_args:
|
||||
- -vv
|
||||
inventory:
|
||||
group_vars:
|
||||
all:
|
||||
nvidia_driver_skip_reboot: true
|
||||
canonical_repo:
|
||||
nvidia_driver_ubuntu_install_from_cuda_repo: false
|
||||
cuda_repo:
|
||||
nvidia_driver_ubuntu_install_from_cuda_repo: true
|
||||
verifier:
|
||||
name: ansible
|
10
molecule/default/prepare.yml
Normal file
10
molecule/default/prepare.yml
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
- hosts: ubuntu
|
||||
become: yes
|
||||
tasks:
|
||||
|
||||
- name: update apt cache and install gpg-agent
|
||||
apt:
|
||||
update_cache: yes
|
||||
name: gpg-agent
|
||||
state: present
|
10
molecule/default/verify.yml
Normal file
10
molecule/default/verify.yml
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
# This is an example playbook to execute Ansible tests.
|
||||
|
||||
- name: Verify
|
||||
hosts: all
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Example assertion
|
||||
assert:
|
||||
that: true
|
@ -27,6 +27,7 @@
|
||||
environment: "{{proxy_env if proxy_env is defined else {}}}"
|
||||
- name: reboot to pick up the new kernel
|
||||
reboot:
|
||||
when: not nvidia_driver_skip_reboot
|
||||
|
||||
- name: add epel repo gpg key
|
||||
rpm_key:
|
||||
|
Loading…
Reference in New Issue
Block a user