kopf icon indicating copy to clipboard operation
kopf copied to clipboard

Auto-reload script when using --dev flag

Open kopf-archiver[bot] opened this issue 4 years ago • 1 comments

An issue by chungktran at 2019-11-15 19:00:50+00:00 Original URL: https://github.com/zalando-incubator/kopf/issues/237  

Expected Behavior

kopf to reload running script when script modified when using --dev flag with run command.

Actual Behavior

Changes to the script doesn't reload the code. Terminating kopf took 45+ seconds to exit. Slows down development tremendously.

Steps to Reproduce the Problem

  1. Run kopf run --dev script.py
  2. Please Ctrl+C Ctrl+C
  3. Waited 45+ seconds and start kopf run --dev script.py again

Specifications

  • Platform: x64
  • Kubernetes version: v1.15.4
  • Python version: 3.7.4
  • Python packages installed:
Package           Version
----------------- ---------
aiohttp           3.6.2
aiojobs           0.2.2
async-timeout     3.0.1
attrs             19.3.0
cachetools        3.1.1
certifi           2019.9.11
chardet           3.0.4
Click             7.0
google-auth       1.7.1
idna              2.8
iso8601           0.1.12
kopf              0.22
kubernetes        10.0.1
multidict         4.5.2
oauthlib          3.1.0
pip               19.3.1
pyasn1            0.4.7
pyasn1-modules    0.2.7
pykube-ng         19.10.0
python-dateutil   2.8.1
PyYAML            5.1.2
requests          2.22.0
requests-oauthlib 1.3.0
rsa               4.0
setuptools        41.6.0
six               1.13.0
urllib3           1.25.7
websocket-client  0.56.0
wheel             0.33.6
yarl              1.3.0

Commented by nolar at 2019-11-17 11:13:36+00:00  

The slow termination is addressed in #239, #142 & co.

But auto-reloading would be a nice feature for the development mode, perhaps. Same as Django and similar web frameworks do it.

kopf-archiver[bot] avatar Aug 18 '20 20:08 kopf-archiver[bot]

Hi, any updates on this feature? I would love to have an auto-reload when developing an operator.

mledoze avatar Jun 01 '22 09:06 mledoze