Skip to content

Replace tini in entrypoint.sh with catatonit#2968

Open
alimaredia wants to merge 1 commit into
kubeflow:masterfrom
alimaredia:replace-tini-with-catatonit
Open

Replace tini in entrypoint.sh with catatonit#2968
alimaredia wants to merge 1 commit into
kubeflow:masterfrom
alimaredia:replace-tini-with-catatonit

Conversation

@alimaredia
Copy link
Copy Markdown

Purpose of this PR

Swap tini for catatonit in entrypoint.sh. The following are some reasons why catatonit should be used instead of tini:

  • catatonit's use of signalfd is more performant than tini's use of sigwait due to its event driven approach to receiving signals.
  • catatonit also verifies the child is alive with after fork() whereas tini blindly trusts it worked.
  • catatonit also closes all filedescriptors in the parent process, though entrypoint.sh does not currently open any fd's, having thise close be automatic in the future would be valuable in case any are opened in the entrypoint script in the future for whatever reason.

Change Category

  • Bugfix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that could affect existing functionality)
  • Documentation update

Rationale

Checklist

  • I have conducted a self-review of my own code.
  • I have updated documentation accordingly.
  • I have added tests that prove my changes are effective or that my feature works.
  • Existing unit tests pass locally with my changes.

Additional Notes

Copilot AI review requested due to automatic review settings May 29, 2026 21:39
@google-oss-prow
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign mwielgus for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@github-actions
Copy link
Copy Markdown

🎉 Welcome to the Kubeflow Spark Operator! 🎉

Thanks for opening your first PR! We're happy to have you as part of our community 🚀

Here's what happens next:

Join the community:

Feel free to ask questions in the comments if you need any help or clarification!
Thanks again for contributing to Kubeflow! 🙏

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Replaces the tini init system with catatonit in both the Docker image and entrypoint script.

Changes:

  • Install catatonit instead of tini in the Dockerfile.
  • Update the entrypoint to invoke catatonit instead of /usr/bin/tini.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
Dockerfile Swap apt package tini for catatonit.
entrypoint.sh Replace /usr/bin/tini -s -- with catatonit -- as PID 1 wrapper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread entrypoint.sh Outdated
Comment thread Dockerfile
Copy link
Copy Markdown

@vjanelle vjanelle left a comment

Choose a reason for hiding this comment

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

Minor change

Comment thread entrypoint.sh Outdated
@google-oss-prow
Copy link
Copy Markdown
Contributor

@vjanelle: changing LGTM is restricted to collaborators

Details

In response to this:

Minor change

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Comment thread Dockerfile

RUN apt-get update \
&& apt-get install -y tini \
&& apt-get install -y catatonit \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can we consider adding --no-install-recommends to reduce image layer size: apt-get install -y --no-install-recommends catatonit ? To avoid pulling in unnecessary recommended packages. wdyt ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

tini and catatonit are both small C programs that have the same posix headers as dependencies so switching out for catatonit won't be a big change in terms of adding new dependencies. That being said, catatonit is much larger since it is statically linked.

There are no recommended packages that would be installed for catatonit (or tini for that matter), so --no-install-recommends wouldn't make the size smaller than it would be.

`catatonit`'s use of signalfd is more performant than `tini`'s use of sigwait
due to its event driven approach to receiving signals.

`catatonit` also verifies the child is alive with after fork() whereas tini
blindly trusts it worked.

`catatonit` also closes all filedescriptors in the parent process, though
entrypoint.sh does not currently open any fd's, having thise close be automatic
in the future would be valuable in case any are opened in the entrypoint script
in the future for whatever reason.

Signed-off-by: Ali Maredia <amaredia@redhat.com>
@alimaredia alimaredia force-pushed the replace-tini-with-catatonit branch from 22aa989 to c2dbb0e Compare June 1, 2026 15:54
Copy link
Copy Markdown
Contributor

@RobuRishabh RobuRishabh left a comment

Choose a reason for hiding this comment

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

/lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants