mirror of https://github.com/apache/kafka.git
MINOR: upgrade to jdk8 8u202
Upgrade from 171 to 202. Unpack and install directly from a cached tgz rather than going via the installer deb from webupd8. The installer is still on 8u919 while we want 202. Testing via kafka branch builder job https://jenkins.confluent.io/job/system-test-kafka-branch-builder/2305/ Author: Jarek Rudzinski <jarek@confluent.io> Author: Ewen Cheslack-Postava <me@ewencp.org> Reviewers: Alex Diachenko <sansanichfb@gmail.com>, Ewen Cheslack-Postava <ewen@confluent.io> Closes #6165 from jarekr/trunk-jdk8-from-tgz
This commit is contained in:
parent
0f926f0c1e
commit
ad3b6dd835
|
@ -40,7 +40,7 @@ ec2_keypair_file = nil
|
||||||
|
|
||||||
ec2_region = "us-east-1"
|
ec2_region = "us-east-1"
|
||||||
ec2_az = nil # Uses set by AWS
|
ec2_az = nil # Uses set by AWS
|
||||||
ec2_ami = "ami-905730e8"
|
ec2_ami = "ami-29ebb519"
|
||||||
ec2_instance_type = "m3.medium"
|
ec2_instance_type = "m3.medium"
|
||||||
ec2_spot_instance = ENV['SPOT_INSTANCE'] ? ENV['SPOT_INSTANCE'] == 'true' : true
|
ec2_spot_instance = ENV['SPOT_INSTANCE'] ? ENV['SPOT_INSTANCE'] == 'true' : true
|
||||||
ec2_spot_max_price = "0.113" # On-demand price for instance type
|
ec2_spot_max_price = "0.113" # On-demand price for instance type
|
||||||
|
@ -52,6 +52,9 @@ ec2_subnet_id = nil
|
||||||
# are running Vagrant from within that VPC as well.
|
# are running Vagrant from within that VPC as well.
|
||||||
ec2_associate_public_ip = nil
|
ec2_associate_public_ip = nil
|
||||||
|
|
||||||
|
jdk_major = '8'
|
||||||
|
jdk_full = '8u202-linux-x64'
|
||||||
|
|
||||||
local_config_file = File.join(File.dirname(__FILE__), "Vagrantfile.local")
|
local_config_file = File.join(File.dirname(__FILE__), "Vagrantfile.local")
|
||||||
if File.exists?(local_config_file) then
|
if File.exists?(local_config_file) then
|
||||||
eval(File.read(local_config_file), binding, "Vagrantfile.local")
|
eval(File.read(local_config_file), binding, "Vagrantfile.local")
|
||||||
|
@ -75,15 +78,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||||
|
|
||||||
if Vagrant.has_plugin?("vagrant-cachier")
|
if Vagrant.has_plugin?("vagrant-cachier")
|
||||||
override.cache.scope = :box
|
override.cache.scope = :box
|
||||||
# Besides the defaults, we use a custom cache to handle the Oracle JDK
|
|
||||||
# download, which downloads via wget during an apt install. Because of the
|
|
||||||
# way the installer ends up using its cache directory, we need to jump
|
|
||||||
# through some hoops instead of just specifying a cache directly -- we
|
|
||||||
# share to a temporary location and the provisioning scripts symlink data
|
|
||||||
# to the right location.
|
|
||||||
override.cache.enable :generic, {
|
|
||||||
"oracle-jdk8" => { cache_dir: "/tmp/oracle-jdk8-installer-cache" },
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -169,7 +163,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||||
name_node(zookeeper, name, ec2_instance_name_prefix)
|
name_node(zookeeper, name, ec2_instance_name_prefix)
|
||||||
ip_address = "192.168.50." + (10 + i).to_s
|
ip_address = "192.168.50." + (10 + i).to_s
|
||||||
assign_local_ip(zookeeper, ip_address)
|
assign_local_ip(zookeeper, ip_address)
|
||||||
zookeeper.vm.provision "shell", path: "vagrant/base.sh"
|
zookeeper.vm.provision "shell", path: "vagrant/base.sh", env: {"JDK_MAJOR" => jdk_major, "JDK_FULL" => jdk_full}
|
||||||
zk_jmx_port = enable_jmx ? (8000 + i).to_s : ""
|
zk_jmx_port = enable_jmx ? (8000 + i).to_s : ""
|
||||||
zookeeper.vm.provision "shell", path: "vagrant/zk.sh", :args => [i.to_s, num_zookeepers, zk_jmx_port]
|
zookeeper.vm.provision "shell", path: "vagrant/zk.sh", :args => [i.to_s, num_zookeepers, zk_jmx_port]
|
||||||
end
|
end
|
||||||
|
@ -186,7 +180,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||||
# host DNS isn't setup, we shouldn't use hostnames -- IP addresses must be
|
# host DNS isn't setup, we shouldn't use hostnames -- IP addresses must be
|
||||||
# used to support clients running on the host.
|
# used to support clients running on the host.
|
||||||
zookeeper_connect = zookeepers.map{ |zk_addr| zk_addr + ":2181"}.join(",")
|
zookeeper_connect = zookeepers.map{ |zk_addr| zk_addr + ":2181"}.join(",")
|
||||||
broker.vm.provision "shell", path: "vagrant/base.sh"
|
broker.vm.provision "shell", path: "vagrant/base.sh", env: {"JDK_MAJOR" => jdk_major, "JDK_FULL" => jdk_full}
|
||||||
kafka_jmx_port = enable_jmx ? (9000 + i).to_s : ""
|
kafka_jmx_port = enable_jmx ? (9000 + i).to_s : ""
|
||||||
broker.vm.provision "shell", path: "vagrant/broker.sh", :args => [i.to_s, enable_dns ? name : ip_address, zookeeper_connect, kafka_jmx_port]
|
broker.vm.provision "shell", path: "vagrant/broker.sh", :args => [i.to_s, enable_dns ? name : ip_address, zookeeper_connect, kafka_jmx_port]
|
||||||
end
|
end
|
||||||
|
@ -198,7 +192,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||||
name_node(worker, name, ec2_instance_name_prefix)
|
name_node(worker, name, ec2_instance_name_prefix)
|
||||||
ip_address = "192.168.50." + (100 + i).to_s
|
ip_address = "192.168.50." + (100 + i).to_s
|
||||||
assign_local_ip(worker, ip_address)
|
assign_local_ip(worker, ip_address)
|
||||||
worker.vm.provision "shell", path: "vagrant/base.sh"
|
worker.vm.provision "shell", path: "vagrant/base.sh", env: {"JDK_MAJOR" => jdk_major, "JDK_FULL" => jdk_full}
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,38 +20,45 @@ set -ex
|
||||||
# If you update this, also update tests/docker/Dockerfile
|
# If you update this, also update tests/docker/Dockerfile
|
||||||
export KIBOSH_VERSION=d85ac3ec44be0700efe605c16289fd901cfdaa13
|
export KIBOSH_VERSION=d85ac3ec44be0700efe605c16289fd901cfdaa13
|
||||||
|
|
||||||
|
path_to_jdk_cache() {
|
||||||
|
jdk_version=$1
|
||||||
|
echo "/tmp/jdk-${jdk_version}.tar.gz"
|
||||||
|
}
|
||||||
|
|
||||||
|
fetch_jdk_tgz() {
|
||||||
|
jdk_version=$1
|
||||||
|
|
||||||
|
path=$(path_to_jdk_cache $jdk_version)
|
||||||
|
|
||||||
|
if [ ! -e $path ]; then
|
||||||
|
mkdir -p $(dirname $path)
|
||||||
|
curl -s -L "https://s3-us-west-2.amazonaws.com/kafka-packages/jdk-${jdk_version}.tar.gz" -o $path
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
JDK_MAJOR="${JDK_MAJOR:-8}"
|
||||||
|
JDK_FULL="${JDK_FULL:-8u202-linux-x64}"
|
||||||
|
|
||||||
if [ -z `which javac` ]; then
|
if [ -z `which javac` ]; then
|
||||||
apt-get -y update
|
apt-get -y update
|
||||||
apt-get install -y software-properties-common python-software-properties
|
apt-get install -y software-properties-common python-software-properties binutils java-common
|
||||||
add-apt-repository -y ppa:webupd8team/java
|
|
||||||
apt-get -y update
|
|
||||||
|
|
||||||
# Try to share cache. See Vagrantfile for details
|
echo "===> Installing JDK..."
|
||||||
mkdir -p /var/cache/oracle-jdk8-installer
|
|
||||||
if [ -e "/tmp/oracle-jdk8-installer-cache/" ]; then
|
|
||||||
find /tmp/oracle-jdk8-installer-cache/ -not -empty -exec cp '{}' /var/cache/oracle-jdk8-installer/ \;
|
|
||||||
fi
|
|
||||||
if [ ! -e "/var/cache/oracle-jdk8-installer/jdk-8u171-linux-x64.tar.gz" ]; then
|
|
||||||
# Grab a copy of the JDK since it has moved and original downloader won't work
|
|
||||||
curl -s -L "https://s3-us-west-2.amazonaws.com/kafka-packages/jdk-8u171-linux-x64.tar.gz" -o /var/cache/oracle-jdk8-installer/jdk-8u171-linux-x64.tar.gz
|
|
||||||
fi
|
|
||||||
|
|
||||||
/bin/echo debconf shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections
|
mkdir -p /opt/jdk
|
||||||
|
cd /opt/jdk
|
||||||
# oracle-javaX-installer runs wget with a dot progress indicator which ends up
|
rm -rf $JDK_MAJOR
|
||||||
# as one line per dot in the build logs.
|
mkdir -p $JDK_MAJOR
|
||||||
# To avoid this noise we redirect all output to a file that we only show if apt-get fails.
|
cd $JDK_MAJOR
|
||||||
echo "Installing JDK..."
|
fetch_jdk_tgz $JDK_FULL
|
||||||
if ! apt-get -y install oracle-java8-installer oracle-java8-set-default >/tmp/jdk_install.log 2>&1 ; then
|
tar x --strip-components=1 -zf $(path_to_jdk_cache $JDK_FULL)
|
||||||
cat /tmp/jdk_install.log
|
for bin in /opt/jdk/$JDK_MAJOR/bin/* ; do
|
||||||
echo "ERROR: JDK install failed"
|
name=$(basename $bin)
|
||||||
exit 1
|
update-alternatives --install /usr/bin/$name $name $bin 1081 && update-alternatives --set $name $bin
|
||||||
fi
|
done
|
||||||
|
echo -e "export JAVA_HOME=/opt/jdk/$JDK_MAJOR\nexport PATH=\$PATH:\$JAVA_HOME/bin" > /etc/profile.d/jdk.sh
|
||||||
echo "JDK installed: $(javac -version 2>&1)"
|
echo "JDK installed: $(javac -version 2>&1)"
|
||||||
|
|
||||||
if [ -e "/tmp/oracle-jdk8-installer-cache/" ]; then
|
|
||||||
cp -R /var/cache/oracle-jdk8-installer/* /tmp/oracle-jdk8-installer-cache
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
chmod a+rw /opt
|
chmod a+rw /opt
|
||||||
|
|
Loading…
Reference in New Issue