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

Prevent bug when launching apps on multiple clusters #15226

Conversation

luca3rd
Copy link
Contributor

@luca3rd luca3rd commented Oct 20, 2022

What does this PR do?

Stops a bug when cross-launching an app between clusters.

Currently the platform does not allow running multiple app instances. If you have app-1 running on cluster-1 and try to run it on cluster-2, the CLI will succeed but the app will never start.

This PR prevents this disconnect. The app should not be uploaded / released if it won't run. An error is presented to the user explaining what happened and how to proceed (specify a different --name: e.g. app-2).

Once the platform supports multiple app instances / running individual apps on multiple clusters, this PR can be reverted.

Does your PR introduce any breaking changes? If yes, please list them.

No

Before submitting

  • Was this discussed/approved via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you list all the breaking changes introduced by this pull request?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or minor internal changes/refactors)

PR review

Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:

  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

Did you have fun?

Make sure you had fun coding 🙃

cc @Borda

@github-actions github-actions bot added the app Generic label for Lightning App package label Oct 20, 2022
@luca3rd luca3rd self-assigned this Oct 20, 2022
@luca3rd luca3rd force-pushed the ENG-497-bug]-can-t-run-app-on-a-cluster-if-it-already-run-in-another branch from c67aed8 to b0fb647 Compare October 20, 2022 19:21
@luca3rd luca3rd changed the title Error instead of breaking Prevent unsupported behaviour when launching apps on multiple clusters Oct 20, 2022
@luca3rd luca3rd changed the title Prevent unsupported behaviour when launching apps on multiple clusters Prevent bug when launching apps on multiple clusters Oct 20, 2022
@luca3rd luca3rd marked this pull request as ready for review October 20, 2022 20:15
Copy link
Member

@awaelchli awaelchli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great

src/lightning_app/runners/cloud.py Outdated Show resolved Hide resolved
@awaelchli awaelchli added this to the v1.8.x milestone Oct 21, 2022
@awaelchli
Copy link
Member

Let's also add a changelog entry in src/lightning_app/changelog.md?

@mergify mergify bot added the ready PRs ready to be merged label Oct 24, 2022
@luca3rd luca3rd enabled auto-merge (squash) October 24, 2022 16:54
@luca3rd luca3rd merged commit 488c2ac into master Oct 25, 2022
@luca3rd luca3rd deleted the ENG-497-bug]-can-t-run-app-on-a-cluster-if-it-already-run-in-another branch October 25, 2022 23:36
@carmocca carmocca removed this from the v1.8.x milestone Oct 26, 2022
@carmocca carmocca added this to the v1.8 milestone Oct 26, 2022
@@ -305,6 +292,15 @@ def dispatch(

if find_instances_resp.lightningapps:
existing_instance = find_instances_resp.lightningapps[0]

# TODO: support multiple instances / 1 instance per cluster
if existing_instance.spec.cluster_id != cluster_id:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@luca3rd I am confused about this. If the app already exists on a cluster, than it means the user is going to restart it when a new release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app:cli app Generic label for Lightning App package ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants