owned this note changed 4 years ago
Published Linked with GitHub

local zuul libvirt reproducer instructions

tags: Design

download upstream image

https://nb02.opendev.org/images/

  • add to /var/lib/libvirt/images
  • make a copy;

update the image

virt-sysprep -a upstream-cloudinit-centos-8.qcow2 --ssh-inject zuul:file:/home/weshayutin/.ssh/id_rsa.pub --root-password password:passw0rd
  • this is not correctly getting the keys into zuul manually doing that step until I can ssh zuul@instance w/o passwd

size by default needs to be expanded

qemu-img resize upstream-cloudinit-centos-8.qcow2 +35G

cp upstream-cloudinit-centos-8.qcow2 upstream-cloudinit-centos-8-test.qcow2

virt-resize --expand /dev/sda1 upstream-cloudinit-centos-8.qcow2 upstream-cloudinit-centos-8-test.qcow2

I suggest using fedora cockpit w/ a virt plugin

  • launch the vm
  • check ssh keys, space, ip etc.

Automated-ish node pool config

If you already have VMs provisioned, you can do the following ansible vars at time of setup:

setup_nodepool: false
nodepool_provider: libvirt

Additionally use an inventory.yml to have the nodepool configuration generated for you:

all:
  hosts:
    localhost:
      ansible_connection: local
subnodes:
  hosts:
    reproducer-0:
      ansible_host: 10.109.0.2
    reproducer-1:
      ansible_host: 10.109.0.3
    reproducer-2:
      ansible_host: 10.109.0.4
    reproducer-3:
      ansible_host: 10.109.0.5

Then during the invocation of your ansible-role-tripleo-ci-reproducer playbook, simply -i inventory.yml and -e @envfile.yml

Manual nodepool config

https://zuul-ci.org/docs/zuul/howtos/nodepool_static.html

  • ssh-keyscan -t ed25519 192.168.122.x
  • apt-get install vi on the nodepool container
    • vi /etc/nodepool/nodepool.yaml
---
zookeeper-servers:
  - host: zk

labels:
  - name: centos-7
  - name: fedora-28
  - name: tripleo-ovb-centos-7
  - name: rhel-8
  - name: centos-8

providers:
  - name: static-host
    driver: static
    pools:
      - name: main
        nodes:
          - name: 192.168.122.146
            labels:
                - centos-8
            username: zuul
            host-key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOUEFr1/ZBpksGlgpEe9xbHYZlhaNHXxiJqICsH1OgaY
            python-path: auto


  • on the nodepool container run:
    • nodepool list
root@980036877f81:/# nodepool list
+------------+-------------+----------+-----------+-----------------+------+-------+-------------+----------+
| ID         | Provider    | Label    | Server ID | Public IPv4     | IPv6 | State | Age         | Locked   |
+------------+-------------+----------+-----------+-----------------+------+-------+-------------+----------+
| 0000000004 | static-host | centos-8 | None      | 192.168.122.146 | None | ready | 00:00:05:11 | unlocked |
+------------+-------------+----------+-----------+-----------------+------+-------+-------------+----------+


Prepare a change

git clone http://localhost:8080/test1
enter it and create a zuul.yaml file like that:

---
- project:
    check:
      jobs:
        - tripleo-ci-centos-8-scenario001-standalone
  • submit
git config --local gitreview.username "admin"
git add *
gc -am "Run my test"
git review

check to see if everything triggered

  • zuul status
  • finer console may not work
  • on nodepool container, ensure node is in-use and locked
root@980036877f81:/# nodepool list
+------------+-------------+----------+-----------+-----------------+------+--------+-------------+--------+
| ID         | Provider    | Label    | Server ID | Public IPv4     | IPv6 | State  | Age         | Locked |
+------------+-------------+----------+-----------+-----------------+------+--------+-------------+--------+
| 0000000004 | static-host | centos-8 | None      | 192.168.122.146 | None | in-use | 00:00:00:10 | locked |
+------------+-------------+----------+-----------+-----------------+------+--------+-------------+--------+


  • you should see zuul cloning src repos to:
ls /home/zuul/src/
gerrit  opendev.org

tips:

umount container overlay

for i in `df -h | grep docker | awk '{print $6}'`;do echo $i; umount $i; done

Alex's notes:
https://hackmd.io/T3rnrVe4SA2ZJA0kCP3DqQ?view#Automated-ish-node-pool-config

SUCCESS
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →


Total time
Tuesday 30 June 2020 21:01:51 +0000 (0:00:00.057) 1:25:56.125 **********

New notes to review:

Select a repo