ERDDAP / erddap

ERDDAP is a scientific data server that gives users a simple, consistent way to download subsets of gridded and tabular scientific datasets in common file formats and make graphs and maps. ERDDAP is a Free and Open Source (Apache and Apache-like) Java Servlet from NOAA NMFS SWFSC Environmental Research Division (ERD).
Creative Commons Zero v1.0 Universal
78 stars 57 forks source link

Use Docker for ERDDAP distributions #60

Closed BobSimons closed 2 years ago

BobSimons commented 2 years ago

Investigate using Docker for ERDDAP distributions. In particular, this may make it much easier to bundle other software with ERDDAP, e.g., ncWMS, or MapServer.

7yl4r commented 2 years ago

I have bundled ERDDAP alongside some other docker containers in marinebon/mbon-dashboard-server. It works well and I am happy to help others use docker-compose to do the same.

abkfenris commented 2 years ago

If @kwilcox ok's adapting axiom-data-science/docker-erddap, then I'm willing to make a PR to add the Dockerfile, and setup Github Actions and Packages to build and host the image.

BobSimons commented 2 years ago

There hasn't been any progress on this, but there is new documentation for installing ERDDAP via Docker (thanks to a group at the 2022 IOOS Code Sprint): https://ioos.github.io/erddap-gold-standard/index.html

abkfenris commented 2 years ago

I hadn't realized that @kwilcox had given a thumbs up to adapting the code from axiom's repo.

@BobSimons how do you go from what is in this repo to the erddap.war and erddapContent.zip assets attached to a release?

BobSimons commented 2 years ago

I have a checklist for releases from before I used Git. I have a small script (makeErddapWar.bat) which makes erddap.war. erddapContent.zip is made by running some Java code Erddap.makeErddapContentZip(theSourceDirectory, theDestinationDirectory);

abkfenris commented 2 years ago

Do either of those depend on resources that are outside of this repo? I couldn't find either script in the repo, just a reference to Erddap.makeErddapContentZip().

It would be really helpful to have the release checklist to work through to make sure that I'm getting all of the nuance needed to make a correct release.

BobSimons commented 2 years ago

Erddap.makeErddapContentZip() is a method in WEB-INF/classes/gov/noaa/pfel/erddap/Erddap.java. Thus it is already in the Git archive.

I will add the makeErddapWar.bat file to the Git archive.

abkfenris commented 2 years ago

I've started a PR #79 to work towards building a Docker image as part of the repo using Github Actions.

Right now I've got the workflow trigger for every push to the repo. Github Actions does support triggering workflows on release creation, but that can be much harder to test (at least without making a ton of releases to test how the workflows run).

image

So far I've adapted makeErddapWar.bat into the build job, and extracted out the long list of files that are used as inputs to jar into jar-inputfilesto try to make it easier to maintain and reuse acrossmakeErddapWar.batand the workflow. Currently it will automatically builderddap.war`, though it appears to be coming out a few MB smaller. I'm not sure if there is a difference in compression or if there is something missing.

It looks like Erddap.makeErddapContentZip() is making a standard zip file with what looks to be the contents of https://github.com/BobSimons/erddapContent . Should I clone that repo, or is there a better way to get that data?

I've tried to set up enough of an job that TestAll can be run, but I'm getting a failure trying to run that. I don't know enough Java to know where to start digging into that, so it would be awesome if someone could take a look there. I did figure out the classpath formatting is different between win and linux (; vs :).

I've got the start of a docker job that uses the erddap.war created in the build job and a derived version of Axiom's Dockerfile to build an image. I've got a whole bunch of things commented out right now there (waiting on test to pass/pushing to repo/logging in/setting up Docker metadata), but it works.

BobSimons commented 2 years ago

@abkfenris, please email me: bob.simons@noaa.gov .

BobSimons commented 2 years ago

After some private discussions, I think I don't like your proposed system to use GitHub Actions, to test ERDDAP, generate erddap.war, then make the Docker version of ERDDAP. The main problems are that:

I think it is far better for you to make a (semi) automated system that:

That avoids tons of trouble and unnecessary interactions. It is a clear line of separation of responsibilities. That approach is easier for you -- you can develop and test your script any time by running it against the current official erddap.war. And my release notes will point to your GitHub repository as the place to go for the Docker version.