From 8e64a7b153f96414378a1f0e5aa0021feca868a7 Mon Sep 17 00:00:00 2001 From: Antonios Kouzoupis Date: Fri, 3 Nov 2023 19:15:43 +0100 Subject: [PATCH 1/3] [HWORKS-830] Configurable jvm tmp dir --- recipes/copy_config.rb | 4 ++++ recipes/install.rb | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/recipes/copy_config.rb b/recipes/copy_config.rb index 158f9d43c..7530f473f 100644 --- a/recipes/copy_config.rb +++ b/recipes/copy_config.rb @@ -54,6 +54,10 @@ "-DHADOOP_CONF_DIR=#{node['hops']['dir']}/hadoop/etc/hadoop", "-DjvmRoute=${com.sun.aas.instanceName}"] +if not node['install']['tmp_directory'].eql?("") + jvm_options.push("-Djava.io.tmpdir=#{jvm_options}") +end + glassfish_jvm_options "JvmOptions #{payara_config}" do domain_name domain_name admin_port admin_port diff --git a/recipes/install.rb b/recipes/install.rb index 962d76e19..8d134a9a5 100644 --- a/recipes/install.rb +++ b/recipes/install.rb @@ -214,6 +214,16 @@ group node['glassfish']['group'] end +jvm_options = [ + "-DHADOOP_HOME=#{node['hops']['dir']}/hadoop", + "-DHADOOP_CONF_DIR=#{node['hops']['dir']}/hadoop/etc/hadoop", + "-Dcom.sun.enterprise.tools.admingui.NO_NETWORK=true" +] + +if not node['install']['tmp_directory'].eql?("") + jvm_options.push("-Djava.io.tmpdir=#{jvm_options}") +end + node.override = { 'java' => { 'install_flavor' => node['java']['install_flavor'], @@ -241,7 +251,7 @@ 'remote_access' => false, 'secure' => false, 'environment_file' => node['hopsworks']['env_var_file'], - 'jvm_options' => ["-DHADOOP_HOME=#{node['hops']['dir']}/hadoop", "-DHADOOP_CONF_DIR=#{node['hops']['dir']}/hadoop/etc/hadoop", '-Dcom.sun.enterprise.tools.admingui.NO_NETWORK=true'] + 'jvm_options' => jvm_options }, 'extra_libraries' => { 'jdbcdriver' => { From 78e564edbbd5bf7c27daa005e49f900142bbabac Mon Sep 17 00:00:00 2001 From: Antonios Kouzoupis Date: Mon, 6 Nov 2023 10:17:52 +0100 Subject: [PATCH 2/3] [HWORKS-830] I was very tired --- recipes/copy_config.rb | 2 +- recipes/install.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/copy_config.rb b/recipes/copy_config.rb index 7530f473f..b3ea6e0b7 100644 --- a/recipes/copy_config.rb +++ b/recipes/copy_config.rb @@ -55,7 +55,7 @@ "-DjvmRoute=${com.sun.aas.instanceName}"] if not node['install']['tmp_directory'].eql?("") - jvm_options.push("-Djava.io.tmpdir=#{jvm_options}") + jvm_options.push("-Djava.io.tmpdir=#{node['install']['tmp_directory']}") end glassfish_jvm_options "JvmOptions #{payara_config}" do diff --git a/recipes/install.rb b/recipes/install.rb index 8d134a9a5..738f2d85a 100644 --- a/recipes/install.rb +++ b/recipes/install.rb @@ -221,7 +221,7 @@ ] if not node['install']['tmp_directory'].eql?("") - jvm_options.push("-Djava.io.tmpdir=#{jvm_options}") + jvm_options.push("-Djava.io.tmpdir=#{node['install']['tmp_directory']}") end node.override = { From a02c780a3eaa6a4b07dcf183a7ec1744fbf83873 Mon Sep 17 00:00:00 2001 From: Antonios Kouzoupis Date: Mon, 6 Nov 2023 11:33:08 +0100 Subject: [PATCH 3/3] [HWORKS-830] Set tmpdir for both HA/Standalone and fresh install/upgrades --- providers/configure_server.rb | 13 +++++++++++++ recipes/copy_config.rb | 4 ---- recipes/install.rb | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/providers/configure_server.rb b/providers/configure_server.rb index 30903cde2..07f7f1830 100644 --- a/providers/configure_server.rb +++ b/providers/configure_server.rb @@ -187,6 +187,19 @@ admin_port admin_port secure false end + + if not node['install']['tmp_directory'].eql?("") + glassfish_jvm_options "JvmOptions java.io.tmpdir" do + domain_name domain_name + admin_port admin_port + username username + password_file password_file + target target_config + secure false + options ["-Djava.io.tmpdir=#{node['install']['tmp_directory']}/glassfish"] + not_if "#{asadmin_cmd} list-jvm-options --target #{target_config} | grep tmpdir" + end + end end action :glassfish_configure_realm do diff --git a/recipes/copy_config.rb b/recipes/copy_config.rb index b3ea6e0b7..158f9d43c 100644 --- a/recipes/copy_config.rb +++ b/recipes/copy_config.rb @@ -54,10 +54,6 @@ "-DHADOOP_CONF_DIR=#{node['hops']['dir']}/hadoop/etc/hadoop", "-DjvmRoute=${com.sun.aas.instanceName}"] -if not node['install']['tmp_directory'].eql?("") - jvm_options.push("-Djava.io.tmpdir=#{node['install']['tmp_directory']}") -end - glassfish_jvm_options "JvmOptions #{payara_config}" do domain_name domain_name admin_port admin_port diff --git a/recipes/install.rb b/recipes/install.rb index 738f2d85a..4c3995ab4 100644 --- a/recipes/install.rb +++ b/recipes/install.rb @@ -221,7 +221,7 @@ ] if not node['install']['tmp_directory'].eql?("") - jvm_options.push("-Djava.io.tmpdir=#{node['install']['tmp_directory']}") + jvm_options.push("-Djava.io.tmpdir=#{node['install']['tmp_directory']}/glassfish") end node.override = {