Project

Profile

Help

Prepare slave for run test

Overview

This article will guide you through configuring slave for executing run_test https://github.com/mariadb-corporation/build-scripts-vagrant/blob/master/test/run_test.sh

Prepare mdbci and access rights

Do https://dev.osll.ru/projects/mdbci/wiki/Prepare_slave_for_mdbci_and_configure_access_rights

Prepare repositories (NOTE: scripts below does that - no need to manually loading repositories)

Preparation scripts and sequence (current order is important)

Generate and copy slave ssh key to max-tst-01:

ssh-keygen -t rsa
cat .ssh/id_rsa.pub | ssh vagrant@max-tst-01.mariadb.com 'cat >> .ssh/authorized_keys' # will ask for vagrant password

Run script (from MDBCI folder):

./scripts/setup_as_slave.sh

After that you need to logout and login

exec su $USER

And you need to prepare vagrant user with all needed privileges
Add to the /etc/sudoers.d/vagrant next lines:

Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/tee -a /etc/exports
Cmnd_Alias VAGRANT_EXPORTS_COPY = /bin/cp /tmp/exports /etc/exports
Cmnd_Alias VAGRANT_NFSD_CHECK = /etc/init.d/nfs-kernel-server status
Cmnd_Alias VAGRANT_NFSD_START = /etc/init.d/nfs-kernel-server start
Cmnd_Alias VAGRANT_NFSD_APPLY = /usr/sbin/exportfs -ar
Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /bin/sed -r -e * d -ibak /tmp/exports
%sudo ALL=(root) NOPASSWD: VAGRANT_EXPORTS_ADD, VAGRANT_NFSD_CHECK, VAGRANT_NFSD_START, VAGRANT_NFSD_APPLY, VAGRANT_EXPORTS_REMOVE, VAGRANT_EXPORTS_COPY

Relogin

exec su $USER

Disable some authentifications for ssh (without it Jenkins unable to connect to slave)

Find in '/etc/ssh/sshd_config' on slave this lines and comment them:

Ciphers aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-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,hmac-ripemd160
KexAlgorithms diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1

Restart ssh:

service ssh restart

Issue with length of key

In java, sometimes, long key can not be used, for that we need to install java with jce:

sudo add-apt-repository ppa:webupd8team/java
sudo apt update
sudo apt install oracle-java7-unlimited-jce-policy

And update executables:

sudo update-java-alternatives -s java-7-oracle