diff --git a/ansible/MANUAL_STEPS.md b/ansible/MANUAL_STEPS.md index 361ff33b9..402a5e8e1 100644 --- a/ansible/MANUAL_STEPS.md +++ b/ansible/MANUAL_STEPS.md @@ -2,6 +2,7 @@ * [Adding firewall entries for Jenkins workers](#adding-firewall-entries-for-jenkins-workers) * [`release-*` machines](#release--machines) + * [`release-*container*` machines](#release-container-machines) * [macOS release machines](#macos-release-machines) * [Full Xcode](#full-xcode) * [Signing certificates](#signing-certificates) @@ -15,7 +16,6 @@ * [Install XL compilers](#install-xl-compilers) * [Fix "Missing" shared objects](#fix-missing-shared-objects) * [Preparing gcc distributables](#preparing-gcc-distributables) - * [Preparing ccache distributables](#preparing-ccache-distributables) * [Windows (Azure/Rackspace)](#windows-azurerackspace) * [Control machine (where Ansible is run)](#control-machine-where-ansible-is-run) * [Target machines](#target-machines) @@ -50,7 +50,8 @@ To add an entry do the following: Once setup, they must have `~iojs/.ssh` cloned from another machine, so they have the ssh setup and keys required to upload release artifacts to the nodejs.org web server. The result will be 2 files, an `id_rsa` containing -a private key, and a config containing: +a private key, and a `config` containing: + ``` Host node-www HostName direct.nodejs.org @@ -58,6 +59,9 @@ Host node-www IdentityFile ~/.ssh/id_rsa ``` +Both the `config` file and `id_rsa` should be owned and only readable by the +user: `chmod 700 .ssh && chmod 600 .ssh/*`. + Its necessary to accept the `known_hosts` keys interactively on first ssh or the release builds will fail. After setting up .ssh, do something like this: @@ -66,6 +70,21 @@ ssh node-www date // ... accept the host keys ``` +### `release-*container*` machines + +In the case of Docker container release hosts, the SSH configuration above works +differently since the `~iojs` home directories are elsewhere on the host +machine. The Docker containers are started with `/home/iojs` inside the +container mounted from `/home/iojs/name-of-container/` on the host machine. +Therefore, the above SSH configuration should take place in +`/home/iojs/name-of-container/.ssh/`, with permissions set appropriately. + +`known_hosts` can be primed and SSH tested from within the running containers: + +1. Find the running container ID using `docker ps` +2. Enter the container using `docker exec -ti bash` +3. Run `ssh node-www date` (as above) + ### macOS release machines Previous notes: [#1393](https://github.com/nodejs/build/issues/1393) diff --git a/ansible/inventory.yml b/ansible/inventory.yml index cafcf270b..6abf4d8d9 100644 --- a/ansible/inventory.yml +++ b/ansible/inventory.yml @@ -42,7 +42,7 @@ hosts: smartos15-x64-2: {ip: 165.225.148.139} smartos17-x64-2: {ip: 165.225.149.208} smartos18-x64-2: {ip: 165.225.148.12} - ubuntu1604_arm_cross-x64-1: {ip: 165.225.151.28, user: ubuntu} + ubuntu1804_docker-x64-1: {ip: 165.225.150.76, user: ubuntu} - macstadium: macos10.11-x64-1: {ip: 207.254.58.162, port: 10013, user: administrator} @@ -50,7 +50,7 @@ hosts: - marist: zos13-s390x-1: {ip: 148.100.36.135, user: Unix1} - + - nearform: macos10.15-x64-1: {ip: 83.147.191.69, user: administrator} @@ -83,7 +83,6 @@ hosts: - test: - azure: - msft-ubuntu1604_arm_cross-x64-1: {ip: nodejs.eastus2.cloudapp.azure.com, user: ubuntu} msft-win10_vcbt2015-x64-1: {ip: nodejs.eastus2.cloudapp.azure.com} msft-win10_vcbt2015-x64-2: {ip: nodejs.westus2.cloudapp.azure.com} msft-win10_vcbt2015-x64-3: {ip: nodejs.eastus2.cloudapp.azure.com} @@ -132,7 +131,6 @@ hosts: smartos17-x64-4: {ip: 165.225.148.16} smartos18-x64-3: {ip: 165.225.151.114} smartos18-x64-4: {ip: 165.225.149.13} - ubuntu1604_arm_cross-x64-1: {ip: 165.225.149.35, user: ubuntu} ubuntu1804_docker-x64-1: {ip: 165.225.151.201, user: ubuntu} ubuntu1804-x64-1: {ip: 165.225.149.88, user: ubuntu} diff --git a/ansible/playbooks/jenkins/docker-host.yaml b/ansible/playbooks/jenkins/docker-host.yaml index 3d7316c8c..ff0b5628f 100644 --- a/ansible/playbooks/jenkins/docker-host.yaml +++ b/ansible/playbooks/jenkins/docker-host.yaml @@ -6,6 +6,7 @@ - hosts: - test + - release roles: - bootstrap diff --git a/ansible/playbooks/jenkins/worker/create.yml b/ansible/playbooks/jenkins/worker/create.yml index b0eb88266..bf5425579 100644 --- a/ansible/playbooks/jenkins/worker/create.yml +++ b/ansible/playbooks/jenkins/worker/create.yml @@ -18,8 +18,6 @@ - { role: 'benchmarking', when: is_benchmark is defined and is_benchmark|bool == True } - jenkins-worker - - { role: 'cross-compiler', - when: "'arm_cross' in inventory_hostname" } pre_tasks: # Requires `secret: XXX` to be in the ansible/host_vars/HOST diff --git a/ansible/roles/cross-compiler/tasks/main.yml b/ansible/roles/cross-compiler/tasks/main.yml deleted file mode 100644 index e933a162c..000000000 --- a/ansible/roles/cross-compiler/tasks/main.yml +++ /dev/null @@ -1,46 +0,0 @@ ---- - -# -# sets up cross compiler machine -# - -- name: add ubuntu toolchain ppa - apt_repository: - repo: ppa:ubuntu-toolchain-r/test - -- name: upgrade installed packages - apt: - upgrade: dist - update_cache: yes - -- name: install required packages - apt: - name: "{{ packages }}" - update_cache: yes - state: latest - -- name: increase file descriptor limits - lineinfile: - dest: /etc/security/limits.conf - line: "{{ item }}" - with_items: - - "* hard nofile 500000" - - "* soft nofile 500000" - - "root hard nofile 500000" - - "root soft nofile 500000" - -- name: clone raspberry tools repository - git: - repo: https://github.com/raspberrypi/tools.git - dest: /opt/raspberrypi/tools - -- name: clone newer raspberry tools repository - git: - repo: https://github.com/rvagg/rpi-newer-crosstools.git - dest: /opt/raspberrypi/rpi-newer-crosstools - -- name: copy cc-selector.sh script - copy: - src: ./files/cc-selector.sh - dest: /opt/raspberrypi/cc-selector.sh - mode: 0755 diff --git a/ansible/roles/cross-compiler/vars/main.yml b/ansible/roles/cross-compiler/vars/main.yml deleted file mode 100644 index d92cce757..000000000 --- a/ansible/roles/cross-compiler/vars/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- - -packages: make,gcc-4.8-multilib,g++-4.8-multilib,gcc-4.9-multilib,g++-4.9-multilib,gcc-6-multilib,g++-6-multilib,python2.7,python-all,python-software-properties,curl -server_user: iojs diff --git a/ansible/roles/cross-compiler/files/cc-selector.sh b/ansible/roles/docker/files/cc-selector.sh similarity index 62% rename from ansible/roles/cross-compiler/files/cc-selector.sh rename to ansible/roles/docker/files/cc-selector.sh index 5c3bee530..18d9bd01d 100755 --- a/ansible/roles/cross-compiler/files/cc-selector.sh +++ b/ansible/roles/docker/files/cc-selector.sh @@ -1,22 +1,14 @@ # create CC, CXX, CC_host and CXX_host environment variables appropriate for the -# worker label in use. Of the form: cross-compiler-armv[67]-gcc-(4\.[89](\.4)?|6|8) - -# Possible labels: -# cross-compiler-armv6-gcc-4.8 -# cross-compiler-armv7-gcc-4.8 -# cross-compiler-armv6-gcc-4.9 -# cross-compiler-armv7-gcc-4.9 -# cross-compiler-armv6-gcc-4.9.4 -# cross-compiler-armv7-gcc-4.9.4 -# cross-compiler-armv6-gcc-6 -# cross-compiler-armv7-gcc-6 -# cross-compiler-armv6-gcc-8 -# cross-compiler-armv7-gcc-8 - -rpi_tools_base="/opt/raspberrypi/tools/" +# worker label in use. Of the form: cross-compiler-ubuntu1[68]04-armv[67]-gcc-(4\.9.4?|6|8) + +# Expected labels: +# cross-compiler-ubuntu1604-armv6-gcc-4.9.4 +# cross-compiler-ubuntu1604-armv7-gcc-4.9.4 +# cross-compiler-ubuntu1604-armv7-gcc-6 +# cross-compiler-ubuntu1804-armv7-gcc-6 +# cross-compiler-ubuntu1804-armv7-gcc-8 + rpi_newer_tools_base="/opt/raspberrypi/rpi-newer-crosstools/" -base_4_8="${rpi_tools_base}arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-" -base_4_9="${rpi_tools_base}arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-" base_4_9_4="${rpi_newer_tools_base}x64-gcc-4.9.4-binutils-2.28/arm-rpi-linux-gnueabihf/bin/arm-rpi-linux-gnueabihf-" base_6="${rpi_newer_tools_base}x64-gcc-6.5.0/arm-rpi-linux-gnueabihf/bin/arm-rpi-linux-gnueabihf-" base_8="${rpi_newer_tools_base}x64-gcc-8.3.0/arm-rpi-linux-gnueabihf/bin/arm-rpi-linux-gnueabihf-" @@ -26,15 +18,15 @@ flags_armv7="-march=armv7-a" function run { local label="$1" - export arm_type=$(echo $label | sed -E 's/^cross-compiler-(armv[67])-gcc-.*$/\1/') - export gcc_version=$(echo $label | sed -E 's/^cross-compiler-armv[67]-gcc-(4\.[89](\.4)?|6|8)/\1/') + export arm_type=$(echo $label | sed -E 's/^cross-compiler-ubuntu1[68]04-(armv[67])-gcc-.*$/\1/') + export gcc_version=$(echo $label | sed -E 's/^cross-compiler-ubuntu1[68]04-armv[67]-gcc-(4\.9\.4|6|8)/\1/') export git_branch="cc-${arm_type}" if [[ ! "$arm_type" =~ ^armv[67]$ ]]; then echo "Could not determine ARM type from '$label'" exit 1 fi - if [[ ! "$gcc_version" =~ ^(4\.[89](\.4)?|6|8)$ ]]; then + if [[ ! "$gcc_version" =~ ^(4\.9\.4|6|8)$ ]]; then echo "Could not determine ARM type from '$label'" exit 1 fi diff --git a/ansible/roles/docker/tasks/main.yml b/ansible/roles/docker/tasks/main.yml index 9bea8973e..3f506ba7b 100644 --- a/ansible/roles/docker/tasks/main.yml +++ b/ansible/roles/docker/tasks/main.yml @@ -145,6 +145,15 @@ - "{{ containers }}" when: containers is defined +- name: "docker : copy cc-selector.sh" + copy: + src: "{{ role_path }}/files/cc-selector.sh" + dest: /root/docker-container-{{ item.name }}/cc-selector.sh + mode: 0755 + with_items: + - "{{ containers }}" + when: containers is defined and item.os.find('_arm_cross') != -1 + - name: "docker : build image" command: docker build -t node-ci:{{ item.name }} /root/docker-container-{{ item.name }}/ with_items: diff --git a/ansible/roles/docker/templates/ubuntu1604_arm_cross.Dockerfile.j2 b/ansible/roles/docker/templates/ubuntu1604_arm_cross.Dockerfile.j2 new file mode 100644 index 000000000..59bd90cc0 --- /dev/null +++ b/ansible/roles/docker/templates/ubuntu1604_arm_cross.Dockerfile.j2 @@ -0,0 +1,62 @@ +FROM ubuntu:16.04 + +ENV LC_ALL=C + +RUN apt-get update \ + && apt-get dist-upgrade -y \ + && apt-get install -y software-properties-common \ + && add-apt-repository ppa:ubuntu-toolchain-r/test \ + && apt-get update \ + && apt-get install -y \ + ccache \ + g++ \ + gcc \ + git \ + openjdk-8-jre-headless \ + curl \ + python-pip \ + python3-pip \ + python-all \ + python-software-properties \ + libfontconfig1 \ + make \ + gcc-4.9-multilib \ + g++-4.9-multilib \ + gcc-6-multilib \ + g++-6-multilib + +RUN pip install tap2junit \ + && pip3 install tap2junit + +RUN git clone https://github.com/rvagg/rpi-newer-crosstools.git /opt/raspberrypi/rpi-newer-crosstools + +COPY cc-selector.sh /opt/raspberrypi/cc-selector.sh + +RUN chmod 755 /opt/raspberrypi/cc-selector.sh + +RUN addgroup --gid {{ server_user_gid.stdout_lines[0] }} {{ server_user }} \ + && adduser --gid {{ server_user_gid.stdout_lines[0] }} --uid {{ server_user_uid.stdout_lines[0] }} --disabled-password --gecos {{ server_user }} {{ server_user }} + +VOLUME /home/{{ server_user }}/ /home/{{ server_user }}/.ccache + +USER {{ server_user }}:{{ server_user }} + +ENV USER={{ server_user }} \ + JOBS={{ server_jobs | default(ansible_processor_vcpus) }} \ + SHELL=/bin/bash \ + HOME=/home/{{ server_user }} \ + PATH=/usr/lib/ccache/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ + NODE_COMMON_PIPE=/home/{{ server_user }}/test.pipe \ + NODE_TEST_DIR=/home/{{ server_user }}/tmp \ + OSTYPE=linux-gnu \ + OSVARIANT=docker \ + DESTCPU=x64 \ + ARCH=x64 \ + CCACHE_TEMPDIR=/home/{{ server_user }}/.ccache/{{ item.name }} + +CMD cd /home/{{ server_user }} \ + && curl https://ci.nodejs.org/jnlpJars/slave.jar -O \ + && java -Xmx{{ server_ram|default('128m') }} \ + -jar /home/{{ server_user }}/slave.jar \ + -jnlpUrl {{ jenkins_url }}/computer/{{ item.name }}/slave-agent.jnlp \ + -secret {{ item.secret }} diff --git a/ansible/roles/docker/templates/ubuntu1804_arm_cross.Dockerfile.j2 b/ansible/roles/docker/templates/ubuntu1804_arm_cross.Dockerfile.j2 new file mode 100644 index 000000000..96a6d36e7 --- /dev/null +++ b/ansible/roles/docker/templates/ubuntu1804_arm_cross.Dockerfile.j2 @@ -0,0 +1,59 @@ +FROM ubuntu:18.04 + +ENV LC_ALL=C + +RUN apt-get update \ + && apt-get dist-upgrade -y \ + && apt-get install -y software-properties-common \ + && add-apt-repository ppa:ubuntu-toolchain-r/test \ + && apt-get update \ + && apt-get install -y \ + ccache \ + g++ \ + gcc \ + git \ + openjdk-8-jre-headless \ + curl \ + python-pip \ + python3-pip \ + python-all \ + libfontconfig1 \ + make \ + gcc-6-multilib \ + g++-6-multilib + +RUN pip install tap2junit \ + && pip3 install tap2junit + +RUN git clone https://github.com/rvagg/rpi-newer-crosstools.git /opt/raspberrypi/rpi-newer-crosstools + +COPY cc-selector.sh /opt/raspberrypi/cc-selector.sh + +RUN chmod 755 /opt/raspberrypi/cc-selector.sh + +RUN addgroup --gid {{ server_user_gid.stdout_lines[0] }} {{ server_user }} \ + && adduser --gid {{ server_user_gid.stdout_lines[0] }} --uid {{ server_user_uid.stdout_lines[0] }} --disabled-password --gecos {{ server_user }} {{ server_user }} + +VOLUME /home/{{ server_user }}/ /home/{{ server_user }}/.ccache + +USER {{ server_user }}:{{ server_user }} + +ENV USER={{ server_user }} \ + JOBS={{ server_jobs | default(ansible_processor_vcpus) }} \ + SHELL=/bin/bash \ + HOME=/home/{{ server_user }} \ + PATH=/usr/lib/ccache/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ + NODE_COMMON_PIPE=/home/{{ server_user }}/test.pipe \ + NODE_TEST_DIR=/home/{{ server_user }}/tmp \ + OSTYPE=linux-gnu \ + OSVARIANT=docker \ + DESTCPU=x64 \ + ARCH=x64 \ + CCACHE_TEMPDIR=/home/{{ server_user }}/.ccache/{{ item.name }} + +CMD cd /home/{{ server_user }} \ + && curl https://ci.nodejs.org/jnlpJars/slave.jar -O \ + && java -Xmx{{ server_ram|default('128m') }} \ + -jar /home/{{ server_user }}/slave.jar \ + -jnlpUrl {{ jenkins_url }}/computer/{{ item.name }}/slave-agent.jnlp \ + -secret {{ item.secret }} diff --git a/jenkins/scripts/VersionSelectorScript.groovy b/jenkins/scripts/VersionSelectorScript.groovy index 9a14addb3..08766c36a 100644 --- a/jenkins/scripts/VersionSelectorScript.groovy +++ b/jenkins/scripts/VersionSelectorScript.groovy @@ -45,10 +45,10 @@ def buildExclusions = [ [ /^debian8-docker-armv7$/, anyType, gte(12) ], [ /^debian9-docker-armv7$/, anyType, lt(10) ], [ /^pi1-docker$/, releaseType, gte(10) ], - [ /^cross-compiler-armv[67]-gcc-4.8$/, anyType, gte(10) ], - [ /^cross-compiler-armv[67]-gcc-4.9/, anyType, lt(10) ], - [ /^cross-compiler-armv[67]-gcc-4.9/, anyType, gte(12) ], - [ /^cross-compiler-armv[67]-gcc-6/, anyType, lt(12) ], + [ /^cross-compiler-ubuntu1604-armv[67]-gcc-4.9/, anyType, gte(12) ], + [ /^cross-compiler-ubuntu1604-armv[67]-gcc-6/, anyType, lt(12) ], + [ /^cross-compiler-ubuntu1604-armv[67]-gcc-6/, anyType, gte(14) ], + [ /^cross-compiler-ubuntu1804-armv7-gcc-6/, anyType, lt(14) ], [ /^ubuntu1604-arm64/, anyType, gte(14) ], // Windows -----------------------------------------------