-
Notifications
You must be signed in to change notification settings - Fork 174
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
Reorganize and deduplicate Docker configurations #471
Comments
@ridoo Could you please take a look at those two options and comment on them from a dev/ops perspective |
@gannebamm yes, I will find some time for this by tomorrow. |
We discussed this internally and we very welcome the approach to reorganize the docker setup and to clean up the repositories in order to improve maintainability but also to simplify things and to make development more transparent! I would weigh our docker experience higher than Django. So we created a PR to propose a perspective on how to setup a custom GeoNode project from the Docker view. However, this PR might look quite radical on a first view as it leaves out the project generation from a template completely. This may be the common way in the Django world, but overlaps with concepts from the Docker world. I have to admit, however, that there may be very good reasons having such a Django template (at least for people coming from the Django world who are more used to this) which I am not aware of. Also, we left out the option to start development locally using paver, just to make our proposal as pure as possible. However, as you are providing Docker base images (which are also used in the Ansible and Vagrant setups), we do not see the need for having such a template, anymore. You could restructure this repository and provide ways to intercept customizations the Docker-way. This also would ease the maintainability of customized geonode projects as discussed on the mailing list (see here and here) or within this discussion on how to improve upgrading to newer version. So, how we see the geonode-project right now (you already mentioned some of these points):
What we propose:
All this would improve maintaining a geonode project. However, it would require some more things to smoothen the path
I hope this proposal is not too radical, but as said before, we just wanted to contribute a non-Django perspective using Docker. Looking forward on your feedback. |
@ridoo thanks for your proposal. I went through your drastic PR.
There are a lot of cases where a Docker deployment is not an option, so when discussing the architecture of this repo this must be kept in mind. Regarding the template project, the purpose of The following parts are particularly useful:
We could use something like pipx for the bootstrap.
As you know there are several env variables that depend on the deployment, in particular the internal and external hostnames, ports, and whether you have HTTPS or not, But yes, we can minimize the .env to what is strictly required. |
Yes, actually, what we propose is not a template project anymore. So there is no replacement. The structure represents more or less a project skeleton to start from. Just a sample setup how to structure your Docker develop which directly builds upon the upstream (images) and without having to bootstrap anything first. You are also right, that Docker is not for everything! So maybe, we could separate two things here:
In the end, we are all free to set up our own customized project structure of a GeoNode project. However, our proposal tries to tie the following: a) staying as close to the upstream as possible (without the hassle to backport template specific changes to the generated project), b) getting rid of all the duplicated bootstrap code and logic (you have to maintain) to generate the project (and decouple it from the upstream template), c) focus on Docker concepts as the project actually produces Docker images. Let me answer/comment on your feedback:
You could add these in the
Well, in fact there is an override mechanism: We do load
For what use cases adding more Docker
Hmm, there are two nginx-related volumes: a) taking nginx-conf and b) taking the certificates. We do not see any advantages to store the nginx-conf as volume. Maybe it is just me/us, but it seems unusual when re-configuring the container that one has to delete the volume instead of just re-creating the container. But this might be a personal view on that (unless it would mark a volume and related config unnecessary).
Well, this depends on the use cases. We were always re-using what has been prepared in the
My personal preference would be, to directly see which image is meant to be deployed next to a GeoNode version. Taking GeoNode version
Yes, I agree. Picking sensible defaults can be tricky, but you actually do so already in the EDIT Forgot to answer on this completely:
Actually the opposite :). We would favor to see the Docker image configurations in the GeoNode core repository. Not sure if this somehow interferes with image tagging and the requirement to not override once tagged images in the registry. However, I think it makes sense to put the whole docker setup in a |
@mwallschlaeger, does this restructure have an impact on your Kubernetes rework? |
Just some quick feedback from me:
I like that tagging semantic.
Thünen also got rid of the nginx-conf volume since it did not help us but only created confusion.
I think extending the Dockerfile should work for our use cases 🤔 |
@ridoo thx for the clarification and your comments. I think we're converging.
I didn't notice it was mounted inside docker-compose.yml. In that case it looks ok to me. I would only rename it to
I would add a
Oh, ok. Yes makes sense!
So you would favor putting the data dir inside the GeoServer image and letting it create the volume? I'm open to it. We need to be very careful not to touch an already existing volume when the container is run.
This was my initial idea, but we have situations where the image must be rebuilt (a fix, or whatever) for the same component and/or GeoNode version. For those cases, you would republish the image with the same tag.
Let's we have this:
|
Good to read that!
Naming should not be an issue. I am fine with that. But for any case: the PR is just a proposal to help to clarify our discussion.
What would be the non-docker case? I do see the use case of a non-docker build (starting all services as non-containers), but would this have to reside along with the docker setup? I always thought the
Yes, you could do so: mount your custom However, if this turns out to be practical and useful would have to be tested and evaluated from the different perspectives we all have naturally.
You always have to take care before deleting volumes which may take more important data than "just" configuration (maybe a reason more to get rid of not necessary volumes). Anyway, it becomes tricky here, as the way how geoserver_data dir is prepared right now is (as you mentioned in another ticket) convoluted. But I like that, so let's take the ride for version
I see the need to configure this data directory from the outside which is not ideal (container config vs. persisted config), but I fear this is the way GeoServer has to be configured at the moment (please correct me, if I anyone has other ideas here). However, I do not see the need to "hide" this directory from the repository as it is part of the overall configuration, right? Just include it next to the
My preference would be to place those versions first, which get changed less often. But I get your point and will not put personal preferences at front.
Well, I do not vote for re-releasing the whole stack when a component changes. In addition, it would not make sense to include the component version (you could just use |
hey i just went through this thread and also wanna present my perspective on this, even i have just minimal experiences with geonode-project, but at least docker knowledge. I would disagree on your opinion for the image tags like: lets assume that geoserver major versions does not change within a geonode version so the release notes, and docker-compose file could provide info about the required geoserver version and only link to From the kubernetes perspective having constant image builds based on commits on the When it comes to geonode-project, geonode-k8s cannot geonode-project images atm. The main reason for that is that geonode-k8s is overwriting some initial steps like the entrypoint.sh and the tasks.py. Which wouldn't work together with a geonode-project container. |
If you want to stay cutting-edge, constant builds of the main dev branch are a bonus (but not a requirement) also for non-kubernetes environments. Once built centrally, it would save time and ressources at other places IMO. However, more important is to NOT push new images to an already tagged FULL version (including bugfix). I want to rely on the promise an image will not change, when I choose a very specific version of it. Use multi tagging approach instead:
Again, I find it handy to see which version is indicated to run in what GeoNode context. But I do not see this as a hard requirement. More important would be to document (on the GeoNode side) what GeoServer (et. al.) versions shall be used.
I agree on that. It may be possible to do the whole
@mwallschlaeger I did not go through all the changes which were required, but I think there may be room to converge things here. What do you think?
You could release |
This discussion is very useful and interesting, but I think it's becoming too complex to follow since we're mixing many concepts.
With regard to the last point, we had an internal call a few days ago. The change would have a relevant impact:
We would be in favor of creating an alternative/experimental repo with the new proposal (could be On the side of Docker, we're almost aligned
Do you agree on creating the three discussions? |
Hey @giohappy .. this is a very good discussion, though it grew a bit long already. Let me try to summarize shortly:
EDIT: (since we were writing comments almost concurrently) On my opinion, I think we should create a
I can discuss internally, where we can help.
This should be a one time task .. and upgrading to a new version would also require efforts even without the new project structure. However, as you said, you can just open a parallel track (two repositories) and see, how both get used over time.
Yes, you have to decide on that. Our preference would be the most simple one. As we are doing open-source, everything is transparent enough. You do not build the same version on different base images, so there is no need to have such a fine grained version tagging. And, if there's a bug just trigger the whole release train -- it's a one click task nowadays. |
@ridoo I would try to make a new version for the project that supports both Docker and "bare metal" setups. As we said it's a matter of rounding some corners in your proposal. I'm already testing it and I should be able to submit my response. One thing that didn't work so far is the condiguration of
I will review your proposal next days. I think I will open a dedicated issue for that. We should move in steps with this refactoring... |
No hurry on that. We will test such a setup in a Thünen-related project which starts in the next weeks. One Goal is to reveal issues when running the whole thing in a real world setup. @gannebamm will keep you posted on the progress, I am sure 😄 Regarding the DJANGO_SETTINGS_MODULE I would bet, you could just remove it from the .env file. I is a central configuration and would not be changed anyway, would it? |
After further internal discussions, we came up with the following proposal for the Docker configurations:
For the moment we won't touch the geonode-project's code structure. This will be evaluated again afterwards, |
Hey @giohappy good to read your approach. I have two comments:
|
yes, sure.
I don't see other solutions to avoid overwriting, have the flexibility to apply fixes to an image, and decouple images from specific geonode versions. |
The repo for the Docker configurations has been bootstrapped. For the moment it just contains copies of the original configurations. |
Workflows for the automatic build and publishing of Docker images have been created.
|
First step into the refactoring of Docker images usage in |
Sorry for the late response here. We have tested the proposed approach in our latest development project and were quite happy with the tooling. You can see the outcome here: https://github.com/GeoNodeUserGroup-DE/geonode-blueprint-docker We will further gather experience with the approach and also see how upgrades between versions will work out. The first upgrades in between our development cycle went relatively smoothly (4.1 -> 4.2.2) I think for now this issue can be closed @giohappy? Otherwise, I would follow your idea and switch to a discussion. |
@gannebamm it would be useful to bring the discussion about the project layout on. I see your geonode-docker-blueprint implements some of the ideas discussed here. It would be great if the official layout and the "official" one converged. |
Context
geonode-project
is meant for customized versions of GeoNode, so having the ability to build custom images for the services fits well heregeonode
andgeonode-project
should use the published imagesProblems
geonode-project
's own Docker configurations) is convenient BUT the versioning of images would be impossible. This is already happening forGeoserver
.Solutions
Solution A
geonode
andgeonode-project
Solution B
Opinions?
The text was updated successfully, but these errors were encountered: