I am not sure what it's needing to phone home for ...
# lucee
m
I am not sure what it's needing to phone home for . We install the extensions (copy lex files to the lucee-server/context/deploy folder) and then do a warmup in the docker build phase. This warms up everything and downloads all the requirements as that is what it needs to do to install the extensions AFAIK. I havent found it "erratic and unreliable" in the 1000's of deployments we have done so far using this.
šŸ‘ 1
Adding a list of the UUID's of the extensions to the LUCEE_EXTENSIONS env var is another way to go, I just happen to have the extension files to hand as we build them in a separate process.
šŸ‘ 1
a
what it's needing to phone home for
It's phoning home when the stuff ISN'T warmed. ie: to get a proper functional and complete installation of Lucee and its CFML installed, there are two options (as far as I can tell): • prewarm it somehow (under discussion here) • just let it phone home when it tries to run some code calling
encodeForHtml
or
imageNew
or [fuck knows, I don't know what Lucee has decided is an "extentions" for these purposes] The erraticness I mentioned was off the back of Jamie seeming to indicate that the pre-warm thing didn't seem very reliable. I think it was you who suggested the prewarm process needed to have small apps that actually hit the functionality in question so Lucee went and got the extensions? To do that, I'd need an app that went through and hit every bit of CFML functionality that's in extensions? Am I understanding this correctly? So it's not just a "call something like
/opt/lucee/bin/prewarm
and it will go finish its install", it's just a way of running Lucee quickly to run some code that then triggers the phone-home stuff?
But sounds like if I identify all the "lex files" (whatever those are) for the native-CFML-but-in-an-extension extensions, then the prewarm will indeed complete the proper install of all that lot?
m
I see the issue here. I think this is the encodeforHTML specifically asking for that, rather than any other functionality correct?
Unless there is other "phone home" stuff you mean?
I just tried it with an image I was working on:
Copy code
FROM azul/zulu-openjdk-alpine:11-latest
ADD <https://cdn.lucee.org/lucee-express-6.0.0.530-SNAPSHOT.zip> /tmp/lucee.zip
RUN apk update && apk add zip && unzip /tmp/lucee.zip -d /opt/lucee && rm /tmp/lucee.zip 
COPY ./webroot /opt/lucee/webapps/ROOT/
RUN mkdir -p /opt/lucee/lucee-server/context
ADD <https://ext.lucee.org/esapi-extension-2.2.4.13.lex> /opt/lucee/lucee-server/context/deploy
COPY ./config/catalina.properties /opt/lucee/conf/
RUN LUCEE_ENABLE_WARMUP=true /opt/lucee/startup.sh 
ENTRYPOINT [ "/opt/lucee/startup.sh" ]
I added the esapi extension and then did a call , there was no downloading at runtime?
I will check all the logs and get back to you in a sec.
j
You need to set the server deploy.log to trace to see what happens under the hood. Not sure if you saw my correction but I no longer recommend that prewarm method. It doesn't work as of last September. Use this instead, simply:
prewarm.sh
.
m
Yeah, but what does prewarm.sh do?
Is this in the lucee docker files? (as you see above, I am using express or tomcat, depending)
j
It actually waits for stuff to install before shutting down tomcat.
m
Same as
LUCEE_ENABLE_WARMUP=true /opt/lucee/startup.sh
j
Okay, if not using the official docket image, you can export the LUCEE-ENABLE_WARMUP var instead.
It's not the same anymore, Mark, I proved it to myself with deploy.log.
m
Just call start.sh or catalina.run with
LUCEE_ENABLE_WARMUP=true
I am looking at the deploy.log
j
Export that var instead to make it reliable
I'll show you when I get back to my desk
m
My runtime deploy.log (which is actually being putputted to the console) has:
INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/lucee/webapps/ROOT] has finished in [1,253] ms
This is lucee 6 as shown above. So I am just trying to replicate the error but showing my work
I changed the deploy.log to trace
re-checking now
j
Sorry, I didn't read the whole thread so I might be missing the angle here. However, @Adam Cameron, please do note my conclusion about proper extension installation here. It's got the link to the change in the official image, too: https://cfml.slack.com/archives/C06TA0A9W/p1691615352585169?thread_ts=1691140244.277319&amp;cid=C06TA0A9W
There's not a lot to
prewarm.sh
but the takeaway for me was that the change to an exported variable (as seen in that commit) was important.
m
What version of lucee? so I can check
Also, please note, that I am EXPLICITLY adding the ESAPI extension:
Copy code
ADD <https://ext.lucee.org/esapi-extension-2.2.4.13.lex> /opt/lucee/lucee-server/context/deploy
Ahh, to the wrong folder. 2 secs.
ok, so that works but gives deploy errors as I think esapi is included as is in 6. Dont have details
Trying
5.3.12.0-SNAPSHOT.zip
j
What version of lucee? so I can check
if that was for me: sorry, i'm not sure how to cross-check that easily.
m
@jamiejackson not for you. Trying to replicate the issue that @Adam Cameron is having so I did a bunch of tests.
b
We should prolly split Jamie's thread and Adam's. While they're both related to extensions, I I'm not sure they're both having the same issue.
šŸ‘ 1
a
That would be good, yes.
@Mark Drew (he/him) yeh the esapi one was just the first thing it futzed out on. As stuff like
encodeForHtml
is pretty core to CFML is an "extension", then I really don't know what would / would not be an extension. I have no visibility of how any of this stuff works (other than reading the stuff you've provided, which I appreciate), so don't really have much of an understanding of what to expect with all this.
m
What version of lucee are you using so I can double confirm the error pls/
a
5.3.9.173
q
@Adam Cameron -- Using the official images, I've been successful at doing an "ENV LUCEE_EXTENSIONS ......." in my Dockerfile, copy in my code, then run the /usr/local/tomcat/bin/prewarm.sh That prewarm does download all the extensions and any dependencies they may have into the image layer. I have a few hundred sites running it in that manner on both Docker, k8 and Lightsail Containers.
But since more and more is getting ripped out of core and put into modules, you do have to pay attention to what functions you use. the ORM and JSON functions getting ripped out caused quite a bit of heartburn for me -- esp since when they were doing it they moved development to the Ortus one (which overall is a good thing, just I hate that it happened in a minor version update).
z
which json functions?