-
Notifications
You must be signed in to change notification settings - Fork 32
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
Dockerize civic application #701
Comments
Hi guys, thanks for reaching out and apologies for the delayed response. You are correct that there is no Dockerfile for this project. We would be happy to accept such a change, however, you've caught us in a bit of transitional moment as we are in the final sprint to launching V2 of CIViC which is a new codebase (https://github.com/griffithlab/civic-v2). While we intend to keep the v1 API alive for some time for backwards compatibility, eventually, the new version will entirely replace this repo. Given that, it may be more productive to Dockerize the new codebase. Its a fairly standard rails deployment with nginx proxying requests to puma over a unix socket, sidekiq used for a task queue and redis used for the queue itself, with postgres as the primary data store. Systemd unit files and nginx config are in the new repo, as is a github action workflow that builds the frontend and deploys the whole application, which should be a good starting point. If this is something you're interested in tackling, I can also share notes on the dependencies you'll likely need. Also, you can check out the new version at https://staging.civicdb.org. |
To add to what @acoffman I think we would also be interested to hear your use-case for a CIViC docker container. While you will be able to populate your initial database with data from production CIViC, you wouldn't easily be able to pull updates from it or feed the data from your instance back into production CIViC. If you are planning on just running a fully standalone instance then that wouldn't be a problem, though. |
@acoffman, @susannasiebert thanks for sharing all these details. Good to hear that this project is doing so well and that a new version is coming out! We are still interested in the v1, given that the application we want to integrate this with is expecting v1 version of the API. Having said that, my question to @acoffman is: how different is the v2 API? I might have to start planning a migration of our code at some point. Can you please also let us know for how long the v1 will be supported with new data releases? There is a chance that our use case will require us to update our local instance of the Civic DB once every ~3 months or so. If v1 is sunsetting soon, it would be nice to know so we can take that into account. @susannasiebert given our use case (having a local copy of the Civic DB), can you please help us find a recent dump of the DB that we can use to populate our instance? I found this one, but it is >1 year old: https://github.com/griffithlab/civic-server/blob/staging/db/data.sql.gz ... and if I understand the README correctly, it is just a "sanitized version" for dev purposes. Where can we find a recent dump? Thanks! |
The V2 API is substantially different as it is using GraphQL rather than the previous REST-like approach. However, we are more than happy to provide guidance on porting your existing queries to the new API if you'd like, it should be relatively straightforward! We have not selected a precise sunset date yet but V1 API will remain up for months in order to give our existing users time to transition and when we do decide on a date, we will announce it on the site, our twitter account, etc. That being said, while you can expect the API to continue to function, the data itself will begin to get stale as V1 is in read-only mode. The "sanitized" SQL dump contains all the data from CIViC in full, the only sanitization going on there is the redaction of certain user-specific things such as OAuth UIDs, email addresses, etc but you're correct that the copy in the repo is dated at this point. We can generate a new one for you. |
@acoffman thanks for the extra details and the offer to help! I'll make sure to reach out if we get to the V2 migration part of our work! A new version of the SQL dump would be great for the time being. Please let us know, and we'll test it as soon as we can! |
I have pushed an updated sql dump which can be found in db/data.sql.gz |
Awesome! Thanks for your help @acoffman! We will test it and report back here. |
@pieterlukasse Apologies, I realized I inadvertently pushed a data dump with the V2 schema - that will not work with this app. I have corrected it; please be sure you have commit 3a9bd1e for a compatible file. Sorry if you guys have already started loading it in. |
@acoffman no worries! Thanks for the heads up 👍 |
@acoffman the data dump seems to work fine. Thanks again. We'll follow-up with a PR soon! |
@acoffman We're getting close to working version here https://github.com/ruslan-forostianov/civic-server/tree/dockerize We are getting a different behaviour with the public civic server while testing though. The below link gives 414 Request-URI Too Large on our version, but not on the public one. Does this issue sound familiar to you? |
Based on your Dockerfile it looks like you're serving the rails app directly with WEBrick (the default when using V1 of CIViC is served with the open source version of https://www.phusionpassenger.com/ while V2 is served with nginx proxying to puma (https://puma.io/) which is a more widely used approach than Passenger nowadays. While its generally best practice to put it behind a reverse proxy of some sort to handle things like ssl termination, cache headers, and static asset serving, you could potentially expose puma directly in your docker container instead of webrick and see if that's sufficient for your workload. Adding You will also likely want to make sure that you're running rails in production mode rather than development mode, otherwise it will do things like reload the code on each request. Handy for development, not so much for real use. |
Hi there, I could not find a Dockerfile in this project nor a repository that would build docker images in the git organisation.
Is it already implemented somewhere? If not, would contributors be interested to accept such change?
The text was updated successfully, but these errors were encountered: