etl icon indicating copy to clipboard operation
etl copied to clipboard

Wizard restarts on every commit on a staging server

Open pabloarosado opened this issue 1 year ago • 4 comments
trafficstars

Streamlit currently restarts every time something is committed to a staging server. But, if you are working on the Wizard (e.g. upgrading indicators or reviewing charts), you may lose work. Would it be possible to avoid the restart?

pabloarosado avatar May 10 '24 13:05 pabloarosado

I looked into it and here are a couple of observations:

  1. Sometimes you don't necessarily lose your work. When I was testing this locally on chart-sync, I edited one field, stopped the app, then the field grayed out, then started the app and the field was active again. So restarting doesn't necessarily removes all values (I haven't tried other examples though)
  2. We could just stop restarting the app and hope that live reload will work. I don't know if this will work in all cases, but it could be worth a try?
  3. Ideally, all fields would be persistent in your browser or in the app, but that might be just too much work.

@lucasrodes you're the expert, any ideas? Has this ever happened to you?

Marigold avatar May 15 '24 09:05 Marigold

We can enable live reload on staging servers and do hard restart on master (where there's a likely code change).

Marigold avatar May 16 '24 09:05 Marigold

hi @Marigold, Yes, this has happened to me sometimes.

While editing a form on streamlit, fields are not saved in any python variable to the best of my knowledge. So if we wanted them to persist if the streamlit app is re-started, we'd need to re-think some bits of code.

We can enable live reload on staging servers and do hard restart on master (where there's a likely code change).

I am not sure I follow on this one. What's the difference between 'live reload' and 'hard restart'?

lucasrodes avatar May 17 '24 08:05 lucasrodes

I am not sure I follow on this one. What's the difference between 'live reload' and 'hard restart'?

As far as I know, streamlit uses "live reload" by default (if you make any code change, it'll reload the app). By "hard restart" I mean restarting the app (which is done via pm2 process manager).

Marigold avatar May 17 '24 09:05 Marigold

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 18 '24 01:07 stale[bot]