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

DOCKER-249 : added environment variable for ignoring fragment #148

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions templates/bundle/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ ENV LIFERAY_CONTAINER_KILL_ON_FAILURE=0
ENV LIFERAY_CONTAINER_STARTUP_LOCK_ENABLED=false
ENV LIFERAY_CONTAINER_STARTUP_LOCK_FILE=/opt/liferay/data/liferay-startup-lock
ENV LIFERAY_CONTAINER_STATUS_ACTIVE_MODULES=
ENV LIFERAY_CONTAINER_STATUS_IGNORE_ACTIVE_MODULES=
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chinmay-abhyankar, can you please include this new variable considering the alphabetic order?

Thanks

ENV LIFERAY_CONTAINER_STATUS_ENABLED="false"
ENV LIFERAY_CONTAINER_STATUS_REQUEST_CONTENT=
ENV LIFERAY_CONTAINER_STATUS_REQUEST_TIMEOUT=10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ function main {
modules_active=true
fi

if [ -z "${LIFERAY_CONTAINER_STATUS_IGNORE_ACTIVE_MODULES}" ]
then
# if not set the ignore module, then ignore fragment by default
lecho "LIFERAY_CONTAINER_STATUS_IGNORE_ACTIVE_MODULES not set, setting its value to ignore fragment"
Comment on lines +54 to +55
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chinmay-abhyankar, usually, we don't add comments in the code, therefore can you please remove these 2 lines?

LIFERAY_CONTAINER_STATUS_IGNORE_ACTIVE_MODULES="fragment"
fi

while true
do
if [ "${started}" != true ]
Expand Down Expand Up @@ -110,9 +117,9 @@ function main {
) | telnet 127.0.0.1 11311 2> /dev/null
)

local active_count=$(echo "${telnet_content}" | grep -E "${LIFERAY_CONTAINER_STATUS_ACTIVE_MODULES}" | grep -c ACTIVE)
local active_count=$(echo "${telnet_content}" | grep -v "${LIFERAY_CONTAINER_STATUS_IGNORE_ACTIVE_MODULES}" | grep -E "${LIFERAY_CONTAINER_STATUS_ACTIVE_MODULES}" | grep -c ACTIVE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chinmay-abhyankar, considering that a fragment never transitions to the status Active, please see https://liferay.slack.com/archives/C07GFPNS1AT/p1725532590516359, and it remains in the status Resolved, does it make sense to set by default the value fragment in the variable LIFERAY_CONTAINER_STATUS_IGNORE_ACTIVE_MODULES?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally developers uses fragment in symbolic name of OSGI modules which are use to fragment OOTB modules. So to sent default is to ignore checking of all modules which have word fragment, even if the envionment variable is not set

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, @chinmay-abhyankar. Thanks for your clarification! 🙂

Since it seems to be a decision on the developer's side, maybe we should use the content of the variable LIFERAY_CONTAINER_STATUS_IGNORE_ACTIVE_MODULES only if it's set, does it make sense to you?


local module_count=$(echo "${telnet_content}" | grep -cE "${LIFERAY_CONTAINER_STATUS_ACTIVE_MODULES}")
local module_count=$(echo "${telnet_content}" | grep -v "${LIFERAY_CONTAINER_STATUS_IGNORE_ACTIVE_MODULES}" | grep -cE "${LIFERAY_CONTAINER_STATUS_ACTIVE_MODULES}")

if [ "${module_count}" -eq 0 ]
then
Expand All @@ -125,7 +132,7 @@ function main {
else
echo "Modules pending activation:"

echo "${telnet_content}" | grep -E "${LIFERAY_CONTAINER_STATUS_ACTIVE_MODULES}" | grep -v ACTIVE
echo "${telnet_content}" | grep -v "${LIFERAY_CONTAINER_STATUS_IGNORE_ACTIVE_MODULES}" | grep -E "${LIFERAY_CONTAINER_STATUS_ACTIVE_MODULES}" | grep -v ACTIVE
fi
fi

Expand Down