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

Configuration and few basic questions #1

Open
antolinos opened this issue Jul 1, 2022 · 8 comments
Open

Configuration and few basic questions #1

antolinos opened this issue Jul 1, 2022 · 8 comments
Labels
documentation Improvements or additions to documentation

Comments

@antolinos
Copy link

Hi @RKrahl

I wanted to give a try and there a couple of things that I did not get. Mainly,

  • is the docker preconfigured?
  • what is the procedure to run it?
  • Which database does it use?

Thanks!

@RKrahl RKrahl added the documentation Improvements or additions to documentation label Jul 1, 2022
@RKrahl
Copy link
Owner

RKrahl commented Jul 1, 2022

hI @antolinos, thanks for pushing me. I'll reply next week. 😄

@antolinos
Copy link
Author

Hi @RKrahl,

Sorry, I did not want to push you. I was looking a way to use ICAT in my ingester CI and I knew you did some work with ICAT and Docker.
No hurries.

Cheers!

@RKrahl
Copy link
Owner

RKrahl commented Jul 1, 2022

Thanks for pushing anyway! This one needs some pushing for it to get done.

@RKrahl
Copy link
Owner

RKrahl commented Jul 15, 2022

Sorry, for the delay in responding!

On your questions:

  • is the docker [image] preconfigured?
    No. I prefer docker images to be generic, so that they can be deployed in many different scenarios. This docker image is built on top of glassfish:payara-5, which in turn is built on top of opensuse:15.3. (I'll need to upgrade the latter soonish.) The glassfish image contains Payara 5 as downloaded from the distribution, unzipped and having the default domain deleted. It adds a startup script that will, at container startup time, create a new domain and configure & start it. The icat image adds to that all the common ICAT components as downloaded and unzipped from the respective distribution packages without any changes. It adds another startup script that will take the configuration from a defined directory ($GLASSFISH_HOME/etc/icat), apply that to the installed ICAT components and deploy the components in the Payara domain, again at container startup time. The configuration also controls which components are enabled, so you can deploy any subset of components.

  • what is the procedure to run it?
    You need to provide the configuration for the ICAT components in the configuration directory $GLASSFISH_HOME/etc/icat. You could do that in a volume that is mounted from outside into the container or you could derive your customized image from this images, adding that configuration. The configuration directory should contain one plain text file APPS being a simple list of the components to deploy. For each of the listed components, the config directory needs to contain a subdirectory with the same name. The setup script will copy all files from the config subdirectory into the respective component directory and then call setup install in the component directory. The configuration directory may optionally also contain a script filter.sh that will then be called instead of the cp command to copy the files. This could be used to do on the fly variable substitution in the configuration files.
    Once you provide the configuration as described, you only need to fire up the container and it will do all it's magic at startup time.

  • which database does it use?
    This is entirely up to you, it is defined in the configuration that you need to provide, e.g. in $GLASSFISH_HOME/etc/icat/icat.server/setup.properties in the case of icat.server.

Note: $GLASSFISH_HOME is the top level directory of the Payara installation. It is an environment variable set in the image. The value is /opt/payara5 in the current version, but you should stick to referencing it by the variable, because this path is likely to change with the upcoming Payara 6. Using the variable will simplify the upgrade.

Note: for production, you will most likely use your own docker image derived from this one, having for instance your own IDS storage plugin installed.

@RKrahl
Copy link
Owner

RKrahl commented Jul 16, 2022

Update, I forgot to mention one thing:

Depending on the database being used, you need a suitable JDBC client library. The corresponding jar file needs to be in the lib directory of the Payara domain. For MySQL or MariaDB, the mysql-connector-java package from the openSUSE distribution will do, it is installed in the glassfish image. For Oracle, you would need to download and install the package from Oracle. In that case, you might want to create a derived image with that package installed. In both cases, you may set the full path to the jar file in the $GF_DOMAIN_LIBS environment variable. The startup script for the glassfish image will then place a symbol link to the jar file into the domain lib directory before starting Payara.

Another thing is the SSL certificate. The startup script will install the certificate into the Payara keystore if it finds suitable files in PEM format in /etc/glassfish/certs.

@antolinos
Copy link
Author

Thanks Rolf for the clarification.

I working on having a running ICAT environment in the CI for my integration testing. For doing so, my approach is using docker compose with independent services (mainly based on your work) instead of a single dockerfile.

As you can imagine, my use case is not really for production therefore database can be volatile.

@RKrahl
Copy link
Owner

RKrahl commented Jul 25, 2022

Yes, that should work, I use that for my testing as well. Just add a database container (maybe MariaDB or something similar) to the services started by docker compose and configure the ICAT container to use that. In that setup, you could easily add some dummy test data in a db dump file to be read in by the database container at startup.

I plan to do something similar also for a CI test pipeline for python-icat, see icatproject/python-icat#39 (but I'd rather favour GH actions over travis in the meanwhile). I'd just need to familiarize myself a bit more with using docker and docker-compose in GH actions and find the time to set this up.

@RKrahl
Copy link
Owner

RKrahl commented Jun 2, 2023

Update (mostly a note to myself):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants