{"id":19341253,"url":"https://github.com/jsdir/consoled","last_synced_at":"2025-02-24T08:40:45.365Z","repository":{"id":15128207,"uuid":"17855299","full_name":"jsdir/consoled","owner":"jsdir","description":"A config-based abstraction over coreos/fleet","archived":false,"fork":false,"pushed_at":"2015-02-01T12:26:26.000Z","size":132,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-06T11:43:58.364Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"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/jsdir.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}},"created_at":"2014-03-18T05:51:30.000Z","updated_at":"2015-02-01T12:26:26.000Z","dependencies_parsed_at":"2022-09-10T19:22:57.164Z","dependency_job_id":null,"html_url":"https://github.com/jsdir/consoled","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsdir%2Fconsoled","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsdir%2Fconsoled/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsdir%2Fconsoled/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsdir%2Fconsoled/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsdir","download_url":"https://codeload.github.com/jsdir/consoled/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240448969,"owners_count":19803118,"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-10T03:29:51.525Z","updated_at":"2025-02-24T08:40:45.201Z","avatar_url":"https://github.com/jsdir.png","language":"Python","readme":"consoled\n========\n\nA config-based abstraction over coreos/fleet\n\nWhat is consoled?\n-----------------\n\nConsoled is a command line tool that provides a way to generate systemd service units from a config file. These services then can be submitted and started on a CoreOS cluster. Technically, this will work on any cluster running fleet and docker. But seriously, use CoreOS. ;)\n\nDependencies\n------------\n\nAs of now, consoled is just a make tool. No real dependency is required except for python.\n\nConfig\n------\n\nThe config is a YAML or JSON file that defines different things about the environment. Here's an example in YAML:\n\n```yml\ncontainers:\n\n  hipache: quarry/hipache\n\n  web:\n    image: registry.myapp.com:5000/myapp/web\n    requires:\n      - redis\n    endpoints:\n      - redis-instance\n\n  redis:\n    image: dockerfiles/redis\n    volumes:\n      /redis-data: /media/state/redis-data\n\n\nservices:\n\n  load-balancing:\n    hipache:\n      endpoints:\n        - web-service\n\n  web-service:\n    - web\n\n\ninstances:\n  redis-instance: redis\n\n\nscale:\n  load-balancing: 2\n  web-service: 20\n\n\nhosts:\n  \"flavor:performance-2\":\n    - redis-instance\n  \"flavor:standard-1gb\":\n    - web-service\n    - load-balancing\n```\n\n#### Containers\n\n```yml\ncontainers:\n\n  hipache: quarry/hipache\n\n  web:\n    image: registry.myapp.com:5000/myapp/web\n    requires:\n      - redis\n    endpoints:\n      - redis-instance\n\n  redis:\n    image: dockerfiles/redis\n    volumes:\n      /redis-data: /media/state/redis-data\n```\n\nA Container names a docker image and provides context when running that image. The following options can be used to configure how a container runs.\n\n- `image`: Defines an image that can be hosted on docker's public index or on your own registry. The image must be able to be pulled from anywhere in the cluster.\n- `requires`: A list of other containers to link using docker's `-link`. Since required containers will be started before the parent container, a container cannot directly or indirectly require itself. You can require containers that require other containers, and consoled will resolve and manage the dependencies at runtime for you. When containers are linked, the container name is used as the link alias. If identical containers are linked, the link alias will increment.\n\nIf the following requires are used:\n\n```yml\ncontainers:\n  web:\n    image: myapp/web\n    requires:\n      - fast-hipache\n      - redis\n      - redis\n      - redis\n```\n\nthe prefixes of the environment variables injected into the `web` container will be `FAST_HIPACHE`, `REDIS_1`, `REDIS_2`, and `REDIS_3`. The [docker docs](http://docs.docker.io/en/latest/use/working_with_links_names/) have more information about how the environment variables are named and injected.\n\n- `single`: Defaults to `false`. Set to `true` if there should be a maximum of one running instance of this container per host. This option is useful for providing a host-level etcd ambassador.\n- `privileged`: Defaults to `false`. Set to `true` to run the container in privileged mode by using docker's `-privileged` flag.\n- `env`: A hash of environment variables to include when running the container.\n\n```yml\nenv:\n  API_KEY: abc123\n  API_SECRET_KEY: secret123\n```\n\n- `volumes`: A hash of volumes to include when running the container. These volumes will be mounted from the host in the cluster.\n\n```yml\nvolumes:\n  /destination/in/container: /source/from/host\n  /ssl/server.crt: /media/state/ssl/server.crt\n```\n\n- `cmd`: A command to run in the container.\n\n- `ports`: TODO Enables semantic port names through etcd.\n\n- `endpoints`: A list of Services or Instances that the container will have access to through etcd. If the endpoints are 'foo-service' and 'bar-instance', the container will be mounted with a global ambassador that listens to the endpoints on different ports and proxies each one on different ports, injecting the environment variable of each.\nSERVICE_PROXY=127.0.0.1: don't use for now, just go off of raw etcd.\n\n\nIf a container has no options apart from `image`, it can be simply defined with `\u003cname\u003e: \u003cimage\u003e`:\n\n```yml\ncontainers:\n  mongo: bowery/mongo\n  redis: crosbymichael/redis\n```\n\nAny container option can be overridden wherever the container is referenced. This enables flexible, declarative configuration to be used. For example, with the following config:\n\n```yml\ncontainers:\n  app:\n    requires:\n      nginx:\n        env:\n          SERVER_CRT: /ssl/server.crt\n          SERVER_KEY: /ssl/server.key\n          CA_CRT: /ssl/ca.crt\n        volumes:\n          /media/state/keys/server.crt: /ssl/server.crt\n          /media/state/keys/server.key: /ssl/server.key\n          /media/state/keys/ca.crt: /ssl/ca.crt\n```\n\n#### Services\nA Service is a scalable group of Service Units.\n\n#### Scale\nServices are the a.\n\n#### Instances\nServices are the a.\n\n#### Machines\n\n\n```yml\n\n```\n\nThe config is separated into different blocks.\n\nThe image that a container uses does not have to be present on the machine compiling the service files. The image just has to be able to be pulled from anywhere in the cluster.\n\nUsage\n-----\n\nRight now, consoled has only one option: `make`. You can use the `make` option to generate service files.\n\n`consoled.py make -f \u003cconfig_file\u003e \u003coutput_dir\u003e`\n\nThis will parse `config_file` and output the generated service files to `output_dir`. Existing service files will be overwritten on conflict.\n\n```bash\n$ ./consoled.py make -f config.yml services\n23 service files written to ./services\n```\n\nBy default, consoled reads config from stdin so you can do nice things like piping files.\n\n```bash\n$ ./consoled.py make services/production \u003c production.yml\n14 service files written to ./services/production\n```\n\nSince consoled also accepts JSON-formatted input through a file or stdin, it can be easily integrated with other tools.\n\nTips for good configuration\n---------------------------\n\n- Add **polvi/docker-reg** to all-hosts.\n\n```yml\ncontainers:\n  docker-reg:\n    image: polvi/docker-reg\n  single: true\n\nall-containers:\n  requires:\n    - docker-reg\n```\n\nPolvi's **docker-reg** will now heartbeat all container endpoints for all hosts that have containers running. If we want docker to be checked on every host regardless of whether it's running containers or not, just use:\n\n```yml\nall-hosts:\n  - docker-reg\n```yml\n\n\n\nProvisioning\n-------------\nSince fleet doesn't have an option to run a certain services on all hosts in the cluster, we can have the service run automatically when provisioned.\n\nFirewall Ideas\n--------------\nWhen hosts are provisioned with coreos-cloudinit, the firewall can configure iptables to block everything except the localhost interface and etcd. Consoled can have an option to wait units a container starts, inspect the container, then open the ports in the firewall. When the container closes, it will close the ports.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsdir%2Fconsoled","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsdir%2Fconsoled","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsdir%2Fconsoled/lists"}