Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Add dib image build test to hoist #354

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions roles/zuul/files/jobs/dib.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
- job:
name: 'dib-build'
node: 'ubuntu-xenial'
builders:
shell: |
virtualenv $HOME/dib-build
source $HOME/dib-build/bin/activate
pip install diskimage-builder

sudo apt-get install -y debootstrap qemu-utils curl \
uuid-runtime parted kpartx

sudo git clone https://github.com/BonnyCI/hoist.git /opt/hoist
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So cloning and using the upstream repository means we wouldn't actually be testing the proposed changes here, and instead using whats already been merged. When the test runs, it'll be running from the root of the hoist repo with the proposed PR already checked out, so you should be able to just point ELEMENTS_PATH to ./roles/nodepoole/files/etc/nodepool/elements/

export ELEMENTS_PATH=/opt/hoist/roles/nodepool/files/etc/nodepool/elements/nodepool
# NOTE: be sure the list of nodepool elements here stays consistent
# with the elements specified in the nodepool role.
sudo disk-image-create -x -t qcow2 --checksum --no-tmpfs \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You loose the virtualenv environment when you sudo here, so disk-image-create is not in $PATH. Might make more sense to just write the image to /tmp or somewhere in $HOME instead?

--qemu-img-options 'compat=0.10' \
-o /opt/nodepool/images/ubuntu-xenial \
ubuntu-minimal vm simple-init growroot \
openssh-server devuser haveged pip-and-virtualenv \
nodepool bonnyci-nodepool

publishers:
- console-log
- bonnyci-logs
4 changes: 4 additions & 0 deletions roles/zuul/templates/etc/zuul/config/layout.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ jobs:
# every job invokes the set_node_options file in bonnyci_functions.py
- name: ^.*$
parameter-function: set_node_options
- name: dib-build
files: roles/nodepool/files/etc/nodepool/elements/*

projects:
- name: BonnyCI/bonnyci.org
Expand All @@ -92,8 +94,10 @@ projects:
- name: BonnyCI/hoist
check_github:
- bonnyci-run-check-multinode
- dib-build
gate_github:
- bonnyci-run-gate-multinode
- dib-build

- name: BonnyCI/sandbox
check_github:
Expand Down