Skip to content

Commit

Permalink
Support AIX7.2 build machines
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-github committed Oct 9, 2019
1 parent 8f8d0ae commit fb3cf9f
Show file tree
Hide file tree
Showing 6 changed files with 273 additions and 17 deletions.
2 changes: 2 additions & 0 deletions ansible/inventory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ hosts:
win10-arm64-2: { vs: '2017' }

- osuosl:
# secret for -1 was compromised, do not use -1 name
aix72-ppc64_be-2: {ip: 140.211.9.30}
aix61-ppc64_be-1: {ip: 140.211.9.101}
aix61-ppc64_be-2: {ip: 140.211.9.100}
aix61-ppc64_be-3: {ip: 140.211.9.77}
Expand Down
43 changes: 33 additions & 10 deletions ansible/roles/jenkins-worker/templates/aix.rc2.j2
Original file line number Diff line number Diff line change
@@ -1,12 +1,35 @@
#!/bin/sh
export HOME={{ home }}/{{ server_user }}
export NODE_TEST_DIR="$HOME/tmp"
export JOBS="{{ jobs_env }}"
#!/bin/ksh

export OSTYPE=aix
export ARCH=ppc64
export DESTCPU=ppc64
##################################################
# name: S20jenkins
# purpose: script that will start or stop jenkins
##################################################

{{ java_path[os] }} -Xmx{{ server_ram|default('128m') }} \
-jar {{ home }}/{{ server_user }}/slave.jar -secret {{ secret }} \
-jnlpUrl {{ jenkins_url }}/computer/{{ inventory_hostname }}/slave-agent.jnlp

# (@sam-github) Purpose of java in PATH unknown, since an explicit path to
# java is used to run jenkins.
case "$1" in
start )
su - {{server_user}} -c '\
ulimit -c 0; \
ulimit -d unlimited; \
ulimit -m unlimited; \
export TERM=ansi; \
export jenkins_log_file="/home/{{server_user}}/jenkins_console.log"; \
export PATH=/home/{{server_user}}/jdk8u192-b12-jre/jre/bin:$PATH; \
export HOME=/home/{{server_user}}; \
export NODE_TEST_DIR=$HOME/tmp; \
export NODE_COMMON_PIPE="$HOME/test.pipe"; \
export OSTYPE=AIX72; \
export GIT_SSL_CAINFO="$HOME/ca-bundle.crt"; \
export SSL_CERT_FILE="$HOME/ca-bundle.crt"; \
/home/{{server_user}}/jdk8u192-b12-jre/bin/java -Xmx128m -Dorg.jenkinsci.plugins.gitclient.Git.timeOut=30 -jar "$HOME/slave.jar" \
-secret {{secret}} \
-jnlpUrl {{jenkins_url}}/computer/{{inventory_hostname}}/slave-agent.jnlp >$jenkins_log_file 2>&1 &'
;;
stop )
;;
* )
echo "Usage: $0 (start | stop)"
exit 1
esac
5 changes: 3 additions & 2 deletions ansible/roles/jenkins-worker/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#

