summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSF initial configurator <admin@softwarefactory-project.io>2019-12-16 22:19:00 +0000
committerSF initial configurator <admin@softwarefactory-project.io>2019-12-17 14:09:03 +0000
commitfc704d5e6ad49edaac773241094724406bb87795 (patch)
tree786473722ba8d006a34d418b9a67b52f0bf52ab1
parentbf50ad8d9b2f40ded0fcae352d4e6731e466d0f0 (diff)
Automatic update of defaults
Change-Id: I5611671901bdd9e642cd5deebf366206779c4636
-rw-r--r--nodepool/_pods.yaml13
-rw-r--r--nodepool/virt_images/README.md12
-rw-r--r--nodepool/virt_images/cloud-fedora-rawhide.yaml36
-rw-r--r--nodepool/virt_images/roles/base-cleanup/defaults/main.yaml2
-rw-r--r--nodepool/virt_images/roles/base-cleanup/tasks/main.yaml5
-rw-r--r--nodepool/virt_images/roles/base-customize/defaults/main.yaml1
-rw-r--r--nodepool/virt_images/roles/base-customize/tasks/main.yaml6
-rw-r--r--nodepool/virt_images/roles/base-finalize/defaults/main.yaml1
-rw-r--r--nodepool/virt_images/roles/base-finalize/tasks/main.yaml8
-rw-r--r--nodepool/virt_images/roles/base-install-packages/defaults/main.yaml1
-rw-r--r--nodepool/virt_images/roles/base-install-packages/tasks/main.yaml7
-rw-r--r--nodepool/virt_images/roles/base/defaults/main.yaml9
-rw-r--r--nodepool/virt_images/roles/base/tasks/main.yaml74
-rw-r--r--nodepool/virt_images/roles/discover-rawhide/defaults/main.yaml1
-rw-r--r--nodepool/virt_images/roles/discover-rawhide/tasks/main.yaml45
-rw-r--r--nodepool/virt_images/roles/network-config/defaults/main.yaml2
-rw-r--r--nodepool/virt_images/roles/network-config/tasks/main.yaml12
-rw-r--r--nodepool/virt_images/roles/sshd-config/defaults/main.yaml2
-rw-r--r--nodepool/virt_images/roles/sshd-config/files/sshd_config20
-rw-r--r--nodepool/virt_images/roles/sshd-config/tasks/main.yaml13
-rw-r--r--nodepool/virt_images/roles/zuul-user/defaults/main.yaml2
-rw-r--r--nodepool/virt_images/roles/zuul-user/tasks/main.yaml27
-rw-r--r--playbooks/base/post.yaml4
-rw-r--r--playbooks/base/pre.yaml14
-rw-r--r--playbooks/config/check.yaml58
-rw-r--r--resources/_internal.yaml3
-rw-r--r--roles/fetch-output-openshift/tasks/rsync.yaml2
-rw-r--r--roles/log-classify/tasks/run.yaml17
-rw-r--r--roles/upload-log-classify-model/tasks/main.yaml2
-rwxr-xr-xroles/wait-for-changes-ahead/library/wait_for_changes_ahead.py2
-rw-r--r--zuul.d/_jobs-base.yaml2
-rw-r--r--zuul.d/_pipelines.yaml2
32 files changed, 374 insertions, 31 deletions
diff --git a/nodepool/_pods.yaml b/nodepool/_pods.yaml
new file mode 100644
index 00000000..c7411692
--- /dev/null
+++ b/nodepool/_pods.yaml
@@ -0,0 +1,13 @@
+# This file is managed by sfconfig, do not edit manually
+---
+labels:
+ - name: pod-centos-7
+
+extra-labels:
+ - provider: managed-k1s-provider-k1s01
+ pool: main
+ labels:
+ - name: pod-centos-7
+ image: localhost/k1s/centos-7
+ python-path: /bin/python2
+
diff --git a/nodepool/virt_images/README.md b/nodepool/virt_images/README.md
new file mode 100644
index 00000000..3fed60ea
--- /dev/null
+++ b/nodepool/virt_images/README.md
@@ -0,0 +1,12 @@
+# Virt-customize based nodepool image
+
+This directory contains nodepool image built using virt-customize-dib elements.
+
+To use a playbook, add this to a nodepool yaml file:
+
+```yaml
+diskimages:
+ - name: cloud-fedora-rawhide
+ python-path: /usr/bin/python3
+ dib-cmd: /usr/bin/dib-virt-customize /etc/nodepool/virt_images/cloud-fedora-rawhide.yaml
+```
diff --git a/nodepool/virt_images/cloud-fedora-rawhide.yaml b/nodepool/virt_images/cloud-fedora-rawhide.yaml
new file mode 100644
index 00000000..5b9e4b47
--- /dev/null
+++ b/nodepool/virt_images/cloud-fedora-rawhide.yaml
@@ -0,0 +1,36 @@
+---
+- name: Build a fedora cloud image suitable for Zuul
+ hosts: localhost
+ vars:
+ image: Fedora-Cloud-Base-Rawhide.x86_64.qcow2
+ extra_packages:
+ # Extra system tools
+ - pigz
+ - bridge-utils
+ - wget
+ - unzip
+ # Basic CI tools
+ - make
+ - gcc
+ - patch
+ tasks:
+ - block:
+ - import_role:
+ name: discover-rawhide
+ - import_role:
+ name: base
+ - import_role:
+ name: sshd-config
+ - import_role:
+ name: network-config
+ - import_role:
+ name: zuul-user
+ - import_role:
+ name: base-install-packages
+ - import_role:
+ name: base-customize
+ - import_role:
+ name: base-finalize
+ always:
+ - import_role:
+ name: base-cleanup
diff --git a/nodepool/virt_images/roles/base-cleanup/defaults/main.yaml b/nodepool/virt_images/roles/base-cleanup/defaults/main.yaml
new file mode 100644
index 00000000..dd9240b7
--- /dev/null
+++ b/nodepool/virt_images/roles/base-cleanup/defaults/main.yaml
@@ -0,0 +1,2 @@
+---
+image_tmp_dir: "/var/tmp/{{ image_output | basename }}"
diff --git a/nodepool/virt_images/roles/base-cleanup/tasks/main.yaml b/nodepool/virt_images/roles/base-cleanup/tasks/main.yaml
new file mode 100644
index 00000000..29c01eaa
--- /dev/null
+++ b/nodepool/virt_images/roles/base-cleanup/tasks/main.yaml
@@ -0,0 +1,5 @@
+---
+- name: Remove tmp directory
+ file:
+ path: "{{ image_tmp_dir }}"
+ state: absent
diff --git a/nodepool/virt_images/roles/base-customize/defaults/main.yaml b/nodepool/virt_images/roles/base-customize/defaults/main.yaml
new file mode 100644
index 00000000..ed97d539
--- /dev/null
+++ b/nodepool/virt_images/roles/base-customize/defaults/main.yaml
@@ -0,0 +1 @@
+---
diff --git a/nodepool/virt_images/roles/base-customize/tasks/main.yaml b/nodepool/virt_images/roles/base-customize/tasks/main.yaml
new file mode 100644
index 00000000..091bce30
--- /dev/null
+++ b/nodepool/virt_images/roles/base-customize/tasks/main.yaml
@@ -0,0 +1,6 @@
+---
+- debug:
+ msg: "Running: {{ ' '.join(virt_customize_cmd) }}"
+
+- name: Run virt-customize
+ command: "{{ ' '.join(virt_customize_cmd) }}"
diff --git a/nodepool/virt_images/roles/base-finalize/defaults/main.yaml b/nodepool/virt_images/roles/base-finalize/defaults/main.yaml
new file mode 100644
index 00000000..ed97d539
--- /dev/null
+++ b/nodepool/virt_images/roles/base-finalize/defaults/main.yaml
@@ -0,0 +1 @@
+---
diff --git a/nodepool/virt_images/roles/base-finalize/tasks/main.yaml b/nodepool/virt_images/roles/base-finalize/tasks/main.yaml
new file mode 100644
index 00000000..9fb8968b
--- /dev/null
+++ b/nodepool/virt_images/roles/base-finalize/tasks/main.yaml
@@ -0,0 +1,8 @@
+---
+- name: Create raw file
+ command: "qemu-img convert -O raw {{ image_file }} {{ image_output }}.raw"
+ when: raw_type | default(False) | bool
+
+- name: Create qcow file
+ command: "mv {{ image_file }} {{ image_output }}.qcow2"
+ when: qcow2_type | default(False) | bool
diff --git a/nodepool/virt_images/roles/base-install-packages/defaults/main.yaml b/nodepool/virt_images/roles/base-install-packages/defaults/main.yaml
new file mode 100644
index 00000000..ed97d539
--- /dev/null
+++ b/nodepool/virt_images/roles/base-install-packages/defaults/main.yaml
@@ -0,0 +1 @@
+---
diff --git a/nodepool/virt_images/roles/base-install-packages/tasks/main.yaml b/nodepool/virt_images/roles/base-install-packages/tasks/main.yaml
new file mode 100644
index 00000000..588de541
--- /dev/null
+++ b/nodepool/virt_images/roles/base-install-packages/tasks/main.yaml
@@ -0,0 +1,7 @@
+---
+- set_fact:
+ cmd:
+ - "--install '{{ extra_packages | join(',') }}'"
+
+- set_fact:
+ virt_customize_cmd: "{{ virt_customize_cmd + cmd }}"
diff --git a/nodepool/virt_images/roles/base/defaults/main.yaml b/nodepool/virt_images/roles/base/defaults/main.yaml
new file mode 100644
index 00000000..0c62f45d
--- /dev/null
+++ b/nodepool/virt_images/roles/base/defaults/main.yaml
@@ -0,0 +1,9 @@
+---
+image_cache_dir: "/var/cache/nodepool"
+image_wipe_cache: False
+base_packages:
+ - traceroute
+ - iproute
+ - git
+ - rsync
+extra_packages: []
diff --git a/nodepool/virt_images/roles/base/tasks/main.yaml b/nodepool/virt_images/roles/base/tasks/main.yaml
new file mode 100644
index 00000000..fdb27809
--- /dev/null
+++ b/nodepool/virt_images/roles/base/tasks/main.yaml
@@ -0,0 +1,74 @@
+---
+- assert:
+ that:
+ - image_url is defined
+ - image_checksum is defined
+ - image is defined
+ - image_url != ''
+ - image_checksum != ''
+ - image != ''
+
+- name: Set some runtime facts
+ set_fact:
+ image_cache_file: "{{ image_cache_dir }}/{{ image }}"
+ image_tmp_dir: "/var/tmp/{{ image_output | basename }}"
+
+- name: Ensure libvirt is started
+ service:
+ name: libvirtd
+ state: started
+
+- name: Make sure cache directory exist
+ file:
+ path: "{{ image_cache_dir }}"
+ state: directory
+
+- name: Delete previous image cache
+ file:
+ path: "{{ image_cache_file }}"
+ state: absent
+ when: image_wipe_cache
+
+- name: Check if image is already downloaded
+ stat:
+ path: "{{ image_cache_file }}"
+ register: _image_cache_file_stat
+
+- name: Download if checksum doesn't match
+ get_url:
+ url: "{{ image_url }}"
+ dest: "{{ image_cache_file }}"
+ checksum: "{{ image_checksum }}"
+ when: not _image_cache_file_stat.stat.exists
+
+- name: Extract the image if necessary
+ command: "xz -k -d {{ image_cache_file }}.xz"
+ args:
+ chdir: "{{ image_cache_dir }}"
+ creates: "{{ image_cache_file }}"
+
+- name: Update the cache
+ command: "virt-customize -m 1024 -a {{ image_cache_file }} --update"
+
+- name: Create tmp directory
+ file:
+ path: "{{ image_tmp_dir }}"
+ state: directory
+ mode: 0755
+
+- name: Set filename copy fact
+ set_fact:
+ image_file: "{{ image_tmp_dir }}/{{ image_cache_file | basename }}"
+
+- name: Copy the image
+ copy:
+ src: "{{ image_cache_file }}"
+ dest: "{{ image_file }}"
+ remote_src: true
+ mode: 0644
+
+- set_fact:
+ virt_customize_cmd:
+ - "virt-customize -m 1024 -a {{ image_file }}"
+ - "--selinux-relabel"
+ - "--install '{{ base_packages | join(',') }}'"
diff --git a/nodepool/virt_images/roles/discover-rawhide/defaults/main.yaml b/nodepool/virt_images/roles/discover-rawhide/defaults/main.yaml
new file mode 100644
index 00000000..e87cb9c6
--- /dev/null
+++ b/nodepool/virt_images/roles/discover-rawhide/defaults/main.yaml
@@ -0,0 +1 @@
+base_url: https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Cloud/x86_64/images/
diff --git a/nodepool/virt_images/roles/discover-rawhide/tasks/main.yaml b/nodepool/virt_images/roles/discover-rawhide/tasks/main.yaml
new file mode 100644
index 00000000..51e47c84
--- /dev/null
+++ b/nodepool/virt_images/roles/discover-rawhide/tasks/main.yaml
@@ -0,0 +1,45 @@
+- tempfile:
+ state: file
+ register: tempfile
+
+- file:
+ path: "{{ tempfile.path }}"
+ state: absent
+
+- name: Fetch publication page
+ get_url:
+ url: "{{ base_url }}"
+ dest: "{{ tempfile.path }}"
+
+- name: Find rawhide qcow2 url
+ command: sed -n "/qcow2/ s/.*\(Fedora-Cloud-Base-Rawhide-.*\)<\/a>.*/\1/p" {{ tempfile.path }}
+ register: get_qcow_image_name
+
+- name: Find checksum file url
+ command: sed -n "/CHECKSUM/ s/.*\(Fedora-Cloud-Rawhide-.*\)<\/a>.*/\1/p" {{ tempfile.path }}
+ register: get_checksum_name
+
+- set_fact:
+ checksums_url: "{{ base_url }}{{ get_checksum_name.stdout }}"
+
+- file:
+ path: "{{ tempfile.path }}"
+ state: absent
+
+- name: Fetch checksum file
+ get_url:
+ url: "{{ checksums_url }}"
+ dest: "{{ tempfile.path }}"
+
+- name: Find checksum
+ command: sed -n "/SHA256 ({{ get_qcow_image_name.stdout }}) = / s/.* = \(.*\)/\1/p" {{ tempfile.path }}
+ register: get_checksum
+
+- set_fact:
+ image_url: "{{ base_url }}{{ get_qcow_image_name.stdout }}"
+ image_checksum: "sha256:{{ get_checksum.stdout }}"
+
+- debug:
+ msg: |
+ Discovered image_url: {{ image_url }}
+ Discovered image_checksum: {{ image_checksum }}
diff --git a/nodepool/virt_images/roles/network-config/defaults/main.yaml b/nodepool/virt_images/roles/network-config/defaults/main.yaml
new file mode 100644
index 00000000..dd9240b7
--- /dev/null
+++ b/nodepool/virt_images/roles/network-config/defaults/main.yaml
@@ -0,0 +1,2 @@
+---
+image_tmp_dir: "/var/tmp/{{ image_output | basename }}"
diff --git a/nodepool/virt_images/roles/network-config/tasks/main.yaml b/nodepool/virt_images/roles/network-config/tasks/main.yaml
new file mode 100644
index 00000000..5d493149
--- /dev/null
+++ b/nodepool/virt_images/roles/network-config/tasks/main.yaml
@@ -0,0 +1,12 @@
+---
+- set_fact:
+ cmd:
+ - "--append-line '/etc/sysctl.conf:net.ipv6.conf.all.disable_ipv6 = 1'"
+ - "--append-line '/etc/sysctl.conf:net.ipv6.conf.default.disable_ipv6 = 1'"
+ - "--append-line '/etc/sysconfig/network:IPV6INIT=no'"
+ - "--append-line '/etc/sysconfig/network:IPV6_AUTOCONF=no'"
+ - "--append-line '/etc/sysconfig/network:IPV6_DEFROUTE=no'"
+ - "--append-line '/etc/yum.conf:ip_resolve=4'"
+
+- set_fact:
+ virt_customize_cmd: "{{ virt_customize_cmd + cmd }}"
diff --git a/nodepool/virt_images/roles/sshd-config/defaults/main.yaml b/nodepool/virt_images/roles/sshd-config/defaults/main.yaml
new file mode 100644
index 00000000..dd9240b7
--- /dev/null
+++ b/nodepool/virt_images/roles/sshd-config/defaults/main.yaml
@@ -0,0 +1,2 @@
+---
+image_tmp_dir: "/var/tmp/{{ image_output | basename }}"
diff --git a/nodepool/virt_images/roles/sshd-config/files/sshd_config b/nodepool/virt_images/roles/sshd-config/files/sshd_config
new file mode 100644
index 00000000..df17bfab
--- /dev/null
+++ b/nodepool/virt_images/roles/sshd-config/files/sshd_config
@@ -0,0 +1,20 @@
+HostKey /etc/ssh/ssh_host_rsa_key
+HostKey /etc/ssh/ssh_host_ecdsa_key
+HostKey /etc/ssh/ssh_host_ed25519_key
+KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256
+Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
+MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com
+SyslogFacility AUTHPRIV
+AuthorizedKeysFile .ssh/authorized_keys
+PasswordAuthentication no
+ChallengeResponseAuthentication no
+GSSAPIAuthentication no
+GSSAPICleanupCredentials no
+UsePAM yes
+X11Forwarding no
+UseDNS no
+AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
+AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
+AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE
+AcceptEnv XMODIFIERS
+Subsystem sftp /usr/libexec/openssh/sftp-server
diff --git a/nodepool/virt_images/roles/sshd-config/tasks/main.yaml b/nodepool/virt_images/roles/sshd-config/tasks/main.yaml
new file mode 100644
index 00000000..ff626656
--- /dev/null
+++ b/nodepool/virt_images/roles/sshd-config/tasks/main.yaml
@@ -0,0 +1,13 @@
+---
+- name: Prepare sshd_config file
+ copy:
+ src: files/sshd_config
+ dest: "{{ image_tmp_dir }}/sshd_config"
+
+- set_fact:
+ cmd:
+ - "--copy-in '{{ image_tmp_dir }}/sshd_config:/etc/ssh/'"
+ - "--chmod '0600:/etc/ssh/sshd_config'"
+
+- set_fact:
+ virt_customize_cmd: "{{ virt_customize_cmd + cmd }}"
diff --git a/nodepool/virt_images/roles/zuul-user/defaults/main.yaml b/nodepool/virt_images/roles/zuul-user/defaults/main.yaml
new file mode 100644
index 00000000..dd9240b7
--- /dev/null
+++ b/nodepool/virt_images/roles/zuul-user/defaults/main.yaml
@@ -0,0 +1,2 @@
+---
+image_tmp_dir: "/var/tmp/{{ image_output | basename }}"
diff --git a/nodepool/virt_images/roles/zuul-user/tasks/main.yaml b/nodepool/virt_images/roles/zuul-user/tasks/main.yaml
new file mode 100644
index 00000000..2382ba49
--- /dev/null
+++ b/nodepool/virt_images/roles/zuul-user/tasks/main.yaml
@@ -0,0 +1,27 @@
+---
+- name: Prepare the sudoers file
+ copy:
+ content: |
+ Defaults !requiretty
+ zuul-worker ALL=(ALL) NOPASSWD:ALL
+ dest: "{{ image_tmp_dir }}/zuul-worker"
+
+- name: Prepare the authorized_keys file
+ copy:
+ src: /var/lib/nodepool/.ssh/zuul_rsa.pub
+ dest: "{{ image_tmp_dir }}/authorized_keys"
+ remote_src: true
+
+- set_fact:
+ cmd:
+ - "--run-command 'adduser -m zuul-worker'"
+ - "--mkdir '/home/zuul-worker/.ssh'"
+ - "--chmod '0700:/home/zuul-worker/.ssh'"
+ - "--copy-in '{{ image_tmp_dir }}/authorized_keys:/home/zuul-worker/.ssh/'"
+ - "--chmod '0600:/home/zuul-worker/.ssh/authorized_keys'"
+ - "--run-command 'chown -R zuul-worker:zuul-worker /home/zuul-worker/.ssh/'"
+ - "--copy-in '{{ image_tmp_dir }}/zuul-worker:/etc/sudoers.d/'"
+ - "--chmod '0440:/etc/sudoers.d/zuul-worker'"
+
+- set_fact:
+ virt_customize_cmd: "{{ virt_customize_cmd + cmd }}"
diff --git a/playbooks/base/post.yaml b/playbooks/base/post.yaml
index ed54680e..733f6822 100644
--- a/playbooks/base/post.yaml
+++ b/playbooks/base/post.yaml
@@ -19,6 +19,7 @@
roles:
- role: add-fileserver
fileserver: "{{ site_sflogs }}"
+ - role: generate-zuul-manifest
- role: ara-report
# This depends-on https://review.openstack.org/577675
ara_report_run: True
@@ -29,7 +30,6 @@
logclassify_zuul_web: https://softwarefactory-project.io/zuul/api/tenant/local
logclassify_model_dir: /var/lib/log-classify
logclassify_local_dir: "{{ zuul.executor.log_root }}"
- - role: generate-zuul-manifest
- hosts: "{{ site_sflogs.fqdn }}"
gather_facts: false
@@ -38,9 +38,9 @@
- block:
- import_role: name=upload-log-classify-model
- import_role: name=upload-logs
- - import_role: name=emit-job-report
- import_role: name=buildset-artifacts-location
vars:
+ zuul_log_compress: true
zuul_log_url: "https://softwarefactory-project.io/logs"
zuul_logserver_root: "{{ site_sflogs.path }}"
diff --git a/playbooks/base/pre.yaml b/playbooks/base/pre.yaml
index b0c5a498..2c175246 100644
--- a/playbooks/base/pre.yaml
+++ b/playbooks/base/pre.yaml
@@ -11,15 +11,15 @@
- hosts: all
tasks:
- - import_role: name=ensure-output-dirs
- when: ansible_user_dir is defined
- block:
- - import_role: name=validate-host
- - import_role: name=prepare-workspace
- - import_role: name=add-build-sshkey
+ - include_role: name=validate-host
+ - include_role: name=prepare-workspace
+ - include_role: name=add-build-sshkey
when: "ansible_connection != 'kubectl'"
- block:
- - import_role: name=prepare-workspace-openshift
- - import_role: name=remove-zuul-sshkey
+ - include_role: name=prepare-workspace-openshift
+ - include_role: name=remove-zuul-sshkey
run_once: true
when: "ansible_connection == 'kubectl'"
+ - import_role: name=ensure-output-dirs
+ when: ansible_user_dir is defined
diff --git a/playbooks/config/check.yaml b/playbooks/config/check.yaml
index 2a355b34..34fd5303 100644
--- a/playbooks/config/check.yaml
+++ b/playbooks/config/check.yaml
@@ -69,7 +69,7 @@
no_log: true
- name: Check resources changes
- command: env - /usr/bin/managesf-resources remote-validate --remote-gateway {{ gateway_url }}
+ shell: env - REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-bundle.crt /usr/bin/managesf-resources remote-validate --remote-gateway {{ gateway_url }}
args:
chdir: "{{ config_root }}"
@@ -79,21 +79,20 @@
chdir: "{{ config_root }}"
when: '"gerrit" in arch.roles'
- # Use "env -" to remove zuul-executor environment that modifies python runtime (e.g. defines a 'zuul' python module)
- name: Check gerrit commentlinks
- command: env - python -c "import yaml; 'commentlinks' in yaml.safe_load(open('gerrit/commentlinks.yaml'))"
+ command: python3 -c "import yaml; 'commentlinks' in yaml.safe_load(open('gerrit/commentlinks.yaml'))"
args:
chdir: "{{ config_root }}"
when: '"gerrit" in arch.roles'
- name: Check dashboards
- command: env - python2 /usr/libexec/software-factory/sf-update-dashboard --check --input dashboards/
+ command: python3 /usr/libexec/software-factory/sf-update-dashboard --check --input dashboards/
args:
chdir: "{{ config_root }}"
when: '"gerrit" in arch.roles'
- name: Check policy file
- command: env - python -c "import yaml; yaml.safe_load(open('policies/policy.yaml'))"
+ command: python3 -c "import yaml; yaml.safe_load(open('policies/policy.yaml'))"
args:
chdir: "{{ config_root }}"
@@ -101,29 +100,58 @@
block:
- name: Check syntax errors in repoxplorer definition files
command: >
- env - /opt/rh/rh-python35/root/bin/repoxplorer-config-validate --config {{ config_root }}/defconf/defconf-repoxplorer.py
+ env - /bin/repoxplorer-config-validate --config {{ config_root }}/defconf/defconf-repoxplorer.py
args:
chdir: "{{ config_root }}"
when: '"repoxplorer" in arch.roles'
- name: Validate nodepool configuration
block:
- - name: Install fake _nodepool.yaml
+ - name: Install defconf nodepool.yaml
copy:
remote_src: true
src: "{{ config_root }}/defconf/defconf-nodepool.yaml"
- dest: "{{ config_root }}/build/_nodepool.yaml"
-
- - name: Merge nodepool config repo files
+ dest: "{{ config_root }}/nodepool/_nodepool.yaml"
+
+ - name: Check all launcher-hosts exists (task fail with invalid hostname on stdout)
+ shell: >
+ find {{ config_root }}/nodepool/ -name "*.yaml" | xargs grep '^ *launcher-host: ' | awk '{ print $3 }' |
+ grep -v '^\({{ arch.launcher_hosts | join('\|') }}\)$'
+ register: _unknown_launcher_hosts
+ failed_when: _unknown_launcher_hosts.stdout
+ changed_when: false
+
+ - name: Generate per launcher-hosts configuration
+ block:
+ - name: Generate configuration
+ command: >
+ env - /bin/managesf-configuration nodepool
+ --cache-dir {{ config_root }}/../.cache
+ {% if item != arch.launcher_hosts[0] %}--extra-launcher {% endif %}
+ --hostname {{ item }}
+ --config-dir {{ config_root }} --output build/nodepool-{{ item }}.yaml
+ args:
+ chdir: "{{ config_root }}"
+ loop: "{{ arch.launcher_hosts }}"
+
+ - name: Run nodepool config-validate for nodepool-launchers
+ command: >
+ env - /bin/nodepool -c build/nodepool-{{ item }}.yaml config-validate
+ args:
+ chdir: "{{ config_root }}"
+ loop: "{{ arch.launcher_hosts }}"
+ when: arch.launcher_hosts
+
+ - name: Merge nodepool-builder config repo files
command: >
- env - /usr/share/sf-config/scripts/sf-nodepool-conf-merger.py
- nodepool/ build/nodepool.yaml
+ env - /bin/managesf-configuration nodepool
+ --cache-dir {{ config_root }}/../.cache --builder --config-dir {{ config_root }} --output build/nodepool-builder.yaml
args:
chdir: "{{ config_root }}"
- - name: Run nodepool config-validate
+ - name: Run nodepool config-validate for nodepool-builder
command: >
- env - /opt/rh/rh-python35/root/bin/nodepool -c build/nodepool.yaml
+ env - /bin/nodepool -c build/nodepool-builder.yaml
config-validate
args:
chdir: "{{ config_root }}"
@@ -146,7 +174,7 @@
- name: Validate zuul config syntax
command: >
- env - /opt/rh/rh-python35/root/bin/zuul -c zuul.conf tenant-conf-check
+ env - /bin/zuul -c zuul.conf tenant-conf-check
args:
chdir: "{{ config_root }}/build"
diff --git a/resources/_internal.yaml b/resources/_internal.yaml
index aaaa6d3d..9c3fddf3 100644
--- a/resources/_internal.yaml
+++ b/resources/_internal.yaml
@@ -7,8 +7,7 @@ resources:
url: "https://softwarefactory-project.io/manage"
default-connection: gerrit
tenant-options:
- zuul/web-root: https://softwarefactory-project.io/zuul/t/local/
- zuul/report-build-page: true
+ zuul/report-build-page: True
connections:
gerrit:
diff --git a/roles/fetch-output-openshift/tasks/rsync.yaml b/roles/fetch-output-openshift/tasks/rsync.yaml
index 7e7de0fa..b015270a 100644
--- a/roles/fetch-output-openshift/tasks/rsync.yaml
+++ b/roles/fetch-output-openshift/tasks/rsync.yaml
@@ -12,7 +12,7 @@
loop_control:
loop_var: output
-- name: Copy src repos to the pod
+- name: Copy zuul-output from the pod to the executor
command: >
oc --context "{{ item.1.context }}"
--namespace "{{ item.1.namespace }}"
diff --git a/roles/log-classify/tasks/run.yaml b/roles/log-classify/tasks/run.yaml
index 7ce3779a..722b79f9 100644
--- a/roles/log-classify/tasks/run.yaml
+++ b/roles/log-classify/tasks/run.yaml
@@ -18,7 +18,7 @@
owner: "{{ ansible_user }}"
mode: 0700
state: directory
- loop:
+ with_items:
- "{{ _model_path|dirname }}"
- "{{ logclassify_tmp_dir }}"
@@ -89,6 +89,7 @@
{% endif %}
{% endif %}
--html {{ logclassify_tmp_dir }}/log-classify.html
+ --json {{ logclassify_tmp_dir }}/log-classify.json
{% if logclassify_static_location %}--static-location {{ logclassify_static_location }}{% endif %}
{% if logclassify_logserver_dir %}--include-path {{ logclassify_logserver_dir }}{% endif %}
{% for _path in logclassify_exclude_paths %}--exclude-path {{ _path }}{% endfor %}
@@ -103,7 +104,7 @@
src: "{{ logclassify_tmp_dir }}/log-classify.{{ item }}"
dest: "{{ zuul.executor.log_root }}/log-classify.{{ item }}"
mode: pull
- loop:
+ with_items:
- html
- json
when:
@@ -127,3 +128,15 @@
when:
- _model_check.rc == 4
- _model_build.rc == 0
+
+- name: Return the report artifact
+ when:
+ - _model_check.rc == 0 or _model_build.rc == 0
+ - _model_run.rc == 0
+ delegate_to: localhost
+ zuul_return:
+ data:
+ zuul:
+ artifacts:
+ - name: "LogReduce report"
+ url: "log-classify.html"
diff --git a/roles/upload-log-classify-model/tasks/main.yaml b/roles/upload-log-classify-model/tasks/main.yaml
index 1b3e3161..b279a2bd 100644
--- a/roles/upload-log-classify-model/tasks/main.yaml
+++ b/roles/upload-log-classify-model/tasks/main.yaml
@@ -36,7 +36,7 @@
file:
path: "{{ zuul.executor.log_root }}/model.{{ item }}"
state: absent
- loop:
+ with_items:
- clf
- name
delegate_to: localhost
diff --git a/roles/wait-for-changes-ahead/library/wait_for_changes_ahead.py b/roles/wait-for-changes-ahead/library/wait_for_changes_ahead.py
index 4e436147..33944d63 100755
--- a/roles/wait-for-changes-ahead/library/wait_for_changes_ahead.py
+++ b/roles/wait-for-changes-ahead/library/wait_for_changes_ahead.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/bin/env python3
# Copyright (c) 2018 Red Hat
#
diff --git a/zuul.d/_jobs-base.yaml b/zuul.d/_jobs-base.yaml
index 934ef3a0..b31de697 100644
--- a/zuul.d/_jobs-base.yaml
+++ b/zuul.d/_jobs-base.yaml
@@ -10,6 +10,8 @@
roles:
- zuul: sf-jobs
- zuul: zuul-jobs
+ extra-vars:
+ zuul_use_fetch_output: true
timeout: 1800
attempts: 3
secrets:
diff --git a/zuul.d/_pipelines.yaml b/zuul.d/_pipelines.yaml
index 21438ea8..4c80f4b9 100644
--- a/zuul.d/_pipelines.yaml
+++ b/zuul.d/_pipelines.yaml
@@ -40,6 +40,8 @@
Verified: 0
mqtt:
topic: "zuul/{pipeline}/start/{project}/{branch}"
+ start-message: |
+ Starting {pipeline.name} jobs. Status at {status_url}
success:
github.com:
status: 'success'