Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions ansible/MANUAL_STEPS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -50,14 +50,18 @@ 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
User staging
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:

Expand All @@ -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 <containerid> -ti bash`
3. Run `ssh node-www date` (as above)

### macOS release machines

Previous notes: [#1393](https://github.com/nodejs/build/issues/1393)
Expand Down
6 changes: 2 additions & 4 deletions ansible/inventory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ 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}
macos10.10-x64-1: {ip: 207.254.58.162, port: 10014, user: administrator}

- marist:
zos13-s390x-1: {ip: 148.100.36.135, user: Unix1}

- nearform:
macos10.15-x64-1: {ip: 83.147.191.69, user: administrator}

Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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}

Expand Down
1 change: 1 addition & 0 deletions ansible/playbooks/jenkins/docker-host.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- hosts:
- test
- release

roles:
- bootstrap
Expand Down
2 changes: 0 additions & 2 deletions ansible/playbooks/jenkins/worker/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
46 changes: 0 additions & 46 deletions ansible/roles/cross-compiler/tasks/main.yml

This file was deleted.

4 changes: 0 additions & 4 deletions ansible/roles/cross-compiler/vars/main.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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-"
Expand All @@ -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
Expand Down
9 changes: 9 additions & 0 deletions ansible/roles/docker/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
62 changes: 62 additions & 0 deletions ansible/roles/docker/templates/ubuntu1604_arm_cross.Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -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 }}
59 changes: 59 additions & 0 deletions ansible/roles/docker/templates/ubuntu1804_arm_cross.Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -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 }}
8 changes: 4 additions & 4 deletions jenkins/scripts/VersionSelectorScript.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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 -----------------------------------------------
Expand Down