Skip to content
This repository was archived by the owner on Dec 24, 2025. It is now read-only.

A new path#118

Merged
pmarino90 merged 66 commits intomainfrom
total-revamp
Apr 22, 2025
Merged

A new path#118
pmarino90 merged 66 commits intomainfrom
total-revamp

Conversation

@pmarino90
Copy link
Copy Markdown
Owner

@pmarino90 pmarino90 commented Apr 5, 2025

Background

I originally built Makina as a tool to simplify self-hosting third-party tools and my own projects. While there are plenty of PaaS options available for these kinds of purposes, I felt they were mostly overkill for my needs. Plus, I wanted the flexibility to use any hosting provider I preferred.

This led me to start experimenting with Docker's REST APIs, and from there, the first embryonic version of Makina was born. It had an ugly UI and a mechanism to supervise running containers, ensuring they stayed where I wanted them to be.

After using it for some time, I realized I was partially rebuilding Docker's features while still facing the same friction that initially pushed me to create this tool. The main issue stemmed from the mechanism I used to create a running deployment: everything had to be defined in the UI and reside in an image registry. This included my own projects, which meant every deployment required an already-built image. While not impossible, it wasn’t ideal—especially when I wanted to quickly deploy something locally without setting up an entire CI pipeline. It just wasn’t fun.

Eventually, I let the idea sit for a while. Over time, and after seeing similar tools emerge (like Kamal), I came to a few realizations:

  • I don’t need to reinvent supervision logic (even though it’s way easier with Elixir and the BEAM).
  • Having an environment definition written in a file is a good thing.
  • Most of the time, deploying from a developer’s laptop is fine—and when it’s not, CI can handle it just as easily.
  • Ultimately, this tool is something I’m building for myself—but individuals or small teams might also find it useful in the future.

With these insights in mind, I started playing around with the idea of rewriting Makina entirely. That idea took many forms before finally settling into the approach outlined in this PR.

The New Approach

First off, Makina will now be a CLI tool that you can run directly from your laptop. It uses a file to define how the environment should look, along with a simple DSL for specifying options. No YAML or JSON—just an Elixir script with a DSL. That said, you don’t need to know Elixir to write a functional deployment.

The new version also supports managing multiple servers—something that would have added significant complexity in my previous implementation.

Makina introduces two classes of applications that can be deployed: standalone and stacks.
Under the hood, both are essentially Docker containers:

  • Standalone applications are "freestanding" applications—typically third-party software you want running on your server as single containers.
  • Stacks define clear boundaries and can include multiple applications that are linked together. Stacks share the same network, can depend on one another, and their deployments will account for these dependencies.

This PR only implements standalone deployments to keep things simple for the initial release. However, support for stacks is next on the roadmap.

A lot of work still lies ahead, but I feel much more confident that this is the right direction for Makina.

pmarino90 added 30 commits April 3, 2025 13:41
This is useful to execute one-shot commands over SSH.
It the future reusing the same session, therefore using
`:ssh_connection.send/5` might be more appropriate.
We want to be sure that we are going to change the state of only those
entities that actually changed, instead of all of them.
For this reason each entity gets tagged with a hash that we use it also
in the target server. When the local hash changes then we have to
re-deploy the application.
pmarino90 added 26 commits April 8, 2025 13:16
This allows us to:
* test correctly that the the command produced by `Docker` is correct
* eventually replace the connection method in the future, while keeping
part of the system intact
Default is disables, as it requires additional configurations if one
needs it enabled.
At the moment is a private property that is used to ensure
exposed apps are in the same network where the proxy is
In order to properly load balance instances of a given application with
Traefik is better to configure the port used to expose the service.

Generally Traefik can deduct that based on different critieria but
fixing it is probably the most deterministic behaviour and it also
doesn't require the container to actively expose anything on the host
directly.
This command will be used to manage standalone applications define in
the Makinafile
@pmarino90 pmarino90 marked this pull request as ready for review April 22, 2025 19:38
@pmarino90 pmarino90 merged commit 8d3176d into main Apr 22, 2025
1 check passed
@pmarino90 pmarino90 deleted the total-revamp branch April 22, 2025 19:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant