Skip to content
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

UnixPB: Add support for CentOS8 #1131

Merged
merged 3 commits into from
Feb 18, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
42 changes: 42 additions & 0 deletions ansible/Vagrantfile.CentOS8
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

$script = <<SCRIPT
sudo yum -y update
sudo yum install -y libselinux-python
sudo yum install -y ansible
sudo mkdir /ansible
sudo cp /etc/ansible/ansible.cfg /ansible
sudo touch /ansible/hosts
sudo sed -i 's?#inventory = /etc/ansible/hosts?inventory = /ansible/hosts?g' /ansible/ansible.cfg
echo "---------------------------------------------------------------------------------------"
echo "*** Creating public-private keypair for ansible-playbook... for user '$USER' *** "
yes y | ssh-keygen -t rsa -b 4096 -C "adoptopenjdk@gmail.com" -q -P "" -f $HOME/.ssh/id_rsa
echo "---------------------------------------------------------------------------------------"
echo "*** Public-private keypair for ansible-playbook... for user '$USER' has been created in *** "
ls -lash $HOME/.ssh
echo "---------------------------------------------------------------------------------------"
export VAGRANT_MOUNT=/vagrant
echo "*** Creating 'hosts' file for ansible-playbook... ***"
echo "localhost ansible_connection=local" > $VAGRANT_MOUNT/playbooks/hosts
echo "---------------------------------------------------------------------------------------"
echo "*** '$VAGRANT_MOUNT/playbooks/hosts' file for ansible-playbook contains ***"
cat $VAGRANT_MOUNT/playbooks/hosts
echo "---------------------------------------------------------------------------------------"
# Get IPs of the VM, and output to shared folder
ifconfig | grep "inet" | awk '{print $2}' | sed 's/addr://' >> /vagrant/playbooks/AdoptOpenJDK_Unix_Playbook/hosts.tmp
# Put the host machine's IP into the authorised_keys file on the VM
[ -r /vagrant/id_rsa.pub ] && mkdir -p $HOME/.ssh && cat /vagrant/id_rsa.pub >> $HOME/.ssh/authorized_keys
SCRIPT

# 2 = version of configuration file for Vagrant 1.1+ leading up to 2.0.x
Vagrant.configure("2") do |config|

config.vm.define :adoptopenjdkC8 do |adoptopenjdkC8|
adoptopenjdkC8.vm.box = "generic/centos8"
adoptopenjdkC8.vm.synced_folder ".", "/vagrant"
adoptopenjdkC8.vm.hostname = "adoptopenjdkC8"
adoptopenjdkC8.vm.network :private_network, type: "dhcp"
adoptopenjdkC8.vm.provision "shell", inline: $script, privileged: false
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,35 @@
#########################################
# Configure Repos and Update the system #
#########################################
- name: Enable EPEL release
- name: Enable EPEL release (not CentOS8)
yum:
name: epel-release
state: installed
update_cache: yes
validate_certs: no
when: ansible_distribution_major_version != "8"
tags: patch_update

- name: Enable EPEL release for CentOS8
shell: |
rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm
ignore_errors: yes
when:
- ansible_architecture != "s390x"
- ansible_distribution_major_version == "8"
tags: patch_update

- name: Enable CentOS-Powershell repo for CentOS8
shell: sed -i -e 's/enabled=0/enabled=1/g' /etc/yum.repos.d/CentOS-PowerTools.repo
ignore_errors: yes
when:
- ansible_distribution_major_version == "8"
tags: patch_update

- name: Clean dnf cache
shell: dnf clean all && rm -rf /var/cache/dnf
when:
- ansible_distribution_major_version == "8"
tags: patch_update

- name: YUM upgrade all packages
Expand All @@ -35,39 +58,50 @@
when: ansible_distribution_major_version == "7"
tags: build_tools

- name: Install additional build tools for CentOS 8
package: "name={{ item }} state=latest"
with_items: "{{ Additional_Build_Tools_CentOS8 }}"
when: ansible_distribution_major_version == "8"
tags: build_tools

- name: Install additional build tools for NOT CentOS8
package: "name={{ item }} state=latest"
with_items: "{{ Additional_Build_Tools_NOT_CentOS8 }}"
when:
- ansible_distribution_major_version != "8"
tags: build_tools

- name: Add devtools-2 to yum repo list for gcc 4.8
get_url:
url: https://people.centos.org/tru/devtools-2/devtools-2.repo
dest: /etc/yum.repos.d/devtools-2.repo
timeout: 25
checksum: sha256:a8ebeb4bed624700f727179e6ef771dafe47651131a00a78b342251415646acc
when:
- ansible_distribution == "CentOS"
- ansible_distribution_major_version == "6"
tags: build_tools

- name: Install gcc4.8
package: "name={{ item }} state=latest"
with_items: "{{ gcc48_devtoolset_compiler }}"
when:
- ansible_distribution == "CentOS"
- ansible_distribution_major_version == "6"
tags: build_tools


- name: Install CentOS SCL x86_64 repo for gcc7.3
package: "name=centos-release-scl state=latest"
when:
- ansible_distribution == "CentOS"
- ansible_architecture == "x86_64"
- ansible_distribution_major_version != "8"
tags: build_tools

- name: Install gcc7.3
package: "name={{ item }} state=latest"
with_items: "{{ gcc73_devtoolset_compiler }}"
when:
- ansible_distribution == "CentOS"
- ansible_architecture == "x86_64"
- ansible_distribution_major_version != "8"
tags: build_tools

- name: Install additional build tools for CentOS on x86
Expand All @@ -86,7 +120,6 @@
group: root
state: link
when:
- ansible_distribution == "CentOS"
- ansible_distribution_major_version == "6"
tags: build_tools

Expand All @@ -99,7 +132,6 @@
group: root
state: link
when:
- ansible_distribution == "CentOS"
- ansible_distribution_major_version == "6"
tags: build_tools

Expand All @@ -112,7 +144,6 @@
group: root
state: link
when:
- ansible_distribution == "CentOS"
- ansible_distribution_major_version == "6"
tags: build_tools

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ Build_Tool_Packages:
- glibc-common
- glibc-devel
- gmp-devel
- java-1.7.0-openjdk-devel
- java-1.8.0-openjdk-devel
- libcurl-devel
- libdwarf-devel # OpenJ9
Expand All @@ -35,12 +34,10 @@ Build_Tool_Packages:
- libXrender-devel
- libXt-devel
- libXtst-devel
- lbzip2
- make
- mesa-libGL-devel
- mpfr-devel
- numactl-devel # OpenJ9
- ntp
- openssl-devel
- perl-CPAN
- perl-DBI
Expand All @@ -67,6 +64,18 @@ gcc73_devtoolset_compiler:
Additional_Build_Tools_CentOS7:
- libstdc++-static

Additional_Build_Tools_CentOS8:
- glibc-locale-source
- glibc-langpack-ja # required for creating Japanese locales
- glibc-langpack-ko # required for creating Korean locales
- glibc-langpack-zh # required for creating Chinese locales

Additional_Build_Tools_NOT_CentOS8:
- libdwarf-devel
- lbzip2
- java-1.7.0-openjdk-devel
- ntp

Additional_Build_Tools_CentOS_x86:
- glibc.i686 # a dependency required for executing a 32-bit C binary
- glibc-devel.i686 # a dependency required for executing a 32-bit C binary
Expand All @@ -76,7 +85,6 @@ Test_Tool_Packages:
- gcc
- gcc-c++
- unzip
- lbzip2
- zlib-devel
- perl-devel
- libcurl-devel
Expand Down