iterative / mlem

🐶 A tool to package, serve, and deploy any ML model on any platform. Archived to be resurrected one day🤞
https://mlem.ai
Apache License 2.0
717 stars 44 forks source link

Confusing error in `deploy run flyio` when app exists #667

Closed aguschin closed 1 year ago

aguschin commented 1 year ago

If you created an app (e.g. app-name is test-app-mlem and deployment file is app-first.mlem), but want to use the same fly app (app name) in a different deployment (e.g. app.mlem), you're getting this error.

$ mlem deploy run flyio app.mlem -m model --app_name test-app-mlem --env.org personal --org personaldsa
💾 Saving deployment to app.mlem
⏳️ Loading model from model.mlem
Error: prompt: non interactive

❌ Command '['flyctl', 'launch', '--auto-confirm', '--region', 'lax', '--no-deploy', '--name', 'test-app-mlem', '--org', 'personaldsa']' returned
non-zero exit status 1.

It happens because flyctl asks you to confirm re-deployment. But the error doesn't explain itself anyhow - you'll be left wondering what happened.

aminalaee commented 1 year ago

@aguschin I can pick this up. flyctl has a flag --reuse-app which can be used to Continue even if app name clashes with an existent app. I think this has a side-effect but with the non interactive mode the other option is just to show better errors from the flyctl output.

Let me know. what you think.

aguschin commented 1 year ago

@aminalaee, I think using it is fine TBH. Let's apply --reuse-app then.

For the reference, we had an extensive discussion about that in https://github.com/iterative/mlem/issues/463, but I don't think we have the capacity to implement it soon, so your suggestion LGTM.