What is Swan
?
Swan
is a Mesos
framework forcus on long running tasks, which inspired by Marathon
, written with Golang
and base on latest Mesos
HTTP API.
What does Swan
do?
With Swan
you can deploy long running application
on mesos cluster, control lifecycle of the application, scale up or scale down any instances
size you want, can also do rolling-update with new versions base on flexible health checks
defined by you. Swan
also designed for high avaliability which means any server crash wouldn't affect running applications. with service discovery
and API gateway
build-in, service discovery made easy.
Swan
is created and maintained by Dataman-Cloud, and licensed under the Apache License, Version 2.0.
for more documentation about Swan
please refer to swan-docs
Noteworthy Features
- Application deployment
- Application scaling
- Build in HTTP Proxy, Load Balance
- Rolling upgrade
- Version rollback
- Health check
- Auto failover
- High Availability with Raft backend
- Build in DNS
Installation
From Source
clone Swan
source code from github.com:
git clone git@github.com:Dataman-Cloud/swan.git
Then you can compile Swan
with:
make
# or build within docker
make docker-build
Run as standalone mode
goreman start
or run swan in docker
make docker-run-mixed
Run as high availability mode
detail of swan-cluster
Use swan --help
to see usage.
Getting Started
Use curl
curl -X POST -H "Content-Type: application/json" -d@example/template-replicates.json http://localhost:9999/v_beta/apps
curl http://localhost:9999/v_beta/apps
curl http://localhost:9999/v_beta/apps/nginx0003-xcm-unnamed
curl -X DELETE http://localhost:9999/v_beta/apps/nginx0003-xcm-unnamed
curl -X PATCH -H "Content-Type: application/json" http://localhost:9999/v_beta/apps/nginx0003-xcm-unnamed/scale-up -d '{"instances": 2}'
curl -X PATCH -H "Content-Type: application/json" http://localhost:9999/v_beta/apps/nginx0003-xcm-unamed/scale-down -d '{"instances": 2}'
- application rolling upgrade
curl -X PUT -H "Content-Type: application/json" -d@new_verison.json http://localhost:9999/v_beta/apps/nginx0003-xcm-unnamed
curl -X PATCH -H "Content-Type: application/json" http://localhost:9999/v_beta/apps/nginx0003-xcm-unnamed/proceed-update -d'{"instances": $NUM}'
instances
-1 means upgrading all instances at once. Any other value specifies the number of instances to be updated at the same time.
curl -X PATCH -H "Content-Type: application/json" http://localhost:9999/v_beta/apps/nginx0003-xcm-unnamed/cancel-update
- list application versions
curl http://localhost:9999/v_beta/apps/nginx0003-xcm-unnamed/versions
curl http://localhost:9999/v_beta/apps/nginx0003-xcm-unnamed/versions/14012934223
Roadmap
See ROADMAP for the full roadmap.
Contributing
If you want to contribute to swan, make a PR or report a issue.
The goal of swan is to become the default and best scheduler for mesos, so let's do it!
Licensing
Swan is licensed under the Apache License, Version 2.0. See
LICENSE for the full
license text.