RANGER-4458: Usersync Webapp, metrics and Docker changes - #1103
Conversation
|
Please add test scenarios that were tested in docker with this change. thanks. |
|
Validated the following scenarios in the Docker environment: UserSync with Unix source — confirmed the existing Unix-based sync flow continues to work as expected. |
44cc8fb to
8b04499
Compare
de1d8d3 to
3ac85df
Compare
|
The local build has passed successfully. With the updated patch I have also completed the following testing:
|
3ac85df to
dac07aa
Compare
dac07aa to
df2a2ef
Compare
|
pradeepagrawal8184
left a comment
There was a problem hiding this comment.
Please check the above issues
kumaab
left a comment
There was a problem hiding this comment.
Thanks @Sanket-Shelar for the patch, added few comments.
|
|
||
| if [ ! -d RANGER_USERSYNC_LOG_DIR ]; then | ||
| mkdir -p $RANGER_USERSYNC_LOG_DIR | ||
| chmod 777 $RANGER_USERSYNC_LOG_DIR |
There was a problem hiding this comment.
777 gives all perms to everyone, use appropriate perms (minimally required).
There was a problem hiding this comment.
Checked other scripts in the project and added permission 755
df2a2ef to
dfa7430
Compare
Addressed #1–#4, #6, and #7. For #5, we deferred RangerMetricsContainerSource because it depends on Admin/KMS’s server.tomcat.EmbeddedServer, which UserSync does not use; adding it broke Docker startup (NoClassDefFoundError). UserSync API/cache/sync metrics remain available; |
| } | ||
| } | ||
|
|
||
| public Map<String, Long> getMetric(MetricType metricType) { |
There was a problem hiding this comment.
Return defensive copies from getMetric()
There was a problem hiding this comment.
Updated getMetric() to return an unmodifiable defensive copy. Introduced a private getInternalMetric() so incrementMetric() continues to update the live maps.
dfa7430 to
bd5f684
Compare
| public Map<String, Long> getMetric(MetricType metricType) { | ||
| Map<String, Long> metric = getInternalMetric(metricType); | ||
|
|
||
| return metric == null ? null : Map.copyOf(metric); |
There was a problem hiding this comment.
MetricCacheUtil.getMetric() can return null — RangerUserSyncSourceApis.refresh() would NPE on totalApiCount.keySet(). Safer to return Collections.emptyMap() instead of null.
What changes were proposed in this pull request?
Converted usersync to webapp module, added docker changes for usersync webapp and added metrics for usersync.
How was this patch tested?
Manual build passing and tested on docker.
RANGER-4458: Ranger Usersync - Convert to Web Application
RANGER-5701: Support for Usersync as WebApp in docker containers
RANGER-5702: Add/ Update metric details for Ranger UserSync