sigs.k8s.io/cluster-api/bootstrap/kubeadm@v0.0.0-20191016155141-23a891785b60/third_party/forked/rerun-process-wrapper/README.md (about)

     1  # Rerunning your process via `live_update`
     2  ## i.e., simulating [`restart_container()`](https://docs.tilt.dev/live_update_reference.html#restart_container) on non-Docker clusters
     3  
     4  As of 6/28/19: `restart_container()`, a command that can be passed to a `live_update`, doesn't work on non-Docker clusters. However there's a workaround available to simulate `restart_container()`'s functionality. It's used in [the onewatch integration test](https://github.com/windmilleng/tilt/tree/master/integration/onewatch) so that the test passes on non-Docker clusters. Here's how to do it yourself:
     5  
     6  Copy `start.sh` and `restart.sh` to your container working dir.
     7  
     8  If your container entrypoint *was* `path-to-binary [arg1] [arg2]...`, change it to:
     9  ```
    10  ./start.sh path-to-binary [arg1] [arg2]...
    11  ```
    12  
    13  To restart the container, instead of including Live Update step `restart_container()`, use:
    14  `run('./restart.sh')`
    15  
    16  So, for example:
    17  
    18  ```python
    19  docker_build('gcr.io/windmill-test-containers/integration/onewatch',
    20      '.',
    21      dockerfile='Dockerfile',
    22      live_update=[
    23          sync('.', '/go/src/github.com/windmilleng/tilt/integration/onewatch'),
    24          run('go install github.com/windmilleng/tilt/integration/onewatch'),
    25          run('./restart.sh'),
    26      ])
    27  ```
    28  
    29  This live update will cause the `go install` to be run in the container every time anything in the `.` path locally changes. After the `go install` is run, `./restart.sh` will be run. This will kill the original entrypoint, and restart it, effectively simulating the `container_restart()` functionality on Docker.