Still working on my Docker setup - almost there. ...
# docker
j
Still working on my Docker setup - almost there. I've run into a weird issue with cfpm though - I've tried both
Copy code
ENV CFPM_INSTALL   but then read this doesn't work without a warmed up server

So then tried 

# Install required packages with ColdFusion Package Manager (CFPM)
${BIN_DIR}/box cfpm install adminapi,administrator,ajax,caching,chart,document,feed,image,mail,mysql,spreadsheet,zip
But see this error: Packages have been downloaded. Now they will get installed. devenv-1 | caching package cannot be installed by the server. Please check the server logs and try installing again. etc for each package I'm trying to install? What's weird however is later in the console I see:
Copy code
devenv-1 | [INFO] 2023-08-16T11:09:49-04:00 runwar.context - Aug 16, 2023 11:09:49 AM Information [main] - Package caching started...
m
So, this might be a different thing, but I found I had similar issues when trying to run CF in a docker container with not enough RAM. For whatever reason it is dog slow in trying to get going and stuff times out and errors like the dickens. This was on CloudRun on a 2 core 4gb machine. 2 core 8gb ran like the wind. Again, I don't remember if it was the same error so I might be way off here...
j
Hmm - I'll give that a try. Also wondering if it's because CF isn't started when i run this? Not sure exactly what cfpm is doing under the hood. I assumed cfpm is just downloading stuff and copying it somewhere
m
Yeah, it should run fine, but I'm not certain what's going on here...
j
I wonder if in addition to 'install package' we should have 'download package' which just pulls the file but doesn't 'install'? Again I don't know what CFPM is doing but if packages are 'installed' when the server spins up - that would help with use in containers. Is there any way to confirm what CFPM is doing @Mark Takata (Adobe)? I'm using CommandBox but this doesn't seem to be related as it's just calling the native cfpm.sh under the hood. This is my test repo: https://github.com/jimpriest/mac-m1-test/blob/main/Dockerfile And running this - all my packages are installed - but the build time is really slow because it's attempting to install things, waiting and then failing. But doing a docker compose up I can see each package 'start' and open CFAdmin and verify they have been installed:
Copy code
cfml  | [INFO] 2023-08-16T19:03:38Z runwar.context - Aug 16, 2023 19:03:38 PM Information [main] - Package ajax started...
@jclausen just curious have you run into this before? ^^^^^
j
I have. It usually occurs on the first install, but the packages actually do get installed.
It seems to be intermittent.
j
Thanks for the confirmation it's not just me 🙂
j
Nope! 🙂 I would just ignore it if the packages are installed when the server actually starts up.
j
Yep. I didn't notice it originally because I was just installing one package to test and the error went by so fast in the console but now installing more packages it really slows down the build... not a huge issue but I'd like to understand more about how CFPM works...
I wonder where packages are installed?
j
WEB-INF/bundles
They are OSGI bundles. When they are loaded by the core CF server, the bundles get loaded at runtime and activated.
j
LOL you answered before I could even shell into my container Thnxs!
j
🙂
j
So my suggestion of adding a 'download package' may make sense - esp. in the context of the container. I'm assuming 'install' is doing something in addition to just downloading them
m
@Bagish Mishra this is another place we could improve developer experience, specifically in container installations. I know the team has been looking at some of the odd errors but can we look at doing a bit more control in terms of CFPM when running containerized workloads? Maybe a folder in /app where you could pull packages to and docker can look into when building CF? I dunno, would love feedback on how to improve this Jim/Jon.
👍 1
j
Actually, I think the implementation of CFPM isn’t bad at all. Effectively
cfpm install
does just “download” the packages to the server’s
WEB-INF/bundles
directory and updates the dependency file. The activation of the packages happens when the server starts. You have to have a server home established, though, when you run the command. Having the ability to install to a non-server bundles directory would be convenient, and portable: e.g.
cfpm.sh --bundleDirectory /var/opt/cfpm_bundles install orm,mysql,administrator,adminapi
I wouldn’t complain about native server startup environment variable support ( your Docker images have this - but they pass through to
cfpm.sh
, same with the Ortus ones ). Lucee has the latter and it makes it easy to start a server and ensure that the requested extensions/packages are downloaded and installed at the first time of server start. e.g.
CFPM_INSTALL=orm,mysql,administrator,adminapi
❤️ 1
j
Thanks for the info! So maybe the hang up and 'error' I'm experiencing is when it tries to update that dependency file because it doesn't exist yet?