Skip to content

Commit 364af3e

Browse files
authored
chore: Switch to new image that only contains HMS (#447)
* chore: Switch to new image that only contains HMS * changelog * fix HADOOP_OPTS * Revert change of HIVE_METASTORE_HADOOP_OPTS * Go back to HADOOP_OPTS
1 parent 290f226 commit 364af3e

6 files changed

Lines changed: 46 additions & 22 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
### Changed
8+
9+
- BREAKING: Switch to new image that only contains HMS.
10+
For most of the users this is an internal change, but this is breaking for users of custom logging configurations as
11+
the key `hive-log4j2.properties` in the ConfigMap containing the logging configuration must now be called
12+
`metastore-log4j2.properties` ([#447]).
13+
14+
[#447]: https://github.com/stackabletech/hive-operator/pull/447
15+
716
## [24.3.0] - 2024-03-20
817

918
### Added

rust/crd/src/lib.rs

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ pub mod affinity;
3434
pub mod security;
3535

3636
pub const APP_NAME: &str = "hive";
37-
// directories
37+
38+
// Directories
3839
pub const STACKABLE_CONFIG_DIR: &str = "/stackable/config";
3940
pub const STACKABLE_CONFIG_DIR_NAME: &str = "config";
4041
pub const STACKABLE_CONFIG_MOUNT_DIR: &str = "/stackable/mount/config";
@@ -43,27 +44,31 @@ pub const STACKABLE_LOG_DIR: &str = "/stackable/log";
4344
pub const STACKABLE_LOG_DIR_NAME: &str = "log";
4445
pub const STACKABLE_LOG_CONFIG_MOUNT_DIR: &str = "/stackable/mount/log-config";
4546
pub const STACKABLE_LOG_CONFIG_MOUNT_DIR_NAME: &str = "log-config-mount";
46-
// config file names
47+
48+
// Config file names
4749
pub const CORE_SITE_XML: &str = "core-site.xml";
4850
pub const HIVE_SITE_XML: &str = "hive-site.xml";
4951
pub const HIVE_ENV_SH: &str = "hive-env.sh";
50-
pub const HIVE_LOG4J2_PROPERTIES: &str = "hive-log4j2.properties";
52+
pub const HIVE_METASTORE_LOG4J2_PROPERTIES: &str = "metastore-log4j2.properties";
5153
pub const JVM_SECURITY_PROPERTIES_FILE: &str = "security.properties";
5254

53-
// default ports
55+
// Default ports
5456
pub const HIVE_PORT_NAME: &str = "hive";
5557
pub const HIVE_PORT: u16 = 9083;
5658
pub const METRICS_PORT_NAME: &str = "metrics";
5759
pub const METRICS_PORT: u16 = 9084;
58-
// certificates and trust stores
60+
61+
// Certificates and trust stores
5962
pub const SYSTEM_TRUST_STORE: &str = "/etc/pki/java/cacerts";
6063
pub const SYSTEM_TRUST_STORE_PASSWORD: &str = "changeit";
6164
pub const STACKABLE_TRUST_STORE: &str = "/stackable/truststore.p12";
6265
pub const STACKABLE_TRUST_STORE_PASSWORD: &str = "changeit";
6366
pub const CERTS_DIR: &str = "/stackable/certificates/";
64-
// metastore opts
65-
pub const HIVE_METASTORE_HADOOP_OPTS: &str = "HIVE_METASTORE_HADOOP_OPTS";
66-
// heap
67+
68+
// Metastore opts
69+
pub const HADOOP_OPTS: &str = "HADOOP_OPTS";
70+
71+
// Heap
6772
pub const HADOOP_HEAPSIZE: &str = "HADOOP_HEAPSIZE";
6873
pub const JVM_HEAP_FACTOR: f32 = 0.8;
6974

@@ -441,14 +446,16 @@ impl Configuration for MetaStoreConfigFragment {
441446
let mut result = BTreeMap::new();
442447

443448
let env = formatdoc! {"
444-
-javaagent:/stackable/jmx/jmx_prometheus_javaagent.jar={METRICS_PORT}:/stackable/jmx/jmx_hive_config.yaml
445-
-Djavax.net.ssl.trustStore={STACKABLE_TRUST_STORE}
446-
-Djavax.net.ssl.trustStorePassword={STACKABLE_TRUST_STORE_PASSWORD}
447-
-Djavax.net.ssl.trustStoreType=pkcs12
448-
-Djava.security.properties={STACKABLE_CONFIG_DIR}/{JVM_SECURITY_PROPERTIES_FILE}
449-
{java_security_krb5_conf}", java_security_krb5_conf = java_security_krb5_conf(hive)};
450-
451-
result.insert(HIVE_METASTORE_HADOOP_OPTS.to_string(), Some(env));
449+
-javaagent:/stackable/jmx/jmx_prometheus_javaagent.jar={METRICS_PORT}:/stackable/jmx/jmx_hive_config.yaml \
450+
-Djavax.net.ssl.trustStore={STACKABLE_TRUST_STORE} \
451+
-Djavax.net.ssl.trustStorePassword={STACKABLE_TRUST_STORE_PASSWORD} \
452+
-Djavax.net.ssl.trustStoreType=pkcs12 \
453+
-Djava.security.properties={STACKABLE_CONFIG_DIR}/{JVM_SECURITY_PROPERTIES_FILE} \
454+
{java_security_krb5_conf}",
455+
java_security_krb5_conf = java_security_krb5_conf(hive)
456+
};
457+
458+
result.insert(HADOOP_OPTS.to_string(), Some(env));
452459

453460
Ok(result)
454461
}

rust/operator-binary/src/command.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use stackable_hive_crd::{
2-
HiveCluster, HIVE_LOG4J2_PROPERTIES, HIVE_SITE_XML, STACKABLE_CONFIG_DIR,
2+
HiveCluster, HIVE_METASTORE_LOG4J2_PROPERTIES, HIVE_SITE_XML, STACKABLE_CONFIG_DIR,
33
STACKABLE_CONFIG_MOUNT_DIR, STACKABLE_LOG_CONFIG_MOUNT_DIR, STACKABLE_TRUST_STORE,
44
STACKABLE_TRUST_STORE_PASSWORD, SYSTEM_TRUST_STORE, SYSTEM_TRUST_STORE_PASSWORD,
55
};
@@ -25,8 +25,8 @@ pub fn build_container_command_args(
2525
format!("cp -RL {STACKABLE_CONFIG_MOUNT_DIR}/* {STACKABLE_CONFIG_DIR}"),
2626

2727
// Copy log4j2 properties
28-
format!("echo copying {STACKABLE_LOG_CONFIG_MOUNT_DIR}/{HIVE_LOG4J2_PROPERTIES} to {STACKABLE_CONFIG_DIR}/{HIVE_LOG4J2_PROPERTIES}"),
29-
format!("cp -RL {STACKABLE_LOG_CONFIG_MOUNT_DIR}/{HIVE_LOG4J2_PROPERTIES} {STACKABLE_CONFIG_DIR}/{HIVE_LOG4J2_PROPERTIES}"),
28+
format!("echo copying {STACKABLE_LOG_CONFIG_MOUNT_DIR}/{HIVE_METASTORE_LOG4J2_PROPERTIES} to {STACKABLE_CONFIG_DIR}/{HIVE_METASTORE_LOG4J2_PROPERTIES}"),
29+
format!("cp -RL {STACKABLE_LOG_CONFIG_MOUNT_DIR}/{HIVE_METASTORE_LOG4J2_PROPERTIES} {STACKABLE_CONFIG_DIR}/{HIVE_METASTORE_LOG4J2_PROPERTIES}"),
3030

3131
// Copy system truststore to stackable truststore
3232
format!("keytool -importkeystore -srckeystore {SYSTEM_TRUST_STORE} -srcstoretype jks -srcstorepass {SYSTEM_TRUST_STORE_PASSWORD} -destkeystore {STACKABLE_TRUST_STORE} -deststoretype pkcs12 -deststorepass {STACKABLE_TRUST_STORE_PASSWORD} -noprompt")

rust/operator-binary/src/product_logging.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
use crate::controller::MAX_HIVE_LOG_FILES_SIZE;
22

33
use snafu::{OptionExt, ResultExt, Snafu};
4-
use stackable_hive_crd::{Container, HiveCluster, HIVE_LOG4J2_PROPERTIES, STACKABLE_LOG_DIR};
4+
use stackable_hive_crd::{
5+
Container, HiveCluster, HIVE_METASTORE_LOG4J2_PROPERTIES, STACKABLE_LOG_DIR,
6+
};
57
use stackable_operator::{
68
builder::ConfigMapBuilder,
79
client::Client,
@@ -87,7 +89,7 @@ pub fn extend_role_group_config_map(
8789
}) = logging.containers.get(&Container::Hive)
8890
{
8991
cm_builder.add_data(
90-
HIVE_LOG4J2_PROPERTIES,
92+
HIVE_METASTORE_LOG4J2_PROPERTIES,
9193
product_logging::framework::create_log4j2_config(
9294
&format!(
9395
"{STACKABLE_LOG_DIR}/{container}",

tests/templates/kuttl/kerberos-s3/70-install-access-hive.yaml.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,22 +155,26 @@ data:
155155
hive_client.create_table(table(database_name, local_test_table_name, f"/stackable/warehouse/location_{database_name}_{local_test_table_name}"))
156156
except AlreadyExistsException:
157157
print(f"[INFO]: Table {local_test_table_name} already existed")
158+
print("[DEBUG]: Fetching schema")
158159
schema = hive_client.get_schema(db_name=database_name, table_name=local_test_table_name)
159160
expected = [FieldSchema(name='id', type='string', comment='col comment')]
160161
if schema != expected:
161162
print("[ERROR]: Received local schema " + str(schema) + " - expected schema: " + expected)
162163
exit(-1)
164+
print("[INFO]: Passed local access test")
163165

164166
# S3 access
165167
try:
166168
hive_client.create_table(table(database_name, s3_test_table_name, "s3a://hive/"))
167169
except AlreadyExistsException:
168170
print(f"[INFO]: Table {s3_test_table_name} already existed")
171+
print("[DEBUG]: Fetching schema")
169172
schema = hive_client.get_schema(db_name=database_name, table_name=s3_test_table_name)
170173
expected = [FieldSchema(name='id', type='string', comment='col comment')]
171174
if schema != expected:
172175
print("[ERROR]: Received s3 schema " + str(schema) + " - expected schema: " + expected)
173176
exit(-1)
177+
print("[INFO]: Passed S3 access test")
174178

175179
print("[SUCCESS] Test finished successfully!")
176180
exit(0)

tests/templates/kuttl/logging/03-install-hive.yaml.j2

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ kind: ConfigMap
44
metadata:
55
name: hive-log-config
66
data:
7-
hive-log4j2.properties: |
7+
metastore-log4j2.properties: |
88
appenders = FILE, CONSOLE
99

1010
appender.CONSOLE.type = Console
@@ -63,6 +63,8 @@ spec:
6363
containers:
6464
hive:
6565
console:
66+
# FIXME: If we set this to DEBUG (for all occorences below), we get invalid log events in Vector
67+
# aggregator
6668
level: INFO
6769
file:
6870
level: INFO

0 commit comments

Comments
 (0)