Skip to content

Commit 06afb50

Browse files
committed
[TMP] test build
1 parent 9a52f29 commit 06afb50

File tree

4 files changed

+59
-25
lines changed

4 files changed

+59
-25
lines changed

.github/workflows/build-init.yml

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,53 @@ on:
55
push:
66
branches: [main]
77
pull_request:
8+
types: [opened, synchronize, reopened, ready_for_review]
89
paths-ignore: ["docs/**"]
910
jobs:
1011
build-init:
11-
# this job initialises the vagrant box
12-
# then just runs some initial ansible tasks
13-
# for the full build, see build.yml
14-
runs-on: macos-latest
15-
env:
16-
VAGRANT_NO_GUI: true
17-
VAGRANT_ON_GH: true
12+
# this job tests ansible provisioning in Docker containers
13+
# Tests on both ARM64 and AMD64 architectures using Ubuntu runners
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
os: [ubuntu-latest, ubuntu-24.04-arm]
1818

1919
steps:
2020
- uses: actions/checkout@v4
21-
- name: set up Python
21+
22+
- name: Set up Python
2223
uses: actions/setup-python@v5
2324
with:
24-
python-version: 3.9
25+
python-version: 3.13
2526

26-
- name: install pip requirements
27+
- name: Install pip requirements
2728
run: |
2829
pip install --upgrade pip
2930
pip install wheel
3031
pip install -r requirements.txt
3132
32-
- name: install ansible requirements
33+
- name: Install Ansible requirements
3334
run: ansible-galaxy install -r requirements.yml
3435

35-
- name: Build Vagrant Box
36-
run: ANSIBLE_ARGS="--tags init,ci_test" vagrant up
36+
- name: Install Docker collection for CI
37+
run: ansible-galaxy collection install community.docker
38+
39+
- name: Start Ubuntu Docker container
40+
run: |
41+
docker run -d --name quantum-mobile \
42+
-v ${{ github.workspace }}:/workspace \
43+
ubuntu:24.04 \
44+
sleep infinity
45+
46+
- name: Prepare container for Ansible
47+
run: docker exec quantum-mobile bash -c "apt-get update && apt-get install -y python3 sudo"
48+
49+
- name: Run Ansible provisioning
50+
run: ansible-playbook --limit docker-ci -e build_hosts=docker-ci --tags init,ci_test playbook-build.yml
3751

3852
- name: Archive ansible log
53+
if: always()
3954
uses: actions/upload-artifact@v4
4055
with:
41-
name: ansible-log
56+
name: ansible-log-${{ matrix.os }}
4257
path: ansible.log

.github/workflows/build-vagrant.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: set up Python
2929
uses: actions/setup-python@v5
3030
with:
31-
python-version: 3.9
31+
python-version: 3.13
3232

3333
- name: install pip requirements
3434
run: |

inventory.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ all:
6767
ansible_ssh_common_args: "-F vagrant-ssh"
6868
ansible_user: vagrant
6969

70+
docker-ci:
71+
cloud_platform: docker
72+
ansible_connection: community.docker.docker
73+
ansible_host: quantum-mobile
74+
ansible_user: root
75+
ansible_python_interpreter: /usr/bin/python3
76+
7077
docker:
7178
# see playbook-docker.yml to start container
7279
cloud_platform: docker

playbook-build.yml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
# Install headers for guest-additions. Use kernel-specific package because
1919
# linux-headers-generic can be broken on ARM64 (depends on non-existent version).
2020
- name: Get kernel version
21-
tags: [init]
21+
tags: [init, ci_skip]
2222
when: "inventory_hostname.startswith('vagrant')"
2323
ansible.builtin.command: uname -r
2424
register: uname
2525
changed_when: false
2626

2727
- name: Install linux-headers for guest-additions
28-
tags: [init]
28+
tags: [init, ci_skip]
2929
when: "inventory_hostname.startswith('vagrant')"
3030
become: true
3131
ansible.builtin.apt:
@@ -54,7 +54,7 @@
5454
tags: [init]
5555
ansible.builtin.include_tasks: local/tasks/ensure-apt-pip.yml
5656
- name: "Add QM user '{{ vm_user }}'"
57-
tags: [add_user, ci_test]
57+
tags: [add_user]
5858
ansible.builtin.import_tasks: local/tasks/add-qm-user.yml
5959
- name: "Add release notes section for the operating system"
6060
tags: [release_notes]
@@ -72,7 +72,7 @@
7272
editors_vm_user: "{{ vm_user }}"
7373

7474
- name: Add desktop GUI
75-
tags: [ubuntu_desktop]
75+
tags: [ubuntu_desktop, ci_skip]
7676
when: not vm_headless
7777
become: true
7878
block:
@@ -96,7 +96,7 @@
9696
ubuntu_desktop_wm_package: "{{ vm_wm_package }}"
9797

9898
- name: Customise GUI for QM
99-
tags: [customise-gui]
99+
tags: [customise-gui, ci_skip]
100100
when: not vm_headless
101101
become: true
102102
become_user: "{{ vm_user }}"
@@ -133,7 +133,7 @@
133133
packages: [grace, xcrysden, default-jre]
134134

135135
- name: Install SLURM service
136-
tags: [slurm]
136+
tags: [slurm, ci_skip]
137137
ansible.builtin.import_role:
138138
name: marvel-nccr.slurm
139139

@@ -144,11 +144,13 @@
144144
become: true
145145
become_user: "{{ root_user }}"
146146
ansible.builtin.import_tasks: local/tasks/rabbitmq.yml
147+
147148
- name: Install PostrgeSQL server service
148-
tags: [postgresql]
149+
tags: [postgresql, ci_skip]
149150
become: true
150151
become_user: "{{ root_user }}"
151152
ansible.builtin.import_tasks: local/tasks/postgresql.yml
153+
152154
- name: Install conda+mamba
153155
tags: [conda]
154156
ansible.builtin.import_role:
@@ -222,8 +224,8 @@
222224
content: 'eval "$(_VERDI_COMPLETE=bash_source verdi)"'
223225
mode: "0644"
224226

225-
- name: Create an aiida-profile
226-
tags: [aiida-profile]
227+
- name: Create an aiida-profile (full with PostgreSQL)
228+
tags: [aiida-profile, ci_skip]
227229
become: true
228230
become_user: "{{ vm_user }}"
229231
ansible.builtin.import_tasks: local/tasks/aiida-profile.yml
@@ -243,11 +245,21 @@
243245
db_password: "ne9N_LDK-*JSS"
244246
daemon_service: true
245247

248+
- name: Create an aiida-profile (CI lightweight with SQLite)
249+
when: inventory_hostname == 'docker-ci'
250+
become: true
251+
become_user: "{{ vm_user }}"
252+
ansible.builtin.shell: |
253+
~/.conda/bin/conda run -n {{ aiida_conda_env }} verdi presto -p {{ aiida_profile }}
254+
args:
255+
creates: "~/.aiida/config.json"
256+
246257
- name: Create AiiDA Jupyter service
247-
tags: [aiida-jupyter]
258+
tags: [aiida-jupyter, ci_skip]
248259
become: true
249260
become_user: "{{ vm_user }}"
250261
ansible.builtin.import_tasks: local/tasks/aiida-jupyter.yml
262+
251263
- name: "Create AiiDA computers"
252264
tags: [aiida-computers]
253265
become: true

0 commit comments

Comments
 (0)