Better docker-ization (startup speed improvement, unused groupadd and useradd, awkward chown, and confusing settings)
#465
Replies: 2 comments 2 replies
-
|
@ItaloBorrelli @srstsavage @ChrisJohnNOAA I just want to check that you are using the official docker, which I believe is at https://hub.docker.com/r/erddap/erddap. Look at the information there. I don't know enough about Docker or what has changed in the image to answer your questions, Chris or Shane will have to do that. But first I want to be certain you are using the latest Docker image. |
Beta Was this translation helpful? Give feedback.
-
|
Hi, first thanks for the investigation and feedback. There are certainly some improvements we can make. Any opinions I offer below are my own and not necessarily representative of the project lead or others on the technical board. The entrypoint.sh script is largely based on the Unidata tomcat-docker entrypoint.sh. The chown/chmod operations are done to make sure that any files necessary to run Tomcat/ERDDAP are readable (and when appropriate writeable and/or executable) by the tomcat user, which as you've noted is configurable at runtime. This is supposed to make it easier for users, in that they can set the I definitely do think you're right that we don't need to be chowning all of the jar files, class files, etc under That reduces the 3-4 seconds previously spent on chowning /usr/local/tomcat to basically instantaneous. Thoughts? The chowing of On large ERDDAPs the dataset loading time is going to vastly eclipse the chown/chmod time for these files, but you're right to look for optimizations wherever we can find them. Regarding mounting your datasets.xml file, does setting Regarding the reference to the IOOS gold standard repo, while we should update any outdated setup guidance on that repo, I am not at all a fan of the ERDDAP docs linking off to an external repository for Docker setup instructions, nor the external gold standard repo providing a setup guide which may be out of date with the ERDDAP docker image. That externalization of Docker setup instructions was established before ERDDAP had an official image so we should clean that up; the ERDDAP docs should have sufficient Docker setup instructions, and the IOOS gold standard repo should focus on data standards and ERDDAP dataset configuration specific to the IOOS community standards. Again, my opinion. That said, as you've found the ERDDAP docs are more up to date/correct, and the section on environment variable configuration does mention that they override any values in setup.xml: https://erddap.github.io/docs/server-admin/deploy-install#environment-variables
Again, appreciate your interest/suggestions/contributions, and you're absolutely right that the image can be optimized and docs improved. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
There's a few things that I came across while running the docker-ization locally that aren't fixable directly through the
docker-compose.chownon${CATALINA_HOME}/content/makes bind mounted content difficult to deal withIn my system the
datasets.xmlis bind mounted. This aligns with the suggestion in the givendocker-compose.ymlto create the./erddapContentfolder:However, with the
chowndone byentrypoint.shthis folder is ro for the host system, so to modify the file one has to enter the container or copy a change into the container. Instead one could just be more selective with thechown, specifying:Long container startup
Issue
It takes a long time for a docker container to get to starting up tomcat. It would be better to do
chownandchmodfor catalina files in theDockerfileinstead ofentrypoint.sh. This does mean that theTOMCAT_USER_IDandTOMCAT_GROUP_IDcannot be modified. Leading togroupaddanduseraddnot being used, since userubuntu:1000:1000exists in the base Ubuntu image.Proposed cumulative solution
DockerfileAdd the following:
entrypoint.shRemove the following lines
and only do `chown -R $TOMCAT_USER_ID:$TOMCAT_GROUP_ID /erddapData
Documentation on setup values
The documentation currently points to the erddap gold standard page which is quite out of date. It references certain values as if they are modifiable, such as in this section the
bigParentDirectory. It took me quite a while to realize that no matter what I set it to be insetup.xmlit was being overridden byERDDAP_bigParentDirectory. In fact, I'm not sure at all if any values from thesetup.xmlare still used or if only the values set by env withERDDAP_prefixes are used. I also don't know where and how they're accessed and used by the ERDDAP webapp, just that they are provided in thesetenv.sh. I'm sure I could help document if I understood that part a little bit better.Thanks for any suggestions and feel free to open a feature issue for me if you'd like me to submit my code changes in a PR.
Beta Was this translation helpful? Give feedback.
All reactions