init: {
aix: 'aix71',
aix: ['aix71', 'aix72'],
centos5: 'centos5',
centos6: 'centos6',
debian: ['debian7', 'ubuntu1204'],
Expand All @@ -20,7 +20,7 @@ init: {

jenkins_init: {
aix: {
dest: '/etc/rc.d/rc2.d/Sjenkins',
dest: '/etc/rc.d/rc2.d/S20jenkins',
src: 'aix.rc2.j2',
mode: '0555'
},
Expand Down Expand Up @@ -92,6 +92,7 @@ needs_monit: [
# some os'es needs different paths to java. add them here.
java_path: {
'aix71': '/home/iojs/jdk8u192-b12-jre/bin/java',
'aix72': '/home/iojs/jdk8u192-b12-jre/bin/java',
'macos10.10': 'java',
'macos10.11': 'java',
'macos10.12': 'java',
Expand Down
33 changes: 30 additions & 3 deletions jenkins/scripts/select-compiler.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#!/bin/bash

# Notes and warnings:
# - ccache and CC: v8 builds (at least) depend on the ability to be able to do
# `ln -s $CC some/place` (but only on some plaforms), so the
# `export CC="ccache /a/gcc-version/cc"` idiom breaks those builds. The best
# way to do ccache is to push `/path/to/gcc-version` on to the front of PATH,
# then push a `/path/to/ccache/wrappers` in front of the compiler path.

if [ "$DONTSELECT_COMPILER" != "DONT" ]; then
NODE_NAME=${NODE_NAME:-$HOSTNAME}
echo "Selecting compiler based on $NODE_NAME"
Expand Down Expand Up @@ -28,7 +35,7 @@ if [ "$SELECT_ARCH" = "PPC64LE" ]; then
# Setup devtoolset-6, sets LD_LIBRARY_PATH, PATH, etc.
. /opt/rh/devtoolset-6/enable
echo "Compiler set to devtoolset-6"
return
return
fi
;;
esac
Expand Down Expand Up @@ -73,16 +80,36 @@ elif [ "$SELECT_ARCH" = "S390X" ]; then
fi

elif [ "$SELECT_ARCH" = "AIXPPC" ]; then
# get node version
echo "Setting compiler for Node version $NODEJS_MAJOR_VERSION on AIX"
case $NODE_NAME in
*aix72* )
echo "Setting compiler for Node version $NODEJS_MAJOR_VERSION on AIX72"

if [ "$NODEJS_MAJOR_VERSION" -gt "9" ]; then
export LIBPATH=/opt/gcc-6.3/lib/gcc/powerpc-ibm-aix7.2.0.0/6.3.0/pthread/ppc64:/opt/gcc-6.3/lib
export PATH="/opt/ccache-3.7.4/libexec:/opt/gcc-6.3/bin:$PATH"
export CC="gcc" CXX="g++" CXX_host="g++"
echo "Compiler set to 6.3"
return
else
echo "Compiler left as system default:" `g++ -dumpversion`
return
fi
;;
esac

echo "Setting compiler for Node version $NODEJS_MAJOR_VERSION on AIX61"

if [ "$NODEJS_MAJOR_VERSION" -gt "9" ]; then
export LIBPATH=/home/iojs/gmake/opt/freeware/lib:/home/iojs/gcc-6.3.0-1/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/6.3.0/pthread/ppc64:/home/iojs/gcc-6.3.0-1/opt/freeware/lib
export PATH="/home/iojs/gcc-6.3.0-1/opt/freeware/bin:$PATH"
export CC="ccache `which gcc`" CXX="ccache `which g++`" CXX_host="ccache `which g++`"
# TODO(sam-github): configure ccache by pushing /opt/freeware/bin/ccache on
# front of PATH
echo "Compiler set to 6.3"
else
export CC="ccache `which gcc`" CXX="ccache `which g++`" CXX_host="ccache `which g++`"
# TODO(sam-github): configure ccache by pushing /opt/freeware/bin/ccache on
# front of PATH
echo "Compiler set to default at 4.8.5"
fi
fi
116 changes: 114 additions & 2 deletions setup/aix61/manualBootstrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,17 @@ chfs -a size=+1300000 /opt
chfs -a size=+250000 /
```

AIX72: unneeded: -1 and -2 and aix7-2 have different sizes, and 7.2 is big
enough already:

6.1-1 6.1-2 7.2-2
/opt: 3670016 x 512, 2228224 31457280
/: 3538944 x 512, 3407872 4194304

## Install required packages

AIX72: unneeded, package were installed by yum

#### curl, unzip

Download and scp to the machine:
Expand All @@ -26,11 +35,13 @@ rpm -ivh curl-7.44.0-2.aix6.1.ppc.rpm
rpm -i unzip-6.0-3.aix6.1.ppc.rpm
```

#### gcc
#### gcc 4.8.5 on AIX6.1

Download and scp to the machine:
http://www.bullfreeware.com/affichage.php?id=2378

Note that install-gcc-rpm.sh is in setup/aix61/resources

```bash
mkdir gcc
cd gcc
Expand All @@ -45,6 +56,8 @@ rm -rf gcc

#### git-tools

AIX72: unneeded, installed with yum

```bash
mkdir git-tools
cd git-tools
Expand All @@ -59,13 +72,17 @@ rm -rf git-tools

#### git

AIX72: unneeded, installed with yum

```bash
LIBPATH=/usr/lib curl --insecure -O https://ci.nodejs.org/downloads/aix/git-2.8.1-1.aix6.1.ppc.rpm
rpm -ivh git-2.8.1-1.aix6.1.ppc.rpm --force
```

#### openssl, openssh

AIX72: unneeded, installed with yum

Download and scp to the machine:
https://www-01.ibm.com/marketing/iwm/iwm/web/reg/pick.do?source=aixbp&lang=en_US

Expand All @@ -91,6 +108,8 @@ installp -Y -qaXgd . openssl openssh

#### gettext, java, make

AIX72: unneeded, installed by ansible in /home/iojs/

```bash
LIBPATH=/usr/lib curl --insecure -O https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/gettext/gettext-0.19.7-1.aix6.1.ppc.rpm
rpm -e gettext
Expand All @@ -106,6 +125,8 @@ rpm -i make-3.82-1.aix5.3.ppc.rpm

#### libtool

AIX72: unneeded, should not be installed

Download and scp to the machine:
http://www.bullfreeware.com/affichage.php?id=1458#
http://www.bullfreeware.com/affichage.php?id=2048
Expand All @@ -127,20 +148,37 @@ rm -rf libtool

#### pip

AIX72: unneeded, installed with yum

```bash
LIBPATH=/usr/lib curl https://bootstrap.pypa.io/get-pip.py | python
ln -s /opt/freeware/bin/pip /usr/bin/pip
```

#### tap2junit

AIX72:
```
python -m pip install --upgrade pip pipenv git+https://github.com/nodejs/tap2junit
python3 -m pip install --upgrade pip pipenv git+https://github.com/nodejs/tap2junit
ln -s /opt/freeware/bin/tap2junit /usr/bin/tap2junit
```

Note: probably only the py3 was needed

```bash
python -m pip install --upgrade pip pipenv git+https://github.com/nodejs/tap2junit.git
ln -s /opt/freeware/bin/tap2junit /usr/bin/tap2junit
```

## Install ccache

AIX72: TODO describe how to install with curl

The right way to do this is not with CC and CXX that have ccache in them,
but by making sure that ccache is first in the path, and that following it
in the PATH is the location of the selected compiler

Install ccache based on these instructions ./setup/ansible-tasks/ccache.yaml,
we should update that script so that it can be used on AIX as well.
Install on the new linux machines did not seem to work so use cp and chmod instead.
Expand All @@ -167,12 +205,16 @@ rm -rf tmp

## Add ::1 to /etc/hosts

AIX72: done with ansible, or already done

```bash
echo "::1 localhost" >>/etc/hosts
```

## Enable the AHA fs

For AIX 7.2 and 6.1, needed for the file watcher unit tests.

Add the following to /etc/filesystems:

```
Expand All @@ -190,6 +232,9 @@ mkdir /aha
mount /aha
```

AIX72: did not do ioo, not clear if it is needed, and looks like it would get
lost on reboot.

We also apply a disk IO optimization which instructs AIX to start writing dirty
pages earlier and not wait for the sync demon:

Expand All @@ -199,6 +244,8 @@ ioo -o j2_maxRandomWrite=32

## Setup ramdisks

TODO(sam-github): use the rc script from AIX7.2

Clear old state, if its not a fresh install:
```
mv /home/iojs/build/tools /home/iojs/build.tools
Expand Down Expand Up @@ -252,12 +299,45 @@ crw------- 1 root system 36, 1 Jun 18 12:14 /dev/rramdisk1
/dev/ramdisk1 /home/iojs/build jfs2 Jun 18 12:14 rw,log=/dev/ramdisk1
```

AIX7.2: put below into /etc/rc.d/rc2.d/S19ramdisk:
```bash
#!/bin/ksh

##################################################
# name: S19ramdisk
# purpose: script to create and mount ramdisks
##################################################


case "$1" in
start )
mkramdisk 10000000
echo yes | mkfs -V jfs2 -o log=INLINE /dev/ramdisk0
mount -V jfs2 -o log=/dev/ramdisk0 /dev/ramdisk0 /ramdisk0
chown iojs:staff /ramdisk0/
mkramdisk 23000000
echo yes | mkfs -V jfs2 -o log=INLINE /dev/ramdisk1
mount -V jfs2 -o log=/dev/ramdisk1 /dev/ramdisk1 /home/iojs/build
chown iojs:staff /home/iojs/build
;;
stop )
;;
* )
echo "Usage: $0 (start | stop)"
exit 1
esac
```
TODO(sam-github): use ansible to install the rc script
## Run ansible script to complete base configuration
See [the README](./README.md) for instructions
## Edit /etc/inetd.conf
AIX72: unneeded
Comment out default inbound services such as TELNET, FTP, RLOGIN, TALK etc. and
then reload the configuration with:
Expand All @@ -278,7 +358,7 @@ xmquery dgram udp6 wait root /usr/bin/xmtopas xmtopas -p3
```
## Install the 6.3.x compiler
## gcc 6.3.x on AIX 6.1
```bash
su - iojs
Expand All @@ -293,8 +373,24 @@ gunzip -d gmake-dep.tar.gz
tar -xf gmake-dep.tar
```
## gcc 6.3.x on AIX 7.2
```bash
mkdir -p /opt/gcc-6.3 && cd /opt/gcc-6.3
curl -L https://ci.nodejs.org/downloads/aix/gcc-6.3-aix7.2.ppc.tar.gz | /opt/freeware/bin/tar -xzf -
```
## ccache 3.7.4 on AIX 7.2
```bash
mkdir -p /opt/ccache-3.7.4 && cd /opt/ccache-3.7.4
curl -L https://ci.nodejs.org/downloads/aix/ccache-3.7.4.aix7.2.ppc.tar.gz | /opt/freeware/bin/tar -xzf -
```
## Install python3
AIX72: uneeded, installed by yum
```bash
mkdir /tmp/i-files
cd /tmp/i-files
Expand All @@ -315,3 +411,19 @@ If uninstallation is needed for some reason, the command is:
```
installp -u aixtools.python3
```
## Install XL compilers
1. Download 16.1.0 packages from: https://testcase.boulder.ibm.com (username:
xlcomp4, password: ask @mhdawson)
2. scp them to target:/opt/ibm-xlc
3. on target:
```bash
cd /opt/ibm-xlc
uncompress 16.1.0.3-IBM-xlCcmp-AIX-FP003.tar.Z
uncompress IBM_XL_C_CPP_V16.1.0.0_AIX.tar.Z
installp -aXYgd ./usr/sys/inst.images -e /tmp/install.log all
inutoc
installp -aXgd ./ -e /tmp/install.log all
```
4. Find compilers in `/opt/IBM/xl[cC]/16.1.0/bin/`
Loading

0 comments on commit fb3cf9f

Please sign in to comment.