{"action":"created","issue":{"url":"https://api.github.com/repos/dawanda/mmsd/issues/20","repository_url":"https://api.github.com/repos/dawanda/mmsd","labels_url":"https://api.github.com/repos/dawanda/mmsd/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/dawanda/mmsd/issues/20/comments","events_url":"https://api.github.com/repos/dawanda/mmsd/issues/20/events","html_url":"https://github.com/dawanda/mmsd/issues/20","id":176432089,"number":20,"title":"Support for atomic multi-stage app deployments","user":{"login":"christianparpart","id":56763,"avatar_url":"https://avatars.githubusercontent.com/u/56763?v=3","gravatar_id":"","url":"https://api.github.com/users/christianparpart","html_url":"https://github.com/christianparpart","followers_url":"https://api.github.com/users/christianparpart/followers","following_url":"https://api.github.com/users/christianparpart/following{/other_user}","gists_url":"https://api.github.com/users/christianparpart/gists{/gist_id}","starred_url":"https://api.github.com/users/christianparpart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christianparpart/subscriptions","organizations_url":"https://api.github.com/users/christianparpart/orgs","repos_url":"https://api.github.com/users/christianparpart/repos","events_url":"https://api.github.com/users/christianparpart/events{/privacy}","received_events_url":"https://api.github.com/users/christianparpart/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dawanda/mmsd/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-12T17:16:51Z","updated_at":"2016-09-14T09:36:05Z","closed_at":null,"body":"**WIP**\r\n\r\n## GOALS:\r\nAdd support for atomic deploys while retaining support for rolling deploys.\r\n\r\n## DEFINITION: \"Rolling Deploy\"\r\nUpon redeploying a application cluster, the new application instances (tasks) are spawned within the existing cluster. Once a new task becomes healthy an old task is being terminated, leaving the cluster with two versions during the deployment phase. Only when all tasks have been fully replaced with the new deployed version, the app cluster is not mixing up responses anymore.\r\n\r\n## DEFINITION: \"Atomic Deploy\"\r\nAn atomic deploy for a load balanced cluster is where the newly deployed tasks are activated in the load balancer (/service discovery) once all tasks became haealthy. The LB will then replace all old task's endpoints with the new endpoints while current sessions are still allowed to complete. Only after that the old deployment is subject to be terminated.\r\n\r\n## Motivation\r\nIn current deployments, we see somm 5xx HTTP response status codes due to the fact that we're having rolling deployments, and we hope to reduce them with the atomic switch from an old to the new app cluster version.\r\n\r\n## Implementation\r\nBy default, we consider each application to be a **blue** app. We can additionally link a **green** app to the blue app with an application label.\r\n\r\n* blue: `/production/frontend-webapp` with label `mmsd_atomic_deploy_suffix` set to `-green`.\r\n* green: `/production/frontend-webapp-green`\r\n\r\n### Properties of Linked Applications\r\n* They must be the same application that only differ in functionality (such as feature or bug fixes)\r\n* The service discovery ports from the blue application will be used by mmsd to expose the active deployment, whether it is the blue or the green app.\r\n* The application that gets deployed the last is the active application.\r\n* mmsd will not update the apps load balancer configuration during the deployment of a linked application,\r\n\r\n### Notes\r\nNow, when an application gets redeployed, mmsd is getting notified via the event bus by the time the deployment starts.\r\n* `mmsd` will update its local state and fetch all applications metadata, including the new `mmsd_atomic_deploy_suffix` and build an internal map of blue/green apps.\r\n* When the deployment of a linked application has completed with `deployment_success`, `mmsd` will reconfigure the load balancer to point to the latest deployment (blue or green).\r\n\r\n### Editorial Notes\r\n* the name of the label for linking two apps into one is not fixed. we can choose some better name, if any (OTOH: doesn't matter that much)\r\n* this ticket is work-in-progress and subject to drastic changes.\r\n"},"comment":{"url":"https://api.github.com/repos/dawanda/mmsd/issues/comments/246958591","html_url":"https://github.com/dawanda/mmsd/issues/20#issuecomment-246958591","issue_url":"https://api.github.com/repos/dawanda/mmsd/issues/20","id":246958591,"user":{"login":"markauskas","id":47689,"avatar_url":"https://avatars.githubusercontent.com/u/47689?v=3","gravatar_id":"","url":"https://api.github.com/users/markauskas","html_url":"https://github.com/markauskas","followers_url":"https://api.github.com/users/markauskas/followers","following_url":"https://api.github.com/users/markauskas/following{/other_user}","gists_url":"https://api.github.com/users/markauskas/gists{/gist_id}","starred_url":"https://api.github.com/users/markauskas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markauskas/subscriptions","organizations_url":"https://api.github.com/users/markauskas/orgs","repos_url":"https://api.github.com/users/markauskas/repos","events_url":"https://api.github.com/users/markauskas/events{/privacy}","received_events_url":"https://api.github.com/users/markauskas/received_events","type":"User","site_admin":false},"created_at":"2016-09-14T09:36:05Z","updated_at":"2016-09-14T09:36:05Z","body":"Question 1: are the service ports for blue and green identical? If not, what port will a client application use to connect to an app? e.g. if blue port is 10101 and green port is 10102, how can a service, which depends on the blue/green service, connect to it?\r\n\r\nQuestion 2: How do we rollback? If I deploy green and blue is still alive and I notice that green is buggy, how do I rollback?"}}
{"actor":{"display_login":"markauskas"}}