{ "info": { "author": "Johan Rydberg", "author_email": "johan.rydberg@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# The Gilliam Command-Line Interface\n\nGilliam is a software platform for building and running distributed\nsystems.\n\nThis is the command-line tool that is used to control services running\non the Gilliam platform.\n\n\n## Installation\n\nInstall using pip (preferably in a virtualenv) straight from the\nrepository:\n\n $ pip install git+https://github.com/gilliam/gilliam-cli.git\n\nThat's it. The command is called `gilliam`.\n\n# Quick Intro\n\nFirst a few words about Gilliam application model: A *service* is a\npiece of code that runs on the platform. It can be some business\nlogic, a cache or a database. Services are grouped together into a\n*formation*. Code and configuration in the form of environment\nvariables are merged together into a *release*. *Instances* of a\nservice can be created from a release. Everything live in a *stage*,\nwhich is another word for a gilliam installation.\n\nIn this quick into we'll use a small python example to showcase some\nof the commands of the client. First, we need to clone the example\ncode:\n\n $ git clone git+https://github.com/gilliam/python-example.git\n $ cd python-example\n\nLets take a look at the `gilliam.yml` file:\n\n processes:\n www:\n script: python web.py\n ports: [80]\n\nA `gilliam.yml` file specifies a set of services that the formation\nneed to expose functionality. In file above contains just a process\ncalled `www`. The `script` tells us that when the service is started\nthe command `python web.py` should be executed. `ports` specifies\nports on which the service can receive incoming requests.\n\nGilliam comes with a whole set of different service types. The type\nfor a service can always be specified with a `type` field. But you\ncan also let it to Gilliam to figure out the type; the type will then\nbe deduced from the service name and its definition.\n\nBack to the example.\n\nTo create a formation for the example issue the following command:\n \n $ gilliam --stage myapp-prod create python-example\n\nWe specify `--stage myapp-prod` to tell the client to create the\nformation in the `myapp-prod` stage (the production environment for my\napplication).\n\n*Note*: This quick into does not take into consideration how the stage\nis created.\n\nNext step is to build and deploy:\n\n $ gilliam deploy\n start building service 'www' ...\n | Python app detected\n | -----> No runtime.txt provided; assuming python-2.7.4.\n ...\n | Successfully installed Flask Werkzeug Jinja2 markupsafe\n | Cleaning up...\n | Cleaning up caches\n release 1\n\nWhen done, a new release has been created. You can see it if you do a\n`gilliam-cli releases`:\n\n $ gilliam releases \n name author message\n --------- --------------- ----------------------------------------\n 1 jrydberg None\n\nGilliam allows heterogeneous set ups where you have instances from\nmultiple releases running at the same time. This allows you to build\nsophisticated build pipelines with canary tests.\n\nBut right now, nothing is running, since we have not scaled the\nrelease. So lets do that:\n\n $ gilliam scale -r1 www=1\n $\n\nThis will create an instance of the `www` service and dispatch it to\none of the executors. Run `gilliam-cli ps` to inspect instances:\n\n $ gilliam-cli ps\n name release state\n ----------------------------------- ------- ---------\n www.BHCrBMebfG4oZUgix95chH 1 running\n\nTo be able to access the service from the outside, we need to set up\na route:\n\n $ gilliam-cli route /example/ www.example.service\n route 5h7Zf9P3oDGiUpF3opWDzP created\n\nSo what does that mean? It means that `/example/` on the router,\nregardless of domain, will route requests to the example service.\n\nRoutes can be listed by issuing `routes` command:\n\n $ gilliam-cli route\n name domain path target\n ---------------------- -------------------- -------------------- -------------------------\n 5h7Zf9P3oDGiUpF3opWDzP /example/ http://www.example.service\n\n\n# Basic Commands\n\n## Creating a Formation\n\nThe first command you will issue. It needs to be issued from your\n\"project dir\", which is the directory where your `gilliam.yml` file\nlive. Normally this is the root directory of your project.\n\n $ gilliam --stage prod create name-of-formation\n\nThe `--stage` option tells gilliam in what installation the formation\nshould be created. Here's it's the production environment.\n\n## Deploying\n\nTo build your project and release it just issue the `deploy` command:\n\n $ gilliam deploy\n ...\n\n\n## Scaling a Release\n\nScaling a release means to increase or decrease the number of\ninstances of that release. \n\n(FIXME: default to last release, or to somehow?)\n\n\n## Routing\n\nGilliam has a front-end HTTP router that takes request and forwards\nthem to a service for process.\n\nThe command `route` takes two arguments, the *route* and the *target*.\n\n $ gilliam route /example/ www.example.service\n\nThe route can contain a domain name that needs to be matched:\n\n $ gilliam route api.myapp.com/example/ www.example.service\n\nThe route argument accepts variable matching using the `{var}` syntax,\nlike this:\n\n $ gilliam route /user/{user} www.user.service/{user}\n\nIf you want to specify a specific format for the variable, do so after\na colon, like this: `{name:REGEX}`. For example `{rest:.*?}` will\nmatch the rest of the line, which can be useful if you want to send\neverything to a specific service.\n\n $ gilliam route /user/{rest:.*?} www.user.service/{rest}\n\nNote that variable matching is also possible on the domain:\n\n $ gilliam route {acct}.api.myapp.com/user/{rest:.*?} api.user.service/{acct}/{rest}\n\nOr in the formation name:\n\n $ gilliam route {acct}.api.myapp.com:/user/{rest:.*?} api.user-{acct}.service/{rest}\n\nBy not specifying any arguments all existing routes will be listed:\n\n $ gilliam routes\n name domain path target\n ---------------------- -------------------- -------------------- -------------------------\n 5h7Zf9P3oDGiUpF3opWDzP /example/ http://www.example.service\n\nDeleting a formation is done using the `-d` option:\n\n $ gilliam route -d \n\n## Building a Release\n\n...\n\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/gilliam/", "keywords": "app platform", "license": "Apache 2.0", "maintainer": null, "maintainer_email": null, "name": "gilliam-cli", "package_url": "https://pypi.org/project/gilliam-cli/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/gilliam-cli/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/gilliam/" }, "release_url": "https://pypi.org/project/gilliam-cli/0.1/", "requires_dist": null, "requires_python": null, "summary": "Command-line client for Gilliam", "version": "0.1" }, "last_serial": 927450, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "9931f54394d81981ea1988e3f675268f", "sha256": "463a3de0ee624db0d01c0048bae5d5a409f02e8f9321453207de30a3ab829366" }, "downloads": -1, "filename": "gilliam-cli-0.1.tar.gz", "has_sig": false, "md5_digest": "9931f54394d81981ea1988e3f675268f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26057, "upload_time": "2013-11-23T21:27:39", "url": "https://files.pythonhosted.org/packages/a8/af/eccd34d23deac4d9a5869de76345d0075d6c214ac9a609e2cc080e221334/gilliam-cli-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9931f54394d81981ea1988e3f675268f", "sha256": "463a3de0ee624db0d01c0048bae5d5a409f02e8f9321453207de30a3ab829366" }, "downloads": -1, "filename": "gilliam-cli-0.1.tar.gz", "has_sig": false, "md5_digest": "9931f54394d81981ea1988e3f675268f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26057, "upload_time": "2013-11-23T21:27:39", "url": "https://files.pythonhosted.org/packages/a8/af/eccd34d23deac4d9a5869de76345d0075d6c214ac9a609e2cc080e221334/gilliam-cli-0.1.tar.gz" } ] }