vitess icon indicating copy to clipboard operation
vitess copied to clipboard

init.d style local examples

Open morgo opened this issue 5 months ago • 5 comments

Description

This switches the local example to use init.d style scripts, which is a more unix-y way of operating.

Both styles of examples work for now, but the intention is to delete examples/local* and move these new examples in place at some point.

I have removed all the fancy aliasing to ensure configuration files are ready. My original plan was to modify the vitess binaries to read from the configuration file directly, but because this made the change quite large I decided instead to modify the examples first in isolation. Thus, there is some verbosity from vtctldclient specifying the --server, which might not be needed in the future.

Related Issue(s)

Fixes https://github.com/vitessio/vitess/issues/18341

Checklist

  • [ ] "Backport to:" labels have been added if this change should be back-ported to release branches
  • [ ] If this change is to be back-ported to previous releases, a justification is included in the PR description
  • [x] Tests were added or are not required
  • [x] Did the new or modified tests pass consistently locally and on CI?
  • [ ] Documentation was added or is not required

Deployment Notes

New local examples have been added, which use an init.d-style startup pattern for various vitess programs.

morgo avatar Jun 13 '25 00:06 morgo

Review Checklist

Hello reviewers! :wave: Please follow this checklist when reviewing this Pull Request.

General

  • [ ] Ensure that the Pull Request has a descriptive title.
  • [ ] Ensure there is a link to an issue (except for internal cleanup and flaky test fixes), new features should have an RFC that documents use cases and test cases.

Tests

  • [ ] Bug fixes should have at least one unit or end-to-end test, enhancement and new features should have a sufficient number of tests.

Documentation

  • [ ] Apply the release notes (needs details) label if users need to know about this change.
  • [ ] New features should be documented.
  • [ ] There should be some code comments as to why things are implemented the way they are.
  • [ ] There should be a comment at the top of each new or modified test to explain what the test does.

New flags

  • [ ] Is this flag really necessary?
  • [ ] Flag names must be clear and intuitive, use dashes (-), and have a clear help text.

If a workflow is added or modified:

  • [ ] Each item in Jobs should be named in order to mark it as required.
  • [ ] If the workflow needs to be marked as required, the maintainer team must be notified.

Backward compatibility

  • [ ] Protobuf changes should be wire-compatible.
  • [ ] Changes to _vt tables and RPCs need to be backward compatible.
  • [ ] RPC changes should be compatible with vitess-operator
  • [ ] If a flag is removed, then it should also be removed from vitess-operator and arewefastyet, if used there.
  • [ ] vtctl command output order should be stable and awk-able.

vitess-bot[bot] avatar Jun 13 '25 00:06 vitess-bot[bot]

Changing local examples affects all contributors. I'd want to hear from a majority of the maintainer team before we decide whether to accept or reject this change.

deepthi avatar Jun 13 '25 15:06 deepthi

I don't have anything against this, but can you list out what you see as the practical advantages this offers @morgo? Moving the binary flags to config files is nice IMO.

Thanks!

mattlord avatar Jun 13 '25 18:06 mattlord

I don't have anything against this, but can you list out what you see as the practical advantages this offers @morgo? Moving the binary flags to config files is nice IMO.

Thanks!

Which is something that can be done without changing everything else.

deepthi avatar Jun 16 '25 00:06 deepthi

I don't have anything against this, but can you list out what you see as the practical advantages this offers @morgo? Moving the binary flags to config files is nice IMO.

The advantage of config:

  • It separates code from configuration
  • The configuration is declarative

The advantage of init scripts specifically:

  • Original suggestion/justification by @sjmudd here: https://github.com/vitessio/vitess/issues/3259 (which I agree with)
  • These follow a more standard OS pattern (although modern linuxes etc use systemd, not init.d).
  • If these scripts plug into the OS, then they can easily be started, supervised, managed by the OS. You can use standard service status tools to check what's running.
  • (not implemented yet, but hopefully implied) You can call init.d start on all the scripts at once, and they wait for their dependencies to start first.

morgo avatar Jun 16 '25 13:06 morgo

This PR is being marked as stale because it has been open for 30 days with no activity. To rectify, you may do any of the following:

  • Push additional commits to the associated branch.
  • Remove the stale label.
  • Add a comment indicating why it is not stale.

If no action is taken within 7 days, this PR will be closed.

github-actions[bot] avatar Jul 21 '25 01:07 github-actions[bot]

This PR is being marked as stale because it has been open for 30 days with no activity. To rectify, you may do any of the following:

  • Push additional commits to the associated branch.
  • Remove the stale label.
  • Add a comment indicating why it is not stale.

If no action is taken within 7 days, this PR will be closed.

github-actions[bot] avatar Aug 30 '25 01:08 github-actions[bot]

This PR was closed because it has been stale for 7 days with no activity.

github-actions[bot] avatar Sep 07 '25 01:09 github-actions[bot]