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

Add Live Reload #37

Merged
merged 11 commits into from
Oct 27, 2022
Merged

Add Live Reload #37

merged 11 commits into from
Oct 27, 2022

Conversation

joshuatcasey
Copy link
Contributor

Add live reload

Resolves #33

Checklist

  • I have viewed, signed, and submitted the Contributor License Agreement.
  • I have linked issue(s) that this PR should close using keywords or the Github UI (See docs)
  • I have added an integration test, if necessary.
  • I have reviewed the styleguide for guidance on my code quality.
  • I'm happy with the commit history on this PR (I have rebased/squashed as needed).

@joshuatcasey joshuatcasey requested a review from a team as a code owner July 18, 2022 16:02
@joshuatcasey joshuatcasey added semver:minor A change requiring a minor version bump status/blocked This issue has been triaged and resolving it is blocked on some other issue labels Jul 18, 2022
@joshuatcasey
Copy link
Contributor Author

joshuatcasey commented Jul 18, 2022

Blocked on a release of https://github.com/paketo-buildpacks/libreload-packit

This PR no longer needs libreload-packit.

@sophiewigmore
Copy link
Member

The changes here look reasonable to me, but I'd like to be able to test it out locally when a release is available of libreload-packit

@joshuatcasey
Copy link
Contributor Author

The changes here look reasonable to me, but I'd like to be able to test it out locally when a release is available of libreload-packit

Sounds good. It can be tested locally with the prerelease version of libreload-packit which is why this PR isn't in Draft but of course we need to wait.

Another thought I had - do we have confidence that we're not leaking processes by reloading procmgr-binary? I'll set some time aside (probably tomorrow) to manually inspect the process list.

@sophiewigmore
Copy link
Member

@joshuatcasey what do you mean by leaking processes?

@joshuatcasey
Copy link
Contributor Author

@joshuatcasey what do you mean by leaking processes?

procmgr-binary kicks off fpm and nginx|httpd. If watchexec restarts procmgr-binary, I'm curious if those fpm and nginx|httpd processes are cleaned up correctly and new processes created.

@joshuatcasey
Copy link
Contributor Author

@sophiewigmore while investigating the "leaking processes" above, I had a brainwave: do we really even need watchexec here? Won't httpd and nginx just pick up file changes?

And it looks like that answer is.... Yes. I'll remove watchexec and libreload-packit from this PR shortly.

@joshuatcasey joshuatcasey marked this pull request as draft July 22, 2022 19:26
@joshuatcasey joshuatcasey marked this pull request as ready for review July 22, 2022 19:52
@joshuatcasey
Copy link
Contributor Author

I've force-pushed this branch so that it only contains README and integration test changes.

The original "working" PR is over on branch jtc/add-watchexec but we don't need to save that once this PR is merged.

@joshuatcasey joshuatcasey removed the status/blocked This issue has been triaged and resolving it is blocked on some other issue label Jul 25, 2022
TisVictress
TisVictress previously approved these changes Jul 26, 2022
docker = occam.NewDocker()
})

context("when BP_LIVE_RELOAD_ENABLED is true", func() {
Copy link
Member

@sophiewigmore sophiewigmore Jul 26, 2022

Choose a reason for hiding this comment

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

@joshuatcasey I'm confused about this. BP_LIVE_RELOAD_ENABLED is not set to true in the test - does this line need to be modified? Or should BP_LIVE_RELOAD_ENABLED be set?

I am assuming just this line needs to change?

Copy link
Member

Choose a reason for hiding this comment

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

@joshuatcasey this still needs to change since the env var isn't set.

@sophiewigmore
Copy link
Member

@TisVictress why was the BP_LIVE_RELOAD_ENABLED added to the HTTPD/Nginx buildpacks if that functionality works without the watchexec buildpack?

@TisVictress
Copy link

TisVictress commented Jul 26, 2022

@TisVictress why was the BP_LIVE_RELOAD_ENABLED added to the HTTPD/Nginx buildpacks if that functionality works without the watchexec buildpack?

I needed to make this change in the nginx and httpd buildpacks so that I could add support for watchexec to the web-servers buildpack

@sophiewigmore
Copy link
Member

@TisVictress but my question is why is that buildpack needed if this functionality works without watchexec?

@joshuatcasey joshuatcasey added semver:patch A change requiring a patch version bump and removed semver:minor A change requiring a minor version bump labels Jul 26, 2022
@sophiewigmore
Copy link
Member

sophiewigmore commented Jul 26, 2022

Current state of this PR:

  • I'd like to understand if the php-fpm start command part of this buildpack need to be reloaded. In the current implementation, this is not a reloadable process type as far as I know.

  • Even though as seen in this PR, watchexec isn't needed, should we include it for parity with what the Nginx and HTTPD buildpacks do? It seems silly to pull in the watchexec buildpack for no reason. Does this implementation cover the same use cases as using the watchexec buildpack?

@joshuatcasey joshuatcasey added semver:minor A change requiring a minor version bump and removed status/blocked This issue has been triaged and resolving it is blocked on some other issue semver:patch A change requiring a patch version bump labels Oct 7, 2022
TisVictress
TisVictress previously approved these changes Oct 13, 2022
@sophiewigmore
Copy link
Member

@TisVictress this PR is still in progress!

@joshuatcasey
Copy link
Contributor Author

I think it looks good as of 8d026a0c74b375d4dfed5331cf0329980eac152d!

@joshuatcasey
Copy link
Contributor Author

@paketo-buildpacks/php-maintainers Are we good to merge this?

sophiewigmore
sophiewigmore previously approved these changes Oct 19, 2022
@sophiewigmore
Copy link
Member

I'd love to get an additional review from @thitch97 on this before we merge since you and I Josh have been collaborating on this a bit. The changes look good to me, though! :)

thitch97
thitch97 previously approved these changes Oct 27, 2022
@joshuatcasey joshuatcasey merged commit 88635e4 into main Oct 27, 2022
@joshuatcasey joshuatcasey deleted the jtc/issue-33 branch October 27, 2022 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:minor A change requiring a minor version bump
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Demonstrate live reload without watchexec
5 participants