jamiejackson
11/29/2022, 5:53 PMbdw429s
11/29/2022, 6:51 PMbdw429s
11/29/2022, 6:54 PMbdw429s
11/29/2022, 6:54 PMbdw429s
11/29/2022, 6:55 PMbdw429s
11/29/2022, 6:56 PMjamiejackson
11/29/2022, 6:56 PMbdw429s
11/29/2022, 6:56 PMLUCEE_ENABLE_WARMUP
env var
• get all lex files in place
• start server
• server will shutdown once it's done
• remove env varjamiejackson
11/29/2022, 6:57 PMbdw429s
11/29/2022, 6:59 PMjamiejackson
11/29/2022, 7:01 PMbdw429s
11/29/2022, 7:01 PMjamiejackson
11/29/2022, 7:01 PMbdw429s
11/29/2022, 7:02 PMbdw429s
11/29/2022, 7:02 PMjamiejackson
11/29/2022, 7:04 PMI will say at Ortus we've had special "issues" with Orm not always working on the server's first start, but I'm not sure if that behavior was related to what you're describingI bet it's the same thing. It's the same thing I experienced until I added my workaround. Check out bullet 1 in my "refs" section. In which micha talks about this "just-in-time" installation, which never sat right with me in a container context. https://dev.lucee.org/t/please-explain-hibernate-orm-installation-initialization-internals/4917
bdw429s
11/29/2022, 7:04 PMjamiejackson
11/29/2022, 7:13 PMjumpmaster
11/29/2022, 7:19 PMbdw429s
11/29/2022, 7:23 PMLUCEE_ENABLE_WARMUP
flag enabled
• starts Lucee and lets it shutdown when it's donebdw429s
11/29/2022, 7:24 PMbdw429s
11/29/2022, 7:24 PMbdw429s
11/29/2022, 7:25 PMjclausen
11/30/2022, 5:48 PMFROM ortussolutions/commandbox:lucee5
#Example using Hibernate Extension ( GUIDS HERE : <https://download.lucee.org/> )
ENV LUCEE_EXTENSIONS=FAD1E8CB-4F45-4184-86359145767C29DE;version=3.5.5.87
RUN ${BUILD_DIR}/util/warmup-server.sh
jclausen
11/30/2022, 5:49 PMbox
to install it:
RUN box install 5C558CC6-1E67-4776-96A60F9726D580F1@2.0.0+6428
jamiejackson
11/30/2022, 7:56 PMjamiejackson
11/30/2022, 7:57 PMshutdownFelix()
inherently waits for working threads to complete or something: https://github.com/lucee/Lucee/blob/011bf2f2663722ff4fc1bd94257b35fde47323ef/core/src/main/java/lucee/runtime/engine/CFMLEngineImpl.java#L1754bdw429s
11/30/2022, 8:25 PMrely on the lucee mechanism for installing pluginsTo be be clear, there is no other mechanism. The only way to install an extension into Lucee is to ask Lucee to install it for you. The question is usually whether Lucee is finished doing so before you halt the warmup process.
jamiejackson
11/30/2022, 8:27 PMbdw429s
11/30/2022, 8:28 PMi'm not spotting the magic in LUCEE_ENABLE_WARMUP,It's really just that it shuts down the server when it's done so you don't have to guess. All of the env var checks and
deploy/
folder checks in Lucee are now synchronous (as of 5.3.7) and happen as soon as Lucee boots and it won't process any request until it's done.
The scenario you're trying to avoid is
start lucee
sleep 20
stop lucee
because what if it takes 21 seconds to finish installing all the extensions? Well, you shut down too soon and the extensions aren't correctly installed. So with the flag it's just
set lucee_enable_warmup true
start lucee
and that's it. it shuts down when it's one and you don't have to guess.jamiejackson
11/30/2022, 8:32 PMbdw429s
11/30/2022, 8:33 PMbdw429s
11/30/2022, 8:34 PMcurl
until it comes back with a 200jamiejackson
11/30/2022, 8:35 PMjamiejackson
12/01/2022, 6:58 PM#!/usr/bin/env bash
set -e
echo "create a test app"
mkdir -p /var/www/wwwroot/test_app
cat > /var/www/wwwroot/test_app/Application.cfc <<EOF
component {
this.ormenabled = true;
}
EOF
cat > /var/www/wwwroot/test_app/index.cfm <<EOF
<cfscript>
ormReload();
</cfscript>
EOF
echo "wait until extension is installed"
until $(curl --output /dev/null --silent --head --fail "<http://localhost:8888/test_app/>"); do
printf '.'
sleep 1
done
echo ""
echo "clean up test app"
rm -rf /var/www/wwwroot/test_app
jamiejackson
12/01/2022, 6:58 PMLUCEE_ENABLE_WARMUP
thanks a lot for the help, @bdw429s