Skip to content

Commit

Permalink
docker: add ubuntu1604 ansible setup for arm32
Browse files Browse the repository at this point in the history
Signed-off-by: Stewart X Addison <[email protected]>
  • Loading branch information
sxa committed Jun 15, 2021
1 parent b15c07d commit 587751e
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 7 deletions.
39 changes: 39 additions & 0 deletions ansible/Dockerfile.Ubuntu1604
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FROM ubuntu:16.04

ARG user=jenkins

RUN apt-get update
RUN apt-get -y install python git curl
RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
RUN python2 get-pip.py

# Prereqs for cryptography module. Ubuntu 16 has cryptography
# 1.2.3 in its repos. v3 won't build with ssl102
RUN apt-get -y install python-dev libffi-dev libssl-dev
RUN apt-get -y install gcc
RUN pip install cryptography==2.9.2

RUN pip install ansible

COPY . /ansible

RUN echo "localhost ansible_connection=local" > /ansible/hosts

RUN set -eux; \
cd /ansible; \
ansible-playbook -i hosts /ansible/playbooks/AdoptOpenJDK_Unix_Playbook/main.yml --skip-tags="debug,hosts_file,hostname,adoptopenjdk,jenkins,nagios,superuser,docker,swap_file,crontab,nvidia_cuda_toolkit,ntp_time"

RUN rm -rf /ansible

RUN groupadd -g 1000 ${user}
RUN useradd -c "Jenkins user" -d /home/${user} -u 1000 -g 1000 -m ${user}

ENV \
JDK7_BOOT_DIR="/usr/lib/jvm/jdk8" \
JDK8_BOOT_DIR="/usr/lib/jvm/jdk8" \
JDK10_BOOT_DIR="/usr/lib/jvm/jdk-10" \
JDK11_BOOT_DIR="/usr/lib/jvm/jdk-11" \
JDK13_BOOT_DIR="/usr/lib/jvm/jdk-13" \
JDK14_BOOT_DIR="/usr/lib/jvm/jdk-14" \
JDKLATEST_BOOT_DIR="/usr/lib/jvm/jdk-14" \
JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk"
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@
when:
- ansible_distribution_major_version == "16"

- name: Install additional Packages specific to Ubuntu 16 (Not armv7l)
package: "name={{ item }} state=latest"
with_items: openjdk-7-jdk
when:
- ansible_distribution_major_version == "16"
- ansible_architecture != "armv7l"

- name: Install additional Packages specific to Ubuntu 18
package: "name={{ item }} state=latest"
with_items: "{{ Additional_Packages_Ubuntu18 }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# gcc_7 #
#########

- name: Check if gcc 7.5 is installed on RHEL/CentOS
- name: Check if gcc 7.5 is installed on RHEL/CentOS/Ubuntu16
shell: /usr/local/gcc/bin/gcc-7.5 --version 2>&1 > /dev/null
ignore_errors: yes
register: gcc7_installed
when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Debian" and ansible_architecture == "armv7l")
when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_architecture == "armv7l" and ((ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or ansible_distribution == "Debian"))
tags: gcc_7

# Unable to check the checksum of the binary as it'll be different for each architecture's tar.xz file
Expand All @@ -18,7 +18,7 @@
force: no
mode: 0644
when:
- ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Debian" and ansible_architecture == "armv7l")
- ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_architecture == "armv7l" and ((ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or ansible_distribution == "Debian"))
- gcc7_installed.rc != 0
tags: gcc_7

Expand All @@ -28,7 +28,7 @@
dest: /usr/local/
copy: False
when:
- ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Debian" and ansible_architecture == "armv7l")
- ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_architecture == "armv7l" and ((ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or ansible_distribution == "Debian"))
- gcc7_installed.rc != 0
tags: gcc_7

Expand All @@ -37,7 +37,7 @@
path: '/tmp/ansible-adoptopenjdk-gcc-7.tar.xz'
state: absent
when:
- ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Debian" and ansible_architecture == "armv7l")
- ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_architecture == "armv7l" and ((ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or ansible_distribution == "Debian"))
- gcc7_installed.rc != 0
tags: gcc_7

Expand All @@ -48,7 +48,7 @@
path: /usr/local/bin/ccache
register: ccache_symlink
when:
- ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Debian" and ansible_architecture == "armv7l")
- ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_architecture == "armv7l" and ((ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or ansible_distribution == "Debian"))
tags: gcc_7

- name: Create symlink for ccache
Expand All @@ -57,6 +57,6 @@
dest: /usr/local/bin/ccache
state: link
when:
- ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Debian" and ansible_architecture == "armv7l")
- ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_architecture == "armv7l" and ((ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or ansible_distribution == "Debian"))
- not ccache_symlink.stat.exists
tags: gcc_7
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
#########
# gcc_7 #
#########

- name: Check if gcc 7.5 is installed on RHEL/CentOS
shell: /usr/local/gcc/bin/gcc-7.5 --version 2>&1 > /dev/null
ignore_errors: yes
register: gcc7_installed
when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or (ansible_distribution == "Debian" and ansible_architecture == "armv7l")
tags: gcc_7

# Unable to check the checksum of the binary as it'll be different for each architecture's tar.xz file
- name: Download AdoptOpenJDK gcc-7.5.0 binary
get_url:
url: https://ci.adoptopenjdk.net/userContent/gcc/gcc750+ccache.{{ ansible_architecture }}.tar.xz
dest: '/tmp/ansible-adoptopenjdk-gcc-7.tar.xz'
force: no
mode: 0644
when:
- ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or (ansible_distribution == "Debian" and ansible_architecture == "armv7l")
- gcc7_installed.rc != 0
tags: gcc_7

- name: Extract AdoptOpenJDK gcc-7 binary to /usr/local/gcc
unarchive:
src: /tmp/ansible-adoptopenjdk-gcc-7.tar.xz
dest: /usr/local/
copy: False
when:
- ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or (ansible_distribution == "Debian" and ansible_architecture == "armv7l")
- gcc7_installed.rc != 0
tags: gcc_7

- name: Remove downloaded gcc 7 binary tarball
file:
path: '/tmp/ansible-adoptopenjdk-gcc-7.tar.xz'
state: absent
when:
- ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or (ansible_distribution == "Debian" and ansible_architecture == "armv7l")
- gcc7_installed.rc != 0
tags: gcc_7

# Stops buildng ccache from source when unnecessary
# See: https://github.com/AdoptOpenJDK/openjdk-infrastructure/issues/1472
- name: Check if ccache is at /usr/local/bin/ccache
stat:
path: /usr/local/bin/ccache
register: ccache_symlink
when:
- ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or (ansible_distribution == "Debian" and ansible_architecture == "armv7l")
tags: gcc_7

- name: Create symlink for ccache
file:
src: /usr/local/gcc/bin/ccache
dest: /usr/local/bin/ccache
state: link
when:
- ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "openSUSE" or (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16") or (ansible_distribution == "Debian" and ansible_architecture == "armv7l")
- not ccache_symlink.stat.exists
tags: gcc_7

0 comments on commit 587751e

Please sign in to comment.