Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not handling properly deployment events for apps with custom parent groups in Marathon #35

Closed
dankraw opened this issue Jan 26, 2016 · 4 comments · Fixed by #40
Closed
Assignees
Labels

Comments

@dankraw
Copy link
Contributor

dankraw commented Jan 26, 2016

Currently RestartedConsulApps/StoppedConsulApps/RenamedConsulApps api of deployment events search for the apps in /Plan/Original/Apps of the event - this is will catch only apps that are created in root of the deployment plan.
When application has a different parent group, for example /com.example.tech/applicationName we should look in /Plan/Original/Groups[{group_index}]/Apps where {group_index} points a record having id: /com.example.tech.

@janisz
Copy link
Contributor

janisz commented Jan 28, 2016

I think I found a bug. It might not be related to this PR (need to check it). Consider following situation:

echo '{
  "id": "product",
  "groups": [{
    "id": "service",
    "groups": [{
      "id": "us-east",
      "apps": [{
        "id": "app1",
        "cmd": "python -m SimpleHTTPServer $PORT0",
        "labels": {"consul":"A"},
                  "healthChecks": [
            {
              "path": "/",
              "protocol": "HTTP",
              "portIndex": 0,
              "gracePeriodSeconds": 3,
              "intervalSeconds": 20,
              "timeoutSeconds": 20,
              "maxConsecutiveFailures": 3,
              "ignoreHttp1xx": false
            }
          ]
      }, 
      {
        "id": "app2",
        "cmd": "python -m SimpleHTTPServer $PORT0",
        "labels": {"consul": "A"},
                  "healthChecks": [
            {
              "path": "/",
              "protocol": "HTTP",
              "portIndex": 0,
              "gracePeriodSeconds": 3,
              "intervalSeconds": 20,
              "timeoutSeconds": 20,
              "maxConsecutiveFailures": 3,
              "ignoreHttp1xx": false
            }
          ]
      }]
    }],
    "dependencies": ["/product/database", "../backend"]
  }
]
}' | http PUT http://localhost:8080/v2/groups  content-type:application/json

It works perfectly. Both applications are registered in consul. Now, let's update consul service name for one of this apps.

echo '{
  "id": "product",
  "groups": [{
    "id": "service",
    "groups": [{
      "id": "us-east",
      "apps": [{
        "id": "app1",
        "cmd": "python -m SimpleHTTPServer $PORT0",
        "labels": {"consul":"B"},
                  "healthChecks": [
            {
              "path": "/",
              "protocol": "HTTP",
              "portIndex": 0,
              "gracePeriodSeconds": 3,
              "intervalSeconds": 20,
              "timeoutSeconds": 20,
              "maxConsecutiveFailures": 3,
              "ignoreHttp1xx": false
            }
          ]
      }, 
      {
        "id": "app2",
        "cmd": "python -m SimpleHTTPServer $PORT0",
        "labels": {"consul": "A"},
                  "healthChecks": [
            {
              "path": "/",
              "protocol": "HTTP",
              "portIndex": 0,
              "gracePeriodSeconds": 3,
              "intervalSeconds": 20,
              "timeoutSeconds": 20,
              "maxConsecutiveFailures": 3,
              "ignoreHttp1xx": false
            }
          ]
      }]
    }],
    "dependencies": ["/product/database", "../backend"]
  }
]
}' |  http PUT http://localhost:8080/v2/groups  content-type:application/json

We end up with only one service registered in Consul and it's service B.

@dankraw
Copy link
Contributor Author

dankraw commented Jan 28, 2016

I think this is the "many apps -> one service name" case that we currently don't support. We may open an issue for this.

@janisz
Copy link
Contributor

janisz commented Jan 28, 2016

Beside above issue and issue with stopping deployments, it looks good. I think we should write them down somewhere.

@janisz
Copy link
Contributor

janisz commented Apr 12, 2016

I tested case described above it's working for #73

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants