diff options
Diffstat (limited to 'ansible/roles/osmocom-jenkins-slave')
7 files changed, 46 insertions, 226 deletions
diff --git a/ansible/roles/osmocom-jenkins-slave/README.md b/ansible/roles/osmocom-jenkins-slave/README.md index 50aed16..81f68b3 100644 --- a/ansible/roles/osmocom-jenkins-slave/README.md +++ b/ansible/roles/osmocom-jenkins-slave/README.md @@ -3,7 +3,6 @@ Support the following variables: * `install_jenkins_utilities`: (true) install usefull utilities including qemu/debootstrap/fakeroot -* `install_osmocom_build_deps`: (true) install all osmocom runtime and build time dependencies * `generic_slave`: (true) contains tasks used by the most osmocom jenkins slaves * `osmocom_jenkins_slave_fstrim`: (false) calls fstrim periodical * `ttcn3_slave`: (true) install titan ttcn3 compiler and prepares the docker-playground diff --git a/ansible/roles/osmocom-jenkins-slave/defaults/main.yml b/ansible/roles/osmocom-jenkins-slave/defaults/main.yml index 4e1f179..a4ce8ac 100644 --- a/ansible/roles/osmocom-jenkins-slave/defaults/main.yml +++ b/ansible/roles/osmocom-jenkins-slave/defaults/main.yml @@ -6,9 +6,6 @@ jenkins_user: jenkins # install usefull utilities including qemu/debootstrap/fakeroot install_jenkins_utilities: true -# install all osmocom runtime and build time dependencies -install_osmocom_build_deps: true - # E.g. a generic_slave requires different tasks as a # special slave including the gsm-tester generic_slave: true diff --git a/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml b/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml index 0c762e9..62beb8e 100644 --- a/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml +++ b/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml @@ -3,14 +3,15 @@ - name: install jenkins utilities apt: name: - - htop - - virt-manager - - qemu - - qemu-user-static - - qemu-system-arm - - proot + - bc - debootstrap - fakeroot + - htop + - proot + - python3-setuptools + - qemu-system-arm + - qemu-user-static + - virt-manager cache_valid_time: 3600 update_cache: yes install_recommends: no @@ -50,7 +51,7 @@ - name: install java for buster and later apt: name: - - openjdk-11-jre-headless + - default-jre-headless cache_valid_time: 3600 update_cache: yes install_recommends: no diff --git a/ansible/roles/osmocom-jenkins-slave/tasks/main.yml b/ansible/roles/osmocom-jenkins-slave/tasks/main.yml index 2623201..1868d97 100644 --- a/ansible/roles/osmocom-jenkins-slave/tasks/main.yml +++ b/ansible/roles/osmocom-jenkins-slave/tasks/main.yml @@ -22,19 +22,22 @@ shell: /bin/bash uid: 1000 -- name: setup jenkins ssh key +- name: setup jenkins ssh key (authorized_keys) authorized_key: user: "{{ jenkins_user }}" key: "{{ lookup('file', 'jenkins.osmocom.org.pub') }}" +- name: setup gerrit ssh key (known_hosts) + known_hosts: + name: '[gerrit.osmocom.org]:29418' + key: '[gerrit.osmocom.org]:29418 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDI4wZwtcGz2V98iZWWEtsA162PolLtgQTBjnC14ONzZGQkTh9bTPsoSxnM5TKOm4F2bzq7gb+Qrsj4ZECD19qztmD37kMP9jn7/2i1V8oLAy9ojyklXAdBVTliQteVI7ieDOyKCnGbszvFWXY2isoO1k7yJLv0QyL7F5AuZlxeHw==' + path: /etc/ssh/ssh_known_hosts + state: present + - name: install ttcn3 dependencies include_tasks: ttcn3-slave.yml when: ttcn3_slave and ansible_distribution == 'Debian' and ansible_distribution_version|int >= 9 and not (ansible_architecture == "armv7l" or ansible_architecture == "arm64") -- name: include osmocom_build_deps.yml - include_tasks: osmocom_build_deps.yml - when: install_osmocom_build_deps - - name: include generic slave include_tasks: generic-slave.yml when: generic_slave diff --git a/ansible/roles/osmocom-jenkins-slave/tasks/osmo-ci.yml b/ansible/roles/osmocom-jenkins-slave/tasks/osmo-ci.yml index b26d6ab..a2f2797 100644 --- a/ansible/roles/osmocom-jenkins-slave/tasks/osmo-ci.yml +++ b/ansible/roles/osmocom-jenkins-slave/tasks/osmo-ci.yml @@ -4,18 +4,26 @@ # we need to initially install osmo-ci and the docker images *before* # that jenkins job can execute subsequent updates +- name: install osmo-ci build dependencies + apt: + name: + - make + cache_valid_time: 3600 + update_cache: yes + install_recommends: no + - name: deploy osmo-ci to home directory become: yes become_user: "{{ jenkins_user }}" git: - repo: "https://git.osmocom.org/osmo-ci" + repo: "https://gerrit.osmocom.org/osmo-ci" dest: "/home/{{ jenkins_user }}/osmo-ci" - name: deploy osmo-gsm-manuals to home directory become: yes become_user: "{{ jenkins_user }}" git: - repo: "https://git.osmocom.org/osmo-gsm-manuals" + repo: "https://gerrit.osmocom.org/osmo-gsm-manuals" dest: "/home/{{ jenkins_user }}/osmo-gsm-manuals" - name: rebuild osmocom docker images for jenkins build tests diff --git a/ansible/roles/osmocom-jenkins-slave/tasks/osmocom_build_deps.yml b/ansible/roles/osmocom-jenkins-slave/tasks/osmocom_build_deps.yml deleted file mode 100644 index e2b5a98..0000000 --- a/ansible/roles/osmocom-jenkins-slave/tasks/osmocom_build_deps.yml +++ /dev/null @@ -1,190 +0,0 @@ ---- -- name: install build utilities - apt: - name: - - asciidoc - - autoconf - - autoconf-archive - - automake - - bc - - bison - - coccinelle - - cppcheck - - debhelper - - devscripts - - dh-autoreconf - - dh-systemd - - doxygen - - flex - - g++ - - gawk - - gcc - - gcc-arm-none-eabi - - git - - git-buildpackage - - graphviz - - libcsv-dev - - libtool - - libboost-all-dev - - make - - mscgen - - osc - - pkgconf - - python-minimal - - python-setuptools - - python3 - - python3-setuptools - - stow - - texinfo - # by gsm-manuals - - python3-nwdiag - - python-pychart - - inkscape - # by gapk - - libasound-dev - - libopencore-amrnb-dev - # by LimeSuite - - cmake - - patchelf - # by libusrp - - sdcc - # by mingw upload job - - rsync - cache_valid_time: 3600 - update_cache: yes - -- name: install build dependencies and libraries - apt: - name: - - dahdi-source - - docbook5-xml - - libboost-dev - - libc-ares-dev - - libdbd-sqlite3 - - libdbi-dev - - libffi-dev - - libffi-dev - - libfftw3-dev - - libgmp-dev - - libgnutls28-dev - - libgps-dev - - libgsm1-dev - - libnl-3-dev - - libnl-route-3-dev - - libmnl-dev - # by osmo-sysmon - - liboping-dev - - libncurses5-dev - - libortp-dev - - libpcap-dev - - libpcsclite-dev - - libreadline-dev - - libsctp-dev - - libsigsegv-dev - - libsnmp-dev - - libsofia-sip-ua-glib-dev - - libsqlite3-dev - - libssl-dev - - libsystemd-dev - - libtalloc-dev - - libuhd-dev - - libusb-1.0-0-dev - - libusb-dev - - libzmq3-dev - - sqlite3 - - libaio-dev - cache_valid_time: 3600 - update_cache: yes - install_recommends: no - -- name: install liblua for jessie - apt: - name: liblua5.3-dev - cache_valid_time: 3600 - update_cache: yes - install_recommends: no - default_release: jessie-backports - when: ansible_distribution == 'Debian' and ansible_distribution_release == 'jessie' - -- name: install liblua for stretch or later - apt: - name: - - liblua5.3-dev - cache_valid_time: 3600 - update_cache: yes - install_recommends: no - when: ansible_distribution == 'Debian' and ansible_distribution_version|int >= 9 - -- name: install liblimesuite-dev for stretch or later - apt: - name: - - liblimesuite-dev - cache_valid_time: 3600 - update_cache: yes - install_recommends: no - when: ansible_distribution == 'Debian' and ansible_distribution_version|int >= 9 - -- name: install osmo-remsim dependencies - apt: - name: - - libjansson-dev - - libulfius-dev - cache_valid_time: 3600 - update_cache: yes - when: ansible_distribution == 'Debian' and ansible_distribution_version|int >= 9 - -- name: install srsLTE build dependencies - apt: - name: - - cmake - - libfftw3-dev - - libmbedtls-dev - - libboost-program-options-dev - - libconfig++-dev - - libsctp-dev - - libpcsclite-dev - - libuhd-dev - - libczmq-dev - - libsoapysdr-dev - cache_valid_time: 3600 - update_cache: yes - when: ansible_distribution == 'Debian' and ansible_distribution_version|int >= 9 - -- name: install open5gs build dependencies - apt: - name: - - meson - - ninja-build - - libgcrypt-dev - - libidn11-dev - - libmongoc-dev - - libbson-dev - - libyaml-dev - - libnghttp2-dev - cache_valid_time: 3600 - update_cache: yes - when: ansible_distribution == 'Debian' and ansible_distribution_version|int >= 10 - -- name: download osmo-python-tests for py2 - git: - repo: "https://gerrit.osmocom.org/python/osmo-python-tests" - dest: "/home/{{ jenkins_user }}/osmo-python-tests2" - version: "fb4b813d4df62b7b2445bdced961eb1847267eed" - -- name: install osmo-python-tests for py2 - shell: - cmd: "python2 setup.py clean build install && date > installed" - chdir: "/home/{{ jenkins_user }}/osmo-python-tests2" - creates: "/home/{{ jenkins_user }}/osmo-python-tests2/installed" - -- name: download osmo-python-tests for py3 - git: - repo: "https://gerrit.osmocom.org/python/osmo-python-tests" - dest: "/home/{{ jenkins_user }}/osmo-python-tests3" - version: "be7fcf5f28a5d0f9ad35510f09b5979268d76598" - -- name: install osmo-python-tests for py3 - shell: - cmd: "python3 setup.py clean build install && date > installed" - chdir: "/home/{{ jenkins_user }}/osmo-python-tests3" - creates: "/home/{{ jenkins_user }}/osmo-python-tests3/installed" diff --git a/ansible/roles/osmocom-jenkins-slave/tasks/ttcn3-slave.yml b/ansible/roles/osmocom-jenkins-slave/tasks/ttcn3-slave.yml index fbfc1ec..4237073 100644 --- a/ansible/roles/osmocom-jenkins-slave/tasks/ttcn3-slave.yml +++ b/ansible/roles/osmocom-jenkins-slave/tasks/ttcn3-slave.yml @@ -1,4 +1,12 @@ --- +- name: install programs used in jenkins.sh + apt: + name: + - netcat-openbsd + - sudo + cache_valid_time: 3600 + update_cache: yes + install_recommends: no - name: ensure jenkins folder exists become: yes @@ -11,33 +19,27 @@ become: yes become_user: "{{ jenkins_user }}" git: - repo: "https://git.osmocom.org/docker-playground" + repo: "https://gerrit.osmocom.org/docker-playground" dest: "/home/{{ jenkins_user }}/jenkins/docker-playground" - name: add apt.key - apt_key: - url: https://download.opensuse.org/repositories/network:/osmocom:/latest/{{ obs_distro }}/Release.key + get_url: + url: https://obs.osmocom.org/projects/osmocom/public_key + dest: /etc/apt/trusted.gpg.d/obs.osmocom.org.asc + # OBS webserver needs this header, returns 404 otherwise + # https://github.com/ansible/ansible/issues/50436#issuecomment-451205256 + headers: + Accept: '*/*' - name: add apt repository apt_repository: - repo: "deb http://download.opensuse.org/repositories/network:/osmocom:/latest/{{ obs_distro }}/ ./" + repo: "deb [signed-by=/etc/apt/trusted.gpg.d/obs.osmocom.org.asc] https://downloads.osmocom.org/packages/osmocom:/latest/{{ obs_distro }}/ ./" filename: obs_osmocom update_cache: yes -- name: install titan +- name: install libosmocore-utils apt: - name: eclipse-titan + name: + - libosmocore-utils update_cache: yes cache_valid_time: 3600 - -- name: Get DEB architecture - shell: dpkg --print-architecture - register: deb_architecture - -- name: Install libfftranscode0 - apt: - deb: https://ftp.osmocom.org/binaries/libfftranscode/libfftranscode0_0.3_{{deb_architecture.stdout}}.deb - -- name: Install libfftranscode-dev - apt: - deb: https://ftp.osmocom.org/binaries/libfftranscode/libfftranscode-dev_0.3_{{deb_architecture.stdout}}.deb |