-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ansible: arm cross compiler updates for Node.js 18 #2912
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
14e049d
ansible: arm cross compiler updates for Node.js 18
richardlau 2ee628f
squash! ansible: arm cross compiler updates for Node.js 18
richardlau c2b6dc2
fixup! ansible: arm cross compiler updates for Node.js 18
richardlau 426be63
fixup! fixup! ansible: arm cross compiler updates for Node.js 18
richardlau 049ab2f
fixup! fixup! fixup! ansible: arm cross compiler updates for Node.js 18
richardlau a6ecab7
fixup! fixup! fixup! fixup! ansible: arm cross compiler updates for N…
richardlau File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
ansible/roles/docker/templates/debian10_armv7l.Dockerfile.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
FROM arm32v7/debian:10 | ||
|
||
ENV LC_ALL C | ||
ENV USER {{ server_user }} | ||
ENV JOBS {{ server_jobs | default(ansible_processor_vcpus) }} | ||
ENV SHELL /bin/bash | ||
ENV HOME /home/{{ server_user }} | ||
ENV PATH /usr/lib/ccache/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | ||
ENV NODE_COMMON_PIPE /home/{{ server_user }}/test.pipe | ||
ENV NODE_TEST_DIR /home/{{ server_user }}/tmp | ||
ENV OSTYPE linux-gnu | ||
ENV OSVARIANT docker | ||
ENV PYTHON python3 | ||
ENV DESTCPU {{ arch }} | ||
ENV ARCH {{ arch }} | ||
ENV DEBIAN_FRONTEND noninteractive | ||
RUN apt-get update && apt-get dist-upgrade -y && apt-get install -y ccache \ | ||
curl \ | ||
g++-8 \ | ||
gcc-8 \ | ||
git \ | ||
libfontconfig1 \ | ||
openjdk-11-jre-headless \ | ||
pkg-config \ | ||
procps \ | ||
python3-pip \ | ||
xz-utils | ||
|
||
# Prevent Node.js picking up the OS's openssl.cnf, https://github.com/nodejs/node/issues/27862 | ||
ENV OPENSSL_CONF /dev/null | ||
|
||
RUN pip3 install tap2junit | ||
|
||
RUN addgroup --gid {{ server_user_gid.stdout_lines[0] }} {{ server_user }} | ||
|
||
RUN 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 iojs:iojs | ||
|
||
ENV CCACHE_TEMPDIR /home/iojs/.ccache/{{ item.name }} | ||
|
||
CMD cd /home/iojs \ | ||
&& 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 }} |
65 changes: 65 additions & 0 deletions
65
ansible/roles/docker/templates/rhel8_arm_cross.Dockerfile.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
FROM registry.access.redhat.com/ubi8:latest | ||
|
||
ENV LC_ALL C | ||
ENV USER {{ server_user }} | ||
ENV JOBS {{ server_jobs | default(ansible_processor_vcpus) }} | ||
ENV SHELL /bin/bash | ||
ENV PATH /usr/lib64/ccache:/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | ||
ENV NODE_COMMON_PIPE /home/{{ server_user }}/test.pipe | ||
ENV NODE_TEST_DIR /home/{{ server_user }}/tmp | ||
ENV OSTYPE linux-gnu | ||
ENV OSVARIANT docker | ||
ENV DESTCPU {{ arch }} | ||
ENV ARCH {{ arch }} | ||
|
||
# ccache is not in the default repositories so get it from EPEL 8. | ||
RUN dnf install --disableplugin=subscription-manager -y \ | ||
https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm \ | ||
&& dnf update --disableplugin=subscription-manager -y \ | ||
&& dnf install --disableplugin=subscription-manager -y \ | ||
ccache \ | ||
gcc-c++ \ | ||
git \ | ||
glibc-devel.i686 \ | ||
java-17-openjdk-headless \ | ||
make \ | ||
libatomic.i686 \ | ||
libstdc++-devel \ | ||
libstdc++-devel.i686 \ | ||
python3 \ | ||
procps-ng \ | ||
xz \ | ||
&& dnf --disableplugin=subscription-manager clean all | ||
|
||
RUN groupadd -r -g {{ server_user_gid.stdout_lines[0] }} {{ server_user }} \ | ||
&& adduser -r -m -d /home/{{ server_user }}/ \ | ||
-g {{ server_user_gid.stdout_lines[0] }} \ | ||
-u {{ server_user_uid.stdout_lines[0] }} {{ server_user }} | ||
|
||
# Relax crypto policies to allow Node.js tests to pass | ||
RUN update-crypto-policies --set LEGACY | ||
|
||
VOLUME /home/{{ server_user }}/ /home/{{ server_user }}/.ccache | ||
|
||
ENV PYTHON /usr/bin/python3 | ||
|
||
RUN 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 | ||
|
||
USER {{ server_user }}:{{ server_user }} | ||
|
||
ENV CCACHE_TEMPDIR /home/{{ server_user }}/.ccache/{{ item.name }} | ||
|
||
WORKDIR /home/{{ server_user }} | ||
|
||
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 }} |
67 changes: 67 additions & 0 deletions
67
ansible/roles/jenkins-worker/templates/rpi_buster.Dockerfile.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
FROM balenalib/rpi-raspbian:buster | ||
|
||
ENV LC_ALL=C \ | ||
USER={{ server_user }} \ | ||
JOBS={{ jobs_env }} \ | ||
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=arm \ | ||
ARCH={{ arch }} \ | ||
CCACHE_TEMPDIR=/home/{{ server_user }}/.ccache/{{ inventory_hostname }} \ | ||
DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update && apt-get dist-upgrade -y && apt-get install -y \ | ||
g++-8 \ | ||
gcc-8 \ | ||
git \ | ||
make \ | ||
ccache \ | ||
python2.7 \ | ||
python \ | ||
openssh-client \ | ||
gzip \ | ||
xz-utils \ | ||
curl \ | ||
libffi-dev \ | ||
zlib1g-dev && \ | ||
apt-get clean -y && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 50 && \ | ||
update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-8 50 && \ | ||
update-alternatives --install /usr/bin/cpp cpp /usr/bin/gcc-8 50 && \ | ||
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 50 && \ | ||
update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-8 50 | ||
|
||
RUN mkdir /python && \ | ||
cd /python && \ | ||
curl https://github.com/python/cpython/archive/refs/tags/v3.9.4.tar.gz -L --output v3.9.4.tar.gz && \ | ||
tar xf v3.9.4.tar.gz && \ | ||
cd cpython-3.9.4 && \ | ||
./configure && \ | ||
make install && \ | ||
rm -rf /python | ||
|
||
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 }}/ | ||
|
||
USER iojs:iojs | ||
|
||
# Prevent Node.js picking up the OS's openssl.cnf, https://github.com/nodejs/node/issues/27862 | ||
ENV OPENSSL_CONF /dev/null | ||
|
||
ENTRYPOINT [ "tail", "-f", "/dev/null" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're sure this is going to be OK? do we not have the option to version this? IIRC we added the host version because it was picking the wrong version because it happened to be the default on the machine, so we went with the version specifier. But maybe that's not an option with rhel in this setup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The RHEL 8 option would be GCC toolsets (the equivalent of devtoolsets in CentOS/RHEL 7). In those cases it's the path to the toolset that changes, not the name of the binary. I could add a check if the gcc version is not 8 (the default in RHEL 8) and attempt to load a GCC toolset, although the container hasn't installed any extra ones.
Refs: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/developing_c_and_cpp_applications_in_rhel_8/additional-toolsets-for-development_developing-applications
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated this to attempt to load a gcc-toolset if the host gcc version doesn't match.