WHOIGit / ifcbdb

IFCB dashboard
MIT License
8 stars 9 forks source link

new build and deployment process #380

Closed joefutrelle closed 6 months ago

joefutrelle commented 1 year ago
joefutrelle commented 1 year ago

TODO: pin dependencies and remove :latest from postgis and other images where new releases might break existing functionality.

srstsavage commented 6 months ago

This isn't a change introduced by this branch, but I think it's cleaner to remove the container_name configs and allow Docker Compose to manage the container names. With the current config only one instance of the stack can be run on a single computer since the container names will conflict...

srstsavage commented 6 months ago

Related, the init commands should use docker compose instead of docker for portability:

docker compose exec ifcbdb python manage.py migrate
docker compose exec ifcbdb python manage.py collectstatic
docker compose exec ifcbdb python manage.py createsuperuser
joefutrelle commented 6 months ago

Thanks @srstsavage these suggestions LGTM

srstsavage commented 6 months ago

On master, settings.py imports from local_settings at the end of the file.

https://github.com/WHOIGit/ifcbdb/blob/master/ifcbdb/ifcbdb/settings.py#L155-L158

try:
    from .local_settings import *
except ImportError as e:
    raise ImportError('local settings not found') from e

This new branch doesn't seem to have that import, or reference local_settings anywhere else.

https://github.com/WHOIGit/ifcbdb/blob/new_build/ifcbdb/ifcbdb/settings.py#L153

Does that need to be fixed, or am I missing some settings conventions?

joefutrelle commented 6 months ago

For a typical deployment it doesn't, because every relevant parameter is configured via environment variables, but for atypical deployments I agree that we should restore this.

srstsavage commented 6 months ago

Yep, that makes sense. A few other things:

Let me know if you'd like me to put together PRs against new_build for any of these. Thanks, overall this updated deployment approach looks great!

joefutrelle commented 6 months ago

Agreed on all points, I would love a PR against new_build with all the changes you suggested but I'm happy to implement it myself if you don't have time.

srstsavage commented 6 months ago

Implemented all suggested changes in #382, let me know if anything needs to be changed!

joefutrelle commented 6 months ago

Great that you've also reduced the size of the image @srstsavage, any other things you want to do before I review #382?

srstsavage commented 6 months ago

@joefutrelle Nope, all ready for review!

joefutrelle commented 6 months ago

Note that when we merge this we should not delete the new_build branch until I notify the IFCB Users Group since I currently am instructing alpha testers to use it.

joefutrelle commented 6 months ago

@srstsavage I pinned all the dependencies and created a corresponding release tag for pyifcb and so I think this is buttoned up. Can you give this a spin?

srstsavage commented 6 months ago

@joefutrelle Seems to be working well!

joefutrelle commented 6 months ago

There's the matter of #383 which is pending against this branch, and I want to get that in before the release. @mike-kaimika do you want to retarget #383 against master after doing this merge, or do you think it's better to get those changes into new_build before we merge this PR?

mike-kaimika commented 6 months ago

I think it probably makes more sense to get it merged into this branch, assuming neither of you had any issues with it. That way there's just one final branch for all the revisions.

joefutrelle commented 6 months ago
srstsavage commented 6 months ago

Deployment using the updated whoi/ifcb-dashboard Docker Hub image (sha256:4f13deefec11da3076ba48d5d1f479029ea6f8bea0a05fd07aa1385f6c74fde4) is working well for me.

joefutrelle commented 5 months ago

Thanks for verifying that @srstsavage !