bushwallyta271828 / logic_graph_scalable

This repository should support the logicgraph.dev website, taking over from logic_graph.
MIT License
0 stars 0 forks source link

What tools should I use if this is now going to be a Django project? #63

Closed bushwallyta271828 closed 8 months ago

bushwallyta271828 commented 8 months ago

This tutorial looks good: https://www.youtube.com/watch?v=NAOsLaB6Lfc.

bushwallyta271828 commented 8 months ago

I'm also looking at this shorter tutorial: https://www.youtube.com/watch?v=PkynrL1aU9o.

Both of these tutorials seem to be using Python virtual environments, despite also using Docker. I don't understand what the purpose of that is. It feels redundant to me.

bushwallyta271828 commented 8 months ago

This post talks about why all tutorials seem to create a virtual environment even when moving to Docker: https://forum.djangoproject.com/t/why-use-venv-at-all-when-there-is-docker/19838. Seems to not be super necessary but helpful for local development?

bushwallyta271828 commented 8 months ago

Upon further contemplation, I think that using a virtual environment actually makes sense here. I'm not going to be using the GitHub website interface for my coding in the future, and when I do start developing this project locally, I'm not going to want to push to GitHub, build a Docker image, and then run that Docker image on a staging environment just to test a simple tweak to the codebase. When I'm developing locally, I'm going to want to make sure that my tests are by default being run using the same versions of software that will be included in the Docker image so that the code behavior doesn't suddenly change between my local environment and the Docker image. A Python virtual environment would then make a lot of sense.

bushwallyta271828 commented 8 months ago

Question: do I then need to worry about synchronizing the version of Python I'm using to perform local tests in my virtual environment with the version of Python specified in the Dockerfile that will eventually determine how my Docker container behaves?

bushwallyta271828 commented 8 months ago

Looking at this post right now. I don't like how .env being included in .dockerignore is the only thing stopping me from leaking my database password to a public GitHub repository. This doesn't feel like a best practice.

bushwallyta271828 commented 8 months ago

This tutorial video looks good: https://www.youtube.com/watch?v=nh1ynJGJuT8.

bushwallyta271828 commented 8 months ago

This longer video (2.5 hours) by the same guy looks very good. I haven't watched it yet, but he says at the beginning that he's using Docker Compose in a lightweight, not-super-scalable way. That's kind of what I wanted all along, but I want to keep an eye out for how not-scalable that really is. I don't want a repeat of last year!

bushwallyta271828 commented 8 months ago

Okay, that video provided the best explanation I've seen about why you might want a Python virtual environment: it helps separate the Python dependencies from any dependencies that might be on the image of Python used to build Docker. I'm now completely sold that this is a good idea and not just a relic from a pre-Docker-containerization age.

bushwallyta271828 commented 8 months ago

2/3 of the way through the video. Really liking it so far. Thought: how do we separate frontend from backend using this file structure?

bushwallyta271828 commented 8 months ago

Okay, I knew that video was too good to be true. Amazon isn't supporting Docker Compose any more: https://docs.docker.com/cloud/. Bother!

EDIT: Upon further googling, Amazon may still support something very similar to Docker Compose? https://github.com/aws/amazon-ecs-cli. I'm just nervous about relying on a technology that feels like it's being sidelined.

bushwallyta271828 commented 8 months ago

This is a more recent video by the same channel but dedicated to AWS Lightsail: https://www.youtube.com/watch?v=4gt8dRrLQG4.

bushwallyta271828 commented 8 months ago

That AWS Lightsail video looks a lot like what I was trying but failing to do two days ago. Promising! My only lament is that the earlier video showed how to use docker compose files to orchestrate everything, whereas this video appears at first glance to demonstrate a much more manual setup. I feel myself drawn back to the question of whether something like docker compose files are supported by a cloud provider. If I don't find anything soon, though, then I should just follow along with the steps in that tutorial.

bushwallyta271828 commented 8 months ago

Yeah, that AWS Lightsail video seemed to have a good amount of AWS-specific code contained in the main application docker image. That doesn't sit well with me at all.

bushwallyta271828 commented 8 months ago

Update: I'm looking favorably at Hashicorp Nomad right now. I'd really like something cloud-provider-agnostic. I don't want to get locked in to any one cloud service and I'd really prefer to keep the codebase clean and abstract. Docker Compose would have been absolutely perfect but it seems to be deprecated now, so I'm looking at substitutes.

bushwallyta271828 commented 8 months ago

Okay, let's close this issue and create a new issue focusing on the topic I've drifted on to. I think that using Django should solve most of my database versioning concerns, so now I'm just back to selecting container orchestration software.