Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(restart_process): work around sticky /tmp #548

Merged
merged 1 commit into from
Jan 5, 2024

Conversation

thejan2009
Copy link
Contributor

Another attempt to fix this. Changes from previous iteration:

  • use string.rfind('/') to extract folder instead of os.path.dirname
  • join RUN commands

Disclaimer, I've not been able to test this on Windows.

If mkdir should not be used, this is a WORKDIR solution:

     FROM tiltdev/restart-helper:2021-11-03 as restart-helper
 
-    FROM {ref}
+    FROM {ref} as workdir
+    WORKDIR "{folder}"
     RUN ["touch", "{file}"]
     RUN ["chmod", "666", "{file}"]
+
+    FROM {ref}
+    COPY --from=workdir "{file}" "{file}"
     COPY --from=restart-helper /tilt-restart-wrapper /
     COPY --from=restart-helper /entr /

Sometimes the container root filesystem has sticky bit enabled and restart commands are ran with a different user. We can work around that by creating an intermediate folder that has "0777" permissions.

The folder name is parsed with string.rfind because os.path.dirname won't work on Windows.

Refs #540

Sometimes the container root filesystem has sticky bit enabled and
restart commands are ran with a different user. We can work around that
by creating an intermediate folder that has "0777" permissions.

The folder name is parsed with `string.rfind` because os.path.dirname
won't work on Windows.

Refs tilt-dev#540

Signed-off-by: db <[email protected]>
Copy link
Member

@nicks nicks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@nicks nicks merged commit de93d9c into tilt-dev:master Jan 5, 2024
1 check passed
@nicks
Copy link
Member

nicks commented Jan 5, 2024

unfortunately, we got a report that this broke things again, due to lack of sh in the base container. reverting...

@nicks
Copy link
Member

nicks commented Jan 5, 2024

nicks added a commit that referenced this pull request Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants