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

deploy() has async behaviour #6

Open
gapan opened this issue May 11, 2021 · 1 comment
Open

deploy() has async behaviour #6

gapan opened this issue May 11, 2021 · 1 comment

Comments

@gapan
Copy link

gapan commented May 11, 2021

When running deploy() I get a message that everything has been deployed, but that may not be true, at least not yet.

This is an issue that is not the same as described in #3. It may occur, even if (eventually) all containers can be started.

The problem is that especially with a large number of containers to be started, the process of actually starting them is not instant. In fact, it might take several minutes until all containers are up and running.

In many cases, I can run deploy(), which returns with a "deployed" message, but if I then run fogify.info(), I may even get a blank response, or more usually not see all containers up yet. Simply by waiting a few minutes and running fogify.info() again, I eventually get the correct deployment info with all containers up.

This problem is not apparent on the python REPL/running in jupyter step by step or with a small number of containers, but it becomes apparent when trying to automate things with a larger number of containers.

I had to add a lot of time.sleep() statements in my code to actually have everything up as it should (like wait 20 seconds for each additional container), but I think the best way to handle this is for deploy() to return with a successful message only after all specified containers are actually up. I guess a timeout parameter can be added after which we can assume that deployment has failed and deploy() returns a failing message, while at the same time undeploying all containers that happened to already be up.

@MosesSymeonidis
Copy link
Collaborator

It may not seem to be the same issue, but it occurs for the same reason. The problem is that Fogify evaluates if the number of services that are deployed (and not the actual containers) is equal to the number of the emulated instances. Specifically, the docker swarm has deployed the services, but (due to the number of the containers) the containers are not started yet. That is the reason why the deploy function has this odd response. As I said in the previous issue, I will upload a new version of Fogify, which hopefully will solve those issues.

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

No branches or pull requests

2 participants