You might have a look at: https://issues.apache.org/jira/browse/OFBIZ-10407

I tried to implement this some time ago....

Regards,

Hans

On 1/3/23 21:31, Daniel Watford wrote:
Hi Jacques and all,

 From the ongoing discussions regarding JDK 17 and release 21, I inferred
from one of Jacques comments that there was some difficulty in using
different JDK versions for the stable and next demos and it was therefore
preferred to run the stable and next demos on the same JDK version.

My inference may be incorrect here, but it got me thinking again on the
subject of running OFBiz from containers.

I'm not familiar with the infrastructure used to host the demo sites, so
this thought process may be a non-starter, but do we have the facility to
run Docker containers on the demo sites' server?

If containers on the demo servers are a possibility then it may be worth
exploring their use as they might allow side-stepping difficulties related
to installing JDK versions on the server.

There will doubtlessly be some difficulties to overcome and I don't have a
full solution in mind yet, but some potential benefits I see are:
- All dependencies, including the JDK, are encapsulated in the container
image. This will allow use of different JDK/Gradle versions for different
branches.
- Use of tagging on built images to identify the stable and next images.
- - Nightly scripts can pull the latest image for a tag and relaunch the
container accordingly.
- Demo images can embed the Derby database. The database can be pre-loaded
with demo data before the image is pushed to the image repository, speeding
up the process of updating a demo site to a new version.
- We will be able to learn from our demos and iterate on the OFBiz approach
to containers. We will then be in a better position to advise potential
users on container deployments. I believe that running OFBiz from a
container will reduce barriers for new users to evaluate OFBiz.

To be clear, I do not propose use of containers as an immediate need, and
do not wish discussions around containers to block any efforts around
release 21.

Some issues we would need to resolve:

- Is the use of containers viable on the demo servers?
- - Perhaps use of Docker containers is not permitted for some reason.

- We would need to figure out how we want to build container images.
- - My preference is to have the Dockerfile be part of the OFBiz sources,
that way the Dockerfile can change with the sources and become a
first-class build method.
- - I do not favour the approach of a Dockerfile external to the OFBiz
sources that then downloads and extracts a zip of the sources. My concern
is that the zip could change in a way unexpected by the Dockerfile user.
- - Having the Dockerfile alongside the sources it is building, rather than
retrieving sources from a URL, will make it easier for developers to try
out changes in their own container images, without having to amend the
Dockerfile. Any reduction in cognitive load for developers is a good thing
as they have plenty to worry about already! :)

- Where would we store built container images?
- - From past discussions on the container topic I remember a comment about
'the Apache way' is to distribute sources rather than binaries. From this I
infer that we probably do not want to stand up a publically accessible
repository to host demo container images.
- - Perhaps each demo site server can have access to a private container
image repository used only to host their own images.
- - - The build process could produce the demo container image and push it
to the relevant private repository.
- - Could the wider Apache Foundation offer any guidance from other
projects on this topic?

Thanks for reading this far! :) Comments and opinions appreciated.

Reply via email to