Coder Social home page Coder Social logo

aklinker1 / miasma Goto Github PK

View Code? Open in Web Editor NEW
19.0 3.0 5.0 1.79 MB

An opinionated managment UI for Docker Swarm

Home Page: https://miasma.aklinker1.io/

License: MIT License

Dockerfile 0.33% TypeScript 34.79% Vue 63.34% JavaScript 0.94% CSS 0.61%
docker-swarm docker raspberry-pi portainer

miasma's Introduction

miasma's People

Contributors

aklinker1 avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

miasma's Issues

Service upgrade webhook

During CI, to tell Miasma to upgrade a service, we should be able to hit a webhook to tell it to pull the latest image and restart the service.

Use dataloaders for commonly accessed data

Dataloaders will improve the efficiency of the API by not requesting the same data twice from a data source. Right now, performance is fine, but as the complexity of the application grows, dataloaders will become necessary.

  • Docker service by ID
  • App by ID
  • Node by ID
  • Route by App ID
  • Env by App ID

Update services instead of starting/stopping them

Stopping and starting services to apply changes has several downsides:

  1. There's downtime
  2. The previous run logs cannot be recovered, since the service has a different ID
  • So instead of "stopping" the service, scale it down to 0 replicas? See if this is the "right" way to do this
  • Instead of "restarting" each service, update it with the new config

Routes not set immediately

When adding a route to an app, I have to manually restart it before the route shows up on traefik's dashboard or is actually handled properly:

Steps to Recreate

miasma apps:create example -i ealen/echo-server
miasma route:set -a example --host example.com

# Then I have to manually restart the app
miasma apps:restart -a example

Support Node Labels

Not service or container labels. The API and CLI already support custom placements, but they're too docker-y and I have to look at the docs every time I want to set them up. You also have to use docker commands to assign a node a label.

  • Assign label to node via API
  • Assign label to node via CLI
  • Simplify placements to just a node label rather than x.y.z === label

App shows up on multiple nodes

Scaling doesn't exist right now, so I shouldn't see an app on multiple nodes on the UI, but I've seen this when an app is switched between nodes. Probably has something to do with how I'm filtering the service tasks :/

Registry Plugin

Miasma's second plugin, an image registry.

  • Support secure and insecure registries
  • Allow specifying a domain name
  • Add webhooks to auto-upgrade apps when pushing new images
  • Custom node placement

Secure Traefik Dashboard

Right now, we're passing --api.insecure=true to allow access to the traefik dashboard on port 8080, but that allows everyone access to the dashboard. Lets add additional configuration to the Traefik Plugin's config, so that we can enable the secure dashboard with basic auth:

type TraefikConfig struct {
	EnableHttps       bool   `mapstructure:"enableHttps"`
	CertEmail         string `mapstructure:"certEmail"`
	CertsDir          string `mapstructure:"dataDir"`
+	SecureDashboard   bool   `mapstructure:"secureDashboard"`
+	DashboardRoute    string `mapstructure:"dashboardRoute"`
+	DashboardUsername string `mapstructure:"dashboardUsername"`
+	DashboardHtPasswd string `mapstructure:"dashboardHtPasswd"`
}

Web Dashboard

  • View apps #25
  • Start/stop apps_ #25
  • Open app URL #32
  • Create App c7bfadf
  • Delete App #46
  • Restart App #46
  • View app details #46
  • Edit app details #46
  • View docker service logs #64
  • View docker service ps #62
  • Enable/disable plugins
  • View service distribution across the cluster #29
  • Add node help #45
  • Edit node labels

Imporve Usage Docs

  • Configuring DNS records (local network and public internet) #33
  • Configuring SSL for Traefik plugin (if there's any additional steps) #39
  • Intra-app communication #33

Don't restart apps that are stopped after making a change

Editing an app that is stopped will make it restart. I'd prefer to keep it stopped and let the user decide when they want to start it back up.

Steps to Recreate

$ miasma apps:create Test -i ealen:echo-server
$ miasma apps:stop -a Test
$ miasma apps:edit -a Test
$ maisma apps

Apps

 - Test (1/1 running)

(1 app)

Simple Authentication

Before you can run miasma in the cloud, there needs to be some form of authentication. For now, we're just gonna use and environment variable, that you can set when running the docker image:

# Inline
ACCESS_TOKEN=xyz docker run aklinker1/miasma ...

# Or in a .env file
docker run aklinker1/miasma --env-file .env

If no ACCESS_TOKEN is configured, no authentication will be required, and it will behave as it did before, backwards compatible.

I don't want to add support for users and per-app permissions at this point. Just get something out there that works and can be difficult to hack into.

Horizontal Scaling

Add a scale field to apps, defaulting to 1, and changes the number of replicas for it's docker service.

To scale via the API:

mutation {
  editApp(id: "...", changes: { "scale": 5 }) {
    scale
  }
}

To scale from the CLI:

miasma apps:edit --scale 5

On the UI, wherever we reference app.instances.total, change it to app.scale

CLI App Groups are incorrect

CLI app groups are wrong

No idea why, just saw this while working on something else.

$ miasma --version
Miasma CLI version 1.0.0, build 07d00e04

Autoupdating Apps

I note from the FAQ:

I don't want to SSH into my device every time I want to update the app version or change an environment variable. Ideally, apps should just update auto-magically (watchtower plugin incoming).

I highly recommend swarmupdater which I run in all my production Swarm clusters.

I'm even happy to fork it and maintain it ๐Ÿ˜…

Release Process for CLI

After #49, changelog and auto-versioning is ready to go and will support a second "module", the CLI. All that's left is figuring out the best way to release it. I think the only maintainable option is to use goreleaser, though I've never used it before.

Installation fails on Ubuntu 20.04

This is mostly just an FYI. You may want to document this somewhere:

root@test:~# curl -fsSL https://get.docker.com | bash -
# Executing docker install script, commit: b2e29ef7a9a89840d2333637f7d1900a83e7153f
+ sh -c 'apt-get update -qq >/dev/null'
E: Repository 'https://apprepo.vultr.com/ubuntu universal InRelease' changed its 'Codename' value from 'buster' to 'universal'
root@test:~# curl -fsSL https://get.docker.com | bash -
# Executing docker install script, commit: b2e29ef7a9a89840d2333637f7d1900a83e7153f
+ sh -c 'apt-get update -qq >/dev/null'
E: Repository 'https://apprepo.vultr.com/ubuntu universal InRelease' changed its 'Codename' value from 'buster' to 'universal'

I don't think you should even bother supporting anything as old as Ubuntu 20.04 anyway IMO.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.