Skip to content

Commit

Permalink
Revert "fix(restart_process): work around sticky /tmp (tilt-dev#548)" (
Browse files Browse the repository at this point in the history
…tilt-dev#549)

This reverts commit de93d9c.
  • Loading branch information
nicks authored Jan 5, 2024
1 parent de93d9c commit 289ade9
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions restart_process/Tiltfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
RESTART_FILE = '/tmp/.restart/proc'
RESTART_FILE = '/tmp/.restart-proc'
TYPE_RESTART_CONTAINER_STEP = 'live_update_restart_container_step'

KWARGS_BLACKLIST = [
Expand Down Expand Up @@ -39,26 +39,19 @@ def _helper(base_ref, ref, entrypoint, live_update, restart_file=RESTART_FILE, t
else:
fail("`entrypoint` must be a string or list of strings: got {}".format(type(entrypoint)))

# extract restart_file folder with rfind because `os.path.dirname` will not
# return linux-compatible result on Windows
folder='/'
ind=restart_file.rfind('/')
if ind != -1:
folder=restart_file[0:ind]

# declare a new docker build that adds a static binary of tilt-restart-wrapper
# (which makes use of `entr` to watch files and restart processes) to the user's image
# we also set the image's entrypoint to give k8s_custom_deploy a chance of working: https://github.com/tilt-dev/tilt-extensions/issues/391
df = '''
FROM tiltdev/restart-helper:2021-11-03 as restart-helper
FROM {ref}
RUN mkdir -p "{folder}" && touch "{file}" && chmod 666 "{file}"
RUN ["touch", "{file}"]
RUN ["chmod", "666", "{file}"]
COPY --from=restart-helper /tilt-restart-wrapper /
COPY --from=restart-helper /entr /
ENTRYPOINT {entry}
'''.format(ref=base_ref, file=restart_file, folder=folder,
entry=entrypoint_with_entr)
'''.format(ref=base_ref, file=restart_file, entry=entrypoint_with_entr)

# last live_update step should always be to modify $restart_file, which
# triggers the process wrapper to rerun $entrypoint
Expand Down

0 comments on commit 289ade9

Please sign in to comment.