{"id":17790012,"url":"https://github.com/samrocksc/quartermaster","last_synced_at":"2025-04-02T01:17:06.470Z","repository":{"id":69548346,"uuid":"107150882","full_name":"samrocksc/quartermaster","owner":"samrocksc","description":"Docker cluster and swarm manager for FASS (functions as a service) AWS/Remote clusters with token authentication","archived":false,"fork":false,"pushed_at":"2017-10-11T16:33:33.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-26T16:56:21.706Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samrocksc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-16T16:02:37.000Z","updated_at":"2017-10-16T16:02:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"2f5cfdd1-728b-4a42-b6da-6659050076b4","html_url":"https://github.com/samrocksc/quartermaster","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samrocksc%2Fquartermaster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samrocksc%2Fquartermaster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samrocksc%2Fquartermaster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samrocksc%2Fquartermaster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samrocksc","download_url":"https://codeload.github.com/samrocksc/quartermaster/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246735323,"owners_count":20825223,"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-10-27T10:39:41.736Z","updated_at":"2025-04-02T01:17:06.454Z","avatar_url":"https://github.com/samrocksc.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# quartermaster\n\n\u003e Docker cluster and swarm manager for FASS (functions as a service) AWS/Remote clusters with token authentication\n\n## Install\n\nUses [dep](https://github.com/golang/dep) to manage dependencies.\n\n`$ dep ensure`\n\n\n## Build\n\n`$ ./build.sh`\n\n## Run\n\nThe `token` option is a user defined random character sequence, for instance `$ uuidgen` on certain UNIX systems. Treat this as the universal key for controlling the swarm.\n\nUsing the `TOKEN` env:\n\n`$ TOKEN=4jrs8-534js-345ds-3lrd0 ./quartermaster`\n\nUsing the `--token` flag:\n\n`$ ./quartermaster --token=4jrs8-534js-345ds-3lrd0`\n\n\n**Note:** all jobs are run on docker swarm nodes with `role=worker`\n\n\n## Usage\n\n#### /run\n\nRun a service on any node in a swarm:\n\n```curl\n$ curl -X POST \\\n  http://localhost:9090/run \\\n  -H 'cache-control: no-cache' \\\n  -H 'content-type: application/json' \\\n  -d '{\n  \"token\": \"4jrs8-534js-345ds-3lrd0\",\n  \"command\": \"node index.js\",\n  \"image\": \"user/image\",\n  \"name\": \"my_service\",\n  \"labels\": { \"name\": \"value\" },\n  \"type\": \"service\",\n  \"memory\": 1024\n}'\n\n$\n{\n  \"success\": true,\n  \"id\": \"a52f382c82a7d101b8ee3bbaa9ff59243b43c95915f1da579f35df0c4af0c822\"\n}\n```\nOmitting the param `\"type\": \"service\"` will run the command as a container\n\nOptions:\n- token: Predefined token\n- command: command to run in container or service (see docker service create)\n- image: docker image to use\n- name: name of service or container\n- type: type of operation, service or container (Note: must be service on a docker swarm)\n- memory: memory limit for service or container\n- labels: set of labels for the service\n\n#### /stop\n\nStop and remove a service on the swarm:\n```curl\n$ curl -X POST \\\n  http://localhost:9090/stop \\\n  -H 'cache-control: no-cache' \\\n  -H 'content-type: application/json' \\\n  -d '{\n  \"token\": \"4jrs8-534js-345ds-3lrd0\",\n  \"id\": \"a52f382c82a7d101b8ee3bbaa9ff59243b43c95915f1da579f35df0c4af0c822\"\n}'\n\n$\n{\n  \"success\": true,\n  \"id\": \"a52f382c82a7d101b8ee3bbaa9ff59243b43c95915f1da579f35df0c4af0c822\"\n}\n```\n\n### Authentication from private registries\nPass the `auth` key in the `run` request for it to pull from the private registry per swarm node.\n\nThe exact shape of the auth should conform to the docker auth spec:\n```\n{\n  \"username\":\"your_registry_username_or_email\",\n  \"password\":\"*****\",\n  \"auth\":\"\",    // leave empty\n  \"email\":\"your@email.tld\"\n}\n```\nbase64 encode the entire object as a string.\n\n```curl\ncurl -X POST \\\n  http://localhost:9090/run \\\n  -H 'cache-control: no-cache' \\\n  -H 'content-type: application/json' \\\n  -d '{\n  \"token\": \"4jrs8-534js-345ds-3lrd0\",\n  \"command\": \"sleep 50\",\n  \"image\": \"user/private-image\",\n  \"auth\":\"eyJ1c2VybmFtZSI6InVzZXIiLCAicGFzc3dvcmQiOiJwYXNzd29yZCIsICJhdXRoIjoiIiwgImVtYWlsIjoibmFtZUBleGFtcGxlLmNvbSJ9\",\n  \"type\": \"service\"\n}'\n```\n\n## Docker\n\nBecause the quartermaster application connects to docker, the parent (swarm) docker instance sock is passed in as a volume:\n\n#### Docker run\n`$ docker run -d -e TOKEN=4jrs8-534js-345ds-3lrd0 -p 9090:9090 -v /var/run/docker.sock:/var/run/docker.sock stevelacy/quartermaster`\n\n#### Docker swarm\n**ensure the service is running only on a manager node**\n\n```bash\ndocker service create --name quartermaster \\\n  -e TOKEN=4jrs8-534js-345ds-3lrd0 \\\n  -p 9090:9090 \\\n  --constraint 'node.role == manager' \\\n  --mount type=bind,source=/var/run/docker.sock,destination=/var/run/docker.sock \\\n  stevelacy/quartermaster\n```\n\n### Building the docker image\n\n`$ ./build.sh`\n\n\n## LICENSE [MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamrocksc%2Fquartermaster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamrocksc%2Fquartermaster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamrocksc%2Fquartermaster/lists"}