{"id":18299674,"url":"https://github.com/containersolutions/mesos-starter","last_synced_at":"2025-09-06T15:36:44.742Z","repository":{"id":87118035,"uuid":"51756700","full_name":"ContainerSolutions/mesos-starter","owner":"ContainerSolutions","description":null,"archived":false,"fork":false,"pushed_at":"2018-09-09T19:54:03.000Z","size":278,"stargazers_count":45,"open_issues_count":15,"forks_count":10,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-21T05:11:25.148Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://container-solutions.com/mesos-starter/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ContainerSolutions.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-02-15T13:18:37.000Z","updated_at":"2024-01-13T23:54:56.000Z","dependencies_parsed_at":"2023-03-17T05:15:39.977Z","dependency_job_id":null,"html_url":"https://github.com/ContainerSolutions/mesos-starter","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ContainerSolutions%2Fmesos-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ContainerSolutions%2Fmesos-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ContainerSolutions%2Fmesos-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ContainerSolutions%2Fmesos-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ContainerSolutions","download_url":"https://codeload.github.com/ContainerSolutions/mesos-starter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247342633,"owners_count":20923631,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T15:09:50.321Z","updated_at":"2025-04-05T13:35:10.353Z","avatar_url":"https://github.com/ContainerSolutions.png","language":"Java","funding_links":[],"categories":["Tools"],"sub_categories":["Tools for Mesos Framework Developers"],"readme":"# Spring Boot starter for Mesos\n\n[![Join the chat at https://gitter.im/ContainerSolutions/mesos-starter](https://badges.gitter.im/ContainerSolutions/mesos-starter.svg)](https://gitter.im/ContainerSolutions/mesos-starter?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nSpring Boot starter package for writing Mesos frameworks\n\n## Features\n- Vertical scaling\n- Deploy executor on all slaves\n- Support for Docker containers\n\n## Getting Started\nStart by adding the `spring-boot-starter-mesos` dependency to your project\n\n```\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.containersolutions.mesos-starter\u003c/groupId\u003e\n    \u003cartifactId\u003espring-boot-starter-mesos\u003c/artifactId\u003e\n    \u003cversion\u003e0.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nMake sure your Spring Boot application has a name, by adding the `spring.application.name` to the `application.properties` file i.e.\n\n```\nspring.application.name=Sample application\n```\n\nTo run three instances of a Docker image add the following in `application.properties`\n\n```\nmesos.resources.distinctSlave=true\nmesos.resources.count=3\nmesos.resources.cpus=0.1\nmesos.resources.mem=64\nmesos.docker.image=tutum/hello-world:latest\n```\n\nThat is all you need to do if you have annotated your Spring configuration with `@SpringBootApplication` or `@EnableAutoConfiguration`.\n\n```\n@SpringBootApplication\npublic class SampleApplication {\n\n  public static void main(String[] args) {\n    SpringApplication.run(SampleApplication.class, args);\n  }\n}\n```\n\nFor a complete example, see `mesos-starter-sample` module.\n\n## Starting the application\nThe only required parameter for the scheduler is `mesos.master`. The value of the parameter is passed directly to the Mesos Scheduler Driver which allows the following formats\n\n- `host:port`\n- `zk://host1:port1,host2:port2,.../path`\n- `zk://username:password@host1:port1,host2:port2,.../path`\n- `file:///path/to/file`\n\nFor resiliency it is also recommended to point the application to a Zookeeper cluster and giving the instance a name.\n```\nmesos.zookeeper.server=zookeeper:2181\nmesos.framework.name=sampleApp1\n```\n\nThe purpose of `mesos.framework.name` is to distinguish instances of the scheduler.\n\n## Running tasks\nCurrently only Docker and shell commands are supported.\n\n### Docker\nRun any Docker image by setting the `mesos.docker.image` property. Eventually by overriding the `CMD` by `mesos.docker.command`\n\n### Shell command\nRun a command on by setting the `mesos.shell.command` property.\n\n### Custom task\nExtend the `TaskInfoFactory` class to create your own task.\n\n# Offers evaluation\nMesos-starter offers a set of offer evaluation rules\n- Physical requirements\n- Distinct slave\n- Instances count\n- Role assigned\n\nThey all work in combination with each other, though this might change in the future.\n\n## Physical requirements\nReject offers that does not have the required amount of either CPUs, memory or ports.\n\n### Ports\nThe ports requirement serves two purposes. Grapping ports and mapping them to the application.\nA very base configuration looks like this\n```\nmesos.resources.ports.http.host=ANY\nmesos.command=runwebserver.sh --port=$HTTP\n```\nThis will grap any unprivileged port, and expose it in an environment variable. Value of `.host` can be any off\n- `ANY`, `UNPRIVILEGED` will reserve any any port above 1024\n- `PRIVILEGED` will only reserve a port below 1024 (included)\n- *Any positive number* will only reserve a fixed port.\n\nWhen running with containers you can add the `.container` to map it to a container port when running in bridge mode, i.e.\n\n```\nmesos.resources.ports.http.host=ANY\nmesos.resources.ports.http.container=80\nmesos.docker.network=BRIDGE\nmesos.docker.image=tutum/hello-world\n```\n\nThis will reserve any port above 1024 and let docker map it to port 80 on the container.\n\n## Distinct slave\nThis rule will make sure that offers for hosts where the application is already running are being rejected.\n\n## Instances count\nThis rule will make sure that only a certain number of instances are running in the Mesos cluster. The instances count is exposed as a managed bean that can be accessed through Actuator Management API. Furthermore it'll also be possible to insert your own instances count bean.\nIt is recommended to have this rule enabled in most cases.\n\n## Role assigned\nThis rule only accept offers assigned to the Role defined in `mesos.role`.\n\n## Framework Authentication/Authorisation\nTo use [Framework Authentication](http://mesos.apache.org/documentation/latest/authentication/), please pass the following settings:\n\n| Command | Description | Default | Required |\n| --- | --- | --- | --- |\n| mesos.principal | The Mesos principal | | |\n| mesos.secret | The Mesos secret | | |\n\n# Use cases\n\nA few good examples\n\n## Stateless web application\nFor a stateless web application that can run anywhere in the cluster with only a requirement for a single network port, the following should be sufficient\n\n```\nmesos.resources.count=3\nmesos.resources.cpus=0.1\nmesos.resources.mem=64\nmesos.resources.ports=1\n```\n\nThis will run 3 instances of the application with one port exposed. Bare in mind that they all might run on the very same host.\n\n## Distributed database application\nFor a distributed database you want to run a certain number of instances and never more than one on every host. To achieve that you can enable `count` and `distinctSlave`, like\n\n```\nmesos.resources.count=3\nmesos.resources.distinctSlave=true\nmesos.resources.cpus=0.1\nmesos.resources.mem=64\nmesos.resources.ports=1\n```\n\n## Cluster wide system daemon\nOften operations would like to run a single application on each host in the cluster to harvest information from every single node. This can be achieved by not adding the instances count rule and adding the Distinct slave rule.\n\n```\nmesos.resources.distinctSlave=true\nmesos.resources.cpus=0.1\nmesos.resources.mem=64\n```\n\nAnother, safer, way to achieve the same result is by assigning resources to a specific role on all nodes. I.e. by adding the following to `/etc/mesos-slave/resources`\n```\ncpus(sampleDaemon):0.2; mem(sampleDaemon):64; ports(sampleDaemon):[514-514];\n```\n\nAnd configure the scheduler with the following options\n\n```\nmesos.role=sampleDaemon\nmesos.resources.distinctSlave=true\nmesos.resources.role=all\n```\n\nThis way the scheduler will take all resources allocated to the role and make sure it's only running once in every single slave.\n\nIt is always recommended to run the scheduler with a Mesos role and reserved resources in such cases to make sure that scheduler is being offered resources for all nodes in the cluster.\n\n### Framework shutdown\nThe scheduler can survive `SIGKILL` or being lost (system crashes etc.). If you want to completely de-register the framework and shutdown all tasks, just stop the scheduler with a plain `SIGTERM`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontainersolutions%2Fmesos-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcontainersolutions%2Fmesos-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontainersolutions%2Fmesos-starter/lists"}