diff --git a/ansible/README.md b/ansible/README.md index dce781155..324a8eb5b 100644 --- a/ansible/README.md +++ b/ansible/README.md @@ -43,6 +43,18 @@ If you only want to run a specific set of steps, you can use `--step`. This is useful when developing playbooks and when you want to be sure that only a few steps are executed, to avoid disrupting the machines. +You can't run any playbooks on a host until you've manually created a +`build:ansible/host_vars/HOST` file for that host (same name as the argument +to limit, above). Use `host_vars/test-marist-zos13-s390x-templat` as an +example. The `secret:` doesn't have to be the real Jenkins secret until the +worker actually has to connect to the master. + +You may also need to copy the SSH ID files you are using while setting up a new +host to the correct file name, for example: +```console +$ cp ~/.ssh/rhel72-s390x-3.pem /home/sam/.ssh/nodejs_build_test +``` + ### Secrets If you have access to secrets, clone the `secrets` repository [next to the diff --git a/ansible/host_vars/test-marist-zos13-s390x-template b/ansible/host_vars/test-marist-zos13-s390x-template index 4cd4e802c..613113e45 100644 --- a/ansible/host_vars/test-marist-zos13-s390x-template +++ b/ansible/host_vars/test-marist-zos13-s390x-template @@ -1,4 +1,4 @@ -secret: +secret: JENKINS_SECRET remote_env: FFI_LIB: /NODEJS2/python-2017-04-12-py27/python27/lib/ffi PYTHON_ENV: python27 diff --git a/ansible/inventory.yml b/ansible/inventory.yml index 133e94d3c..e6bba8784 100644 --- a/ansible/inventory.yml +++ b/ansible/inventory.yml @@ -119,7 +119,7 @@ hosts: - linuxonecc: rhel72-s390x-1: {ip: 148.100.110.63} rhel72-s390x-2: {ip: 148.100.110.64} - rhel72-s390x-3: {ip: 148.100.110.12} + rhel72-s390x-3: {ip: 148.100.110.153} - mininodes: ubuntu1604-arm64_odroid_c2-1: {ip: 70.167.220.147} diff --git a/ansible/playbooks/jenkins/worker/create.yml b/ansible/playbooks/jenkins/worker/create.yml index 617d7e751..7b2b27a8d 100644 --- a/ansible/playbooks/jenkins/worker/create.yml +++ b/ansible/playbooks/jenkins/worker/create.yml @@ -20,9 +20,14 @@ - jenkins-worker pre_tasks: +# Requires `secret: XXX` to be in the ansible/host_vars/HOST +# file, where XXX is the jenkins secret used to connect to the master, +# and HOST is the full ansible host name. - name: check if secret is properly set fail: failed_when: not secret +# Requires `additional_drive: /dev/dasdb1` to be in the ansible/host_vars/HOST +# file, where HOST is the full ansible host name. - name: check if additional_drive is properly set fail: failed_when: not additional_drive diff --git a/ansible/roles/baselayout/tasks/ccache.yml b/ansible/roles/baselayout/tasks/ccache.yml index ecd0d0252..14bb31428 100644 --- a/ansible/roles/baselayout/tasks/ccache.yml +++ b/ansible/roles/baselayout/tasks/ccache.yml @@ -5,7 +5,10 @@ # - name: "ccache : fetch samba ccache HTML page" - local_action: shell curl -sL https://www.samba.org/ftp/ccache/ + # This depends on ansible being able to run curl locally, YMMV, if it doesn't + # work, try changing the local_action to a remote one: + # raw: curl -sL https://www.samba.org/ftp/ccache/ + local_action: command shell -sL https://www.samba.org/ftp/ccache/ register: ccache_html_content - name: "ccache : extract ccache latest version" diff --git a/ansible/roles/baselayout/vars/main.yml b/ansible/roles/baselayout/vars/main.yml index d8d128044..0ff8a872f 100644 --- a/ansible/roles/baselayout/vars/main.yml +++ b/ansible/roles/baselayout/vars/main.yml @@ -71,7 +71,7 @@ packages: { ], rhel72: [ - 'gcc-c++,sudo', + 'gcc-c++,sudo,git,zip,unzip', ], smartos: [ diff --git a/ansible/roles/gcc/tasks/main.yml b/ansible/roles/gcc/tasks/main.yml index 988796fbb..39ed571cc 100644 --- a/ansible/roles/gcc/tasks/main.yml +++ b/ansible/roles/gcc/tasks/main.yml @@ -2,225 +2,258 @@ # # installs gcc 4.9 @ /data/gcc-4.9 on rhel7.x +# and gcc 6.3 @ /data/gcc-6.3 # -- stat: path=/data/gcc-4.9/bin/gcc-4.9 - register: build_gcc_49 - tags: gcc49 + +## gmp-6.1 + +- stat: path=/data/gmp-6.1/include/gmp.h + register: build_gmp + tags: gcc - name: Clean path file: state: absent path: /data/tmp/ - when: build_gcc_49.stat.exists == False - tags: gcc49 + when: build_gmp.stat.exists == False + tags: gcc + - name: Create working directory file: path: /data/tmp state: directory mode: 0755 - when: build_gcc_49.stat.exists == False - tags: gcc49 + when: build_gmp.stat.exists == False + tags: gcc - name: download gmp 6.1.0 get_url: url: http://ftp.gnu.org/gnu/gmp/gmp-6.1.0.tar.xz dest: /data/tmp/ - when: build_gcc_49.stat.exists == False - tags: gcc49 + when: build_gmp.stat.exists == False + tags: gcc - name: unarchive gmp 6.1.0 unarchive: src: /data/tmp/gmp-6.1.0.tar.xz remote_src: yes dest: /data/tmp/ - when: build_gcc_49.stat.exists == False - tags: gcc49 + when: build_gmp.stat.exists == False + tags: gcc - name: Create build directory file: path: /data/tmp/build state: directory mode: 0755 - when: build_gcc_49.stat.exists == False - tags: gcc49 + when: build_gmp.stat.exists == False + tags: gcc - name: configure gmp 6.1.0 - shell: /data/tmp/gmp-6.1.0/configure --prefix=/data/gcc-4.9 + shell: /data/tmp/gmp-6.1.0/configure --prefix=/data/gmp-6.1 args: chdir: /data/tmp/build - when: build_gcc_49.stat.exists == False - tags: gcc49 + when: build_gmp.stat.exists == False + tags: gcc - name: build gmp 6.1.0 shell: make -j{{ ansible_processor_cores }} install args: chdir: /data/tmp/build - when: build_gcc_49.stat.exists == False - tags: gcc49 + when: build_gmp.stat.exists == False + tags: gcc + + +## mpfr-3.1 + +- stat: path=/data/mpfr-3.1/include/mpfr.h + register: build_mpfr + tags: gcc - name: Clean path file: state: absent path: /data/tmp/ - when: build_gcc_49.stat.exists == False - tags: gcc49 + when: build_mpfr.stat.exists == False + tags: gcc - name: Create working directory file: path: /data/tmp state: directory mode: 0755 - when: build_gcc_49.stat.exists == False - tags: gcc49 + when: build_mpfr.stat.exists == False + tags: gcc - name: download mprf 3.1.4 get_url: url: http://ftp.gnu.org/gnu/mpfr/mpfr-3.1.4.tar.gz dest: /data/tmp/ - when: build_gcc_49.stat.exists == False - tags: gcc49 + when: build_mpfr.stat.exists == False + tags: gcc - name: unarchive mprf 3.1.4 unarchive: src: /data/tmp/mpfr-3.1.4.tar.gz remote_src: yes dest: /data/tmp/ - when: build_gcc_49.stat.exists == False - tags: gcc49 + when: build_mpfr.stat.exists == False + tags: gcc - name: Create build directory file: path: /data/tmp/build state: directory mode: 0755 - when: build_gcc_49.stat.exists == False - tags: gcc49 + when: build_mpfr.stat.exists == False + tags: gcc - name: build mprf 3.1.4 - shell: /data/tmp/mpfr-3.1.4/configure --with-gmp=/data/gcc-4.9 --prefix=/data/gcc-4.9 + shell: /data/tmp/mpfr-3.1.4/configure --with-gmp=/data/gmp-6.1 --prefix=/data/mpfr-3.1 args: chdir: /data/tmp/build - when: build_gcc_49.stat.exists == False - tags: gcc49 + when: build_mpfr.stat.exists == False + tags: gcc - name: build mprf 3.1.4 shell: make -j{{ ansible_processor_cores }} install args: chdir: /data/tmp/build - when: build_gcc_49.stat.exists == False - tags: gcc49 + when: build_mpfr.stat.exists == False + tags: gcc + +## mpc-1.0 + +- stat: path=/data/mpc-1.0/include/mpc.h + register: build_mpc + tags: gcc - name: Clean path file: state: absent path: /data/tmp/ - when: build_gcc_49.stat.exists == False - tags: gcc49 + when: build_mpc.stat.exists == False + tags: gcc + - name: Create working directory file: path: /data/tmp state: directory mode: 0755 - when: build_gcc_49.stat.exists == False - tags: gcc49 + when: build_mpc.stat.exists == False + tags: gcc - name: download mpc 1.0.3 get_url: url: http://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz dest: /data/tmp/ - when: build_gcc_49.stat.exists == False - tags: gcc49 + when: build_mpc.stat.exists == False + tags: gcc - name: unarchive mpc 1.0.3 unarchive: src: /data/tmp/mpc-1.0.3.tar.gz remote_src: yes dest: /data/tmp/ - when: build_gcc_49.stat.exists == False - tags: gcc49 + when: build_mpc.stat.exists == False + tags: gcc - name: Create build directory file: path: /data/tmp/build state: directory mode: 0755 - when: build_gcc_49.stat.exists == False - tags: gcc49 + when: build_mpc.stat.exists == False + tags: gcc - name: configure mpc 1.0.3 - shell: /data/tmp/mpc-1.0.3/configure --with-mpfr=/data/gcc-4.9 --with-gmp=/data/gcc-4.9 --prefix=/data/gcc-4.9 + shell: /data/tmp/mpc-1.0.3/configure --with-mpfr=/data/mpfr-3.1 --with-gmp=/data/gmp-6.1 --prefix=/data/mpc-1.0 args: chdir: /data/tmp/build - when: build_gcc_49.stat.exists == False - tags: gcc49 + when: build_mpc.stat.exists == False + tags: gcc - name: build mpc 1.0.3 shell: make -j{{ ansible_processor_cores }} install args: chdir: /data/tmp/build - when: build_gcc_49.stat.exists == False - tags: gcc49 + when: build_mpc.stat.exists == False + tags: gcc + + +## binutils-2.28 + +- stat: path=/data/binutils-2.28/bin/ranlib + register: build_binutils + tags: gcc - name: Clean path file: state: absent path: /data/tmp/ - when: build_gcc_49.stat.exists == False - tags: gcc49 + when: build_binutils.stat.exists == False + tags: gcc - name: Create working directory file: path: /data/tmp state: directory mode: 0755 - when: build_gcc_49.stat.exists == False - tags: gcc49 + when: build_binutils.stat.exists == False + tags: gcc - name: download binutils 2.28.1 get_url: url: https://ftp.gnu.org/gnu/binutils/binutils-2.28.1.tar.gz dest: /data/tmp/ - when: build_gcc_49.stat.exists == False - tags: gcc49 + when: build_binutils.stat.exists == False + tags: gcc - name: unarchive binutils 2.28.1 unarchive: src: /data/tmp/binutils-2.28.1.tar.gz remote_src: yes dest: /data/tmp/ - when: build_gcc_49.stat.exists == False - tags: gcc49 + when: build_binutils.stat.exists == False + tags: gcc - name: Create build directory file: path: /data/tmp/build state: directory mode: 0755 - when: build_gcc_49.stat.exists == False - tags: gcc49 + when: build_binutils.stat.exists == False + tags: gcc - name: configure binutils 2.28.1 - shell: /data/tmp/binutils-2.28.1/configure --with-mpfr=/data/gcc-4.9 --with-gmp=/data/gcc-4.9 --prefix=/data/gcc-4.9 + shell: /data/tmp/binutils-2.28.1/configure --with-mpfr=/data/mpfr-3.1 --with-gmp=/data/gmp-6.1 --prefix=/data/binutils-2.28 args: chdir: /data/tmp/build - when: build_gcc_49.stat.exists == False - tags: gcc49 + when: build_binutils.stat.exists == False + tags: gcc - name: build binutils 2.28.1 shell: make -j{{ ansible_processor_cores }} args: chdir: /data/tmp/build - when: build_gcc_49.stat.exists == False - tags: gcc49 + when: build_binutils.stat.exists == False + tags: gcc - name: install binutils 2.28.1 shell: make install args: chdir: /data/tmp/build - when: build_gcc_49.stat.exists == False + when: build_binutils.stat.exists == False + tags: gcc + + +## gcc-4.9 + +- stat: path=/data/gcc-4.9/bin/gcc-4.9 + register: build_gcc_49 tags: gcc49 - name: Clean path @@ -262,7 +295,7 @@ tags: gcc49 - name: configure gcc4.9 - shell: /data/tmp/gcc-4.9.4/configure --with-mpfr=/data/gcc-4.9 --with-gmp=/data/gcc-4.9 --prefix=/data/gcc-4.9 --program-suffix=-4.9 --disable-multilib + shell: /data/tmp/gcc-4.9.4/configure --with-mpfr=/data/mpfr-3.1 --with-gmp=/data/gmp-6.1 --with-mpc=/data/mpc-1.0 --prefix=/data/gcc-4.9 --program-suffix=-4.9 --disable-multilib args: chdir: /data/tmp/build when: build_gcc_49.stat.exists == False @@ -290,3 +323,79 @@ path: /data/tmp/ when: build_gcc_49.stat.exists == False tags: gcc49 + + +## gcc-6.3 + +- stat: path=/data/gcc-6.3/bin/gcc-6.3 + register: build_gcc_63 + tags: gcc63 + +- name: Clean path + file: + state: absent + path: /data/tmp/ + when: build_gcc_63.stat.exists == False + tags: gcc63 + +- name: Create working directory + file: + path: /data/tmp + state: directory + mode: 0755 + when: build_gcc_63.stat.exists == False + tags: gcc63 + +- name: download gcc 6.3.0 + get_url: + url: http://ftp.gnu.org/gnu/gcc/gcc-6.3.0/gcc-6.3.0.tar.gz + dest: /data/tmp/ + when: build_gcc_63.stat.exists == False + tags: gcc63 + +- name: unarchive gcc 6.3.0 + unarchive: + src: /data/tmp/gcc-6.3.0.tar.gz + remote_src: yes + dest: /data/tmp/ + when: build_gcc_63.stat.exists == False + tags: gcc63 + +- name: Create build directory + file: + path: /data/tmp/build + state: directory + mode: 0755 + when: build_gcc_63.stat.exists == False + tags: gcc63 + +# gcc6.3 needs a g++ with '-no-pie', and system default of 4.8 does not +- name: configure gcc6.3 + shell: CC=/data/gcc-4.9/bin/gcc-4.9 CXX=/data/gcc-4.9/bin/g++-4.9 /data/tmp/gcc-6.3.0/configure --with-mpfr=/data/mpfr-3.1 --with-gmp=/data/gmp-6.1 --with-mpc=/data/mpc-1.0 --prefix=/data/gcc-6.3 --program-suffix=-6.3 --disable-multilib + args: + chdir: /data/tmp/build + when: build_gcc_63.stat.exists == False + tags: gcc63 + +- name: build gcc63 + shell: make -j{{ ansible_processor_cores }} + async: 7000 + poll: 10 + args: + chdir: /data/tmp/build + when: build_gcc_63.stat.exists == False + tags: gcc63 + +- name: install gcc63 + shell: make install + args: + chdir: /data/tmp/build + when: build_gcc_63.stat.exists == False + tags: gcc63 + +- name: Clean path + file: + state: absent + path: /data/tmp/ + when: build_gcc_63.stat.exists == False + tags: gcc63 diff --git a/doc/non-ansible-configuration-notes.md b/doc/non-ansible-configuration-notes.md index 001b27179..7176fbd66 100644 --- a/doc/non-ansible-configuration-notes.md +++ b/doc/non-ansible-configuration-notes.md @@ -29,7 +29,7 @@ To use Ansible for Windows, PowerShell access should be enabled as described in ### Control machine (where Ansible is run) -Install the `pywinrm` pip module. +Install the `pywinrm` pip module: `pip install pywinrm` ### Target machines diff --git a/doc/ssh.md b/doc/ssh.md index 643abaed8..01fe247b5 100644 --- a/doc/ssh.md +++ b/doc/ssh.md @@ -29,7 +29,20 @@ for build working group members. install ansible on your local machine. 5. Run `ansible-playbook playbooks/write-ssh-config.yml` from the `ansible/` directory in the root of this repo, then the host information will be - written into your `~/.ssh/config`. + written into your `~/.ssh/config`. If you got here from the top-level + README.md, you get to this step before getting to the Secrets section, go + do that setup. You may get an ERROR, but all the playbook commands were run, + check your `~/.ssh/config` to ensure it was updated with the names of all + the machines from inventory.yml. Example "error": +``` +[DEPRECATION WARNING]: DEFAULT_SQUASH_ACTIONS option, Loop squashing is +deprecated and + this configuration will no longer be used , use a list directly with the module + argument instead. This feature will be removed in version 2.11. Deprecation + warnings + can be disabled by setting deprecation_warnings=False in ansible.cfg. + [ERROR]: WARNING: could not find secrets, please define NODE_BUILD_SECRETS +``` 6. Try logging into one of the machines that you have access to. In the `~/.ssh/config` file, the first word in the `Host` indicates the group that the machine is in, and the `IdentityFile` for each host can be @@ -42,7 +55,7 @@ for build working group members. If everything is set up correctly, you should be able to log into the machine without passwords. By default you will log into the machine as `root` (except macOS machines and some raspberry Pis), -but it is recommended to switch to the `iojs` user (run `su iojs` or -`sudo su iojs` for non-root logins) before performing any actions. +but it is recommended to switch to the `iojs` user (run `su - iojs` or +`sudo su - iojs` for non-root logins) before performing any actions. [secrets repo]: https://github.com/nodejs-private/secrets diff --git a/jenkins/scripts/select-compiler.sh b/jenkins/scripts/select-compiler.sh index 67a833167..29a787233 100644 --- a/jenkins/scripts/select-compiler.sh +++ b/jenkins/scripts/select-compiler.sh @@ -44,8 +44,12 @@ elif [ "$SELECT_ARCH" = "S390X" ]; then echo "Setting compiler for Node version $NODEJS_MAJOR_VERSION on s390x" - if [ "$NODEJS_MAJOR_VERSION" -gt "9" ]; then - export PATH="/data/gcc-4.9/bin:$PATH" + if [ "$NODEJS_MAJOR_VERSION" -gt "11" ]; then + export PATH="/data/gcc-6.3/bin:/data/binutils-2.28/bin:$PATH" + export LD_LIBRARY_PATH="/data/gcc-6.3/lib64:$LD_LIBRARY_PATH" + export COMPILER_LEVEL="-6.3" + elif [ "$NODEJS_MAJOR_VERSION" -gt "9" ]; then + export PATH="/data/gcc-4.9/bin:/data/binutils-2.28/bin:$PATH" export LD_LIBRARY_PATH="/data/gcc-4.9/lib64:$LD_LIBRARY_PATH" export COMPILER_LEVEL="-4.9" fi