Braindump for deployments

This commit is contained in:
Roberto Alsina 2024-07-03 10:19:58 -03:00
parent fcd597c143
commit bef6ded369
2 changed files with 49 additions and 1 deletions

48
docs/deployments.md Normal file
View File

@ -0,0 +1,48 @@
# Braindump on deployments
Problem: We have a funko, we want it deployed.
## Variant 1: Local deployment
Solution: Just start the funko's container locally. Done. It's mostly implemented.
## Variant 2: Deploy to the server
If the server doesn't have the image, we have "server build", so assume the image
is there.
Solution: start the funko on the server. Done. It's implemented.
## Variant 3: Deploy to the server and it's already running
1. If it's already running and it's running the latest image, then nothing to be done.
2. It it's running and is not the latest, we can stop it and start with the latest image.
* Action 2 causes downtime. Usually it will not be significant, but it's there.
* In the future it may be important to have zero downtime.
* We need to figure out what is implied by doing "zero downtime" to see if
not doing it now would make it impossible.
For zero downtime, we want to have two instances running, switch the proxy to the new
one, then stop the old one.
Currently it's impossible to run two instances because the container name is
faaso-funkoname, and we can't have 2 of those.
So: we could instead have faaso-funkoname-1, faaso-funkoname-2, etc. with some sort of suffix
Changes implied in the faaso code:
* If we have two containers for one funko, we need to consider the "state" of
the funko differently.
* What does it mean to start/pause/stop a funko with two instances
* Do we want to enable two-instance funkos? With round-robin proxy?
* What happens if we have two instances with different images?
Answers coming up.

View File

@ -22,7 +22,7 @@
<tbody id="funko-list">
</tbody>
</table>
<button id="update-funkos" style="float:right;" hx-trigger="load, click" hx-get="funkos/?format=html"
<button id="update-funkos" style="float:right;" hx-trigger="load, click, every 60s" hx-get="funkos/?format=html"
hx-target="#funko-list">Update</button>
</main>
<script>