FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add a hot reloading RIE side implementation by dfangl · Pull Request #7 · localstack/lambda-runtime-init · GitHub

Add a hot reloading RIE side implementation - #7

Merged
dfangl merged 6 commits into
localstackfrom
hot-reloading
Dec 13, 2022
Merged

Add a hot reloading RIE side implementation#7
dfangl merged 6 commits into
localstackfrom
hot-reloading

Conversation

dfangl commented Dec 7, 2022
edited
Loading

Copy link
Copy Markdown
Member

Motivation

We want to provide hot reloading to be able to mount a volume into the container and see changes as they happen. For this, once a change happens, we have to reset the infrastructure, to support reloading (for example, a loaded python module will not change if the source changes, we have to reload it / restart the interpreter).

Changes

  • Add recursive filewatcher for the /var/task folder, to be alerted if something changes
  • Add a debounced function to reload 500ms after last file change (to prevent too many restarts due to massive file changes)

Todos

  • Check functionality on windows and mac, and add polling mode if necessary
  • Add separate env variables to watch /var/task and /opt respectively? Or a even better, a list of to-be-watched directories.

dominikschubert left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looking forward to this feature! 😁

Added a few nits and suggestions.

Especially the main logic block in RunFileWatcher would benefit a lot from deconstructing it into smaller functions and introducing a struct for the filewatcher.

A few other suggestions for now:

  • separate the debounce from the actual consumption/processing of the changes for more clarity (e.g. the debounce itself could be a wrapper around the channel)
  • prefer passing a context instead of a channel for signaling exit/done

Comment thread cmd/localstack/filenotify/filenotify.go Outdated
Comment thread cmd/localstack/awsutil.go Outdated
Comment thread cmd/localstack/awsutil.go Outdated
dominikschubert self-requested a review December 13, 2022 09:19

dominikschubert left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

small nit/suggestion, otherwise LGTM

Comment thread cmd/localstack/awsutil.go Outdated
Comment thread cmd/localstack/awsutil.go Outdated
Comment thread cmd/localstack/awsutil.go
Comment thread cmd/localstack/awsutil.go Outdated
dfangl marked this pull request as ready for review December 13, 2022 16:19
dfangl merged commit afe23d0 into localstack Dec 13, 2022
dfangl deleted the hot-reloading branch December 13, 2022 16:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL