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

Integration stuck waiting for platform #660

Closed
nicolaferraro opened this issue May 14, 2019 · 14 comments · Fixed by #684
Closed

Integration stuck waiting for platform #660

nicolaferraro opened this issue May 14, 2019 · 14 comments · Fixed by #684
Assignees

Comments

@nicolaferraro
Copy link
Member

Sometimes when I create an integration before the platform is ready, the integration goes in state "Waiting for Platform" but it never leaves that state.

We should make sure that changes to platform and contexts retrigger change in integration.

@jamesnetherton jamesnetherton self-assigned this May 20, 2019
@ShravanGeek
Copy link

Hi Nicola, I'm exactly facing the same issue. I'm trying a small demo, followed your official documentation as well as your demo video, but its getting hanged at "Waiting for Platform" every time. How to make sure the platform is ready and how to make the integration successful? Can you please help me out here? I'm running kamel on Openshift installed on AWS instance. Thanks a lot.

@nicolaferraro
Copy link
Member Author

Hi @ShravanGeek, @jamesnetherton is working on this, but looking at issue #677, it does not solve your problem, because your platform seems really stuck because it is not able to build context images.

You can get the status (phase) of the platform using: kamel describe platform camel-k

In order for the platform to be Ready, all initially created integrationcontexts must be Ready (get them using oc get ictx).

@nicolaferraro
Copy link
Member Author

Hi @nicolaferraro , seems my platform is not ready. This are the below result

Name: camel-k' Namespace: myproject Labels: app=camel-k Creation Timestamp: Wed, 22 May 2019 10:36:41 +0000 Phase: Error``
Base Image: fabric8/s2i-java:3.0-java8
`Camel Version: 3.0.0-M2`
`Local Repository: /tmp/artifacts/m2`
`Publish Strategy: S2I`

NAME PHASE TYPE IMAGE
groovy Error platform
jvm Error platform
kotlin Error platform

Can you please provide any suggestions on how to make them ready? Thanks a lot for your time.

Let's discuss this in #677

@apache apache deleted a comment from ShravanGeek May 22, 2019
@oscerd
Copy link
Contributor

oscerd commented May 22, 2019

@ShravanGeek stop spamming in differenti issues

@jamesnetherton
Copy link
Contributor

There's maybe a few ways of dealing with this. Just wondering what the best option is...

The lazy way could be to requeue the integration reconcile requests where the phase is 'waiting for platform'. Then when the phase is updated, just return from the reconcile function as per normal.

After a quick test it seems to work ok.

@nicolaferraro
Copy link
Member Author

Yeah, that should work.

Another possible optimization is to remove all the places where we do "edits" to objects in order to trigger a reconcile loop (e.g. when a context is ready there should be a piece of code that does a small edit on the label of a integration) and replace it with a cleaner approach like:

  • platform changes trigger reconcile loops in all integrations
  • context changes trigger reconcile loops in platform and all integrations
    (hope they are enough for our use cases)

This way we can also get rid later of continuous polling we currently do (inherited from old operator-sdk model).

There should be some utilities in controller runtime to deal with such kind of dependencies.

@lburgazzoli
Copy link
Contributor

@nicolaferraro
Copy link
Member Author

Yeah, that's the "utility" I was referring to

@astefanutti
Copy link
Member

astefanutti commented May 23, 2019

Another option is to explicitly search for the integrations and update their states, as we do when integrations are pending completion of their integration contexts:

https://github.com/apache/camel-k/blob/master/pkg/controller/integrationcontext/build.go#L223-L241

The pattern used for watching changes to secondary resource builds and requeue the owner integration contexts relies on the ownership relationship. It was the idea behind #595, that has yet to be revived if needed. That being said, it may be possible to adapt it with a handler that would enqueue integrations in the waiting state.

@lburgazzoli
Copy link
Contributor

@astefanutti can we leverage EnqueueRequestsFromMapFunc ?

@astefanutti
Copy link
Member

astefanutti commented May 24, 2019

@lburgazzoli yes exactly. As stated in the documentation, this seems a good fit for our use case:

EnqueueRequestsFromMapFunc is frequently used to fan-out updates from one object to one or more other objects of a differing type.

If it turns out to be the case, we may consider applying it to update integrations that are pending completion of their integration contexts when their builds complete.

@jamesnetherton
Copy link
Contributor

EnqueueRequestsFromMapFunc seems it can do the job. I tested with a watch on IntegrationPlatform, verified its state is 'ready', then grabbed all integrations with phase 'waiting for platform' and added them to the list of objects to requeue. The integrations all transitioned to phase 'Running'

Hopefully that's along the right lines of what's required?

@astefanutti
Copy link
Member

astefanutti commented May 24, 2019

@jamesnetherton looks exactly like what's needed!

@lburgazzoli
Copy link
Contributor

lburgazzoli commented May 24, 2019

maybe we can open an issue to evaluate if the same logic can replace https://github.com/apache/camel-k/blob/master/pkg/controller/integrationcontext/build.go#L223-L241

jamesnetherton added a commit to jamesnetherton/camel-k that referenced this issue May 24, 2019
lburgazzoli pushed a commit that referenced this issue May 24, 2019
ipolyzos pushed a commit to ipolyzos/camel-k that referenced this issue Jul 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants