-
Notifications
You must be signed in to change notification settings - Fork 9
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
Pin wrangler version to fix hanging miniflare invocations #86
Merged
+26
−14
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,8 +26,9 @@ | |
|
||
LOG = logging.getLogger(__name__) | ||
|
||
# identifier for default version installed by package installer | ||
DEFAULT_VERSION = "latest" | ||
# Identifier for default version of `wrangler` installed by package installer. | ||
# Note: Currently pinned to 3.1.0, as newer versions make the invocations hang in the LS container | ||
WRANGLER_VERSION = "3.1.0" | ||
|
||
|
||
class MiniflareExtension(Extension): | ||
|
@@ -36,6 +37,10 @@ class MiniflareExtension(Extension): | |
def update_gateway_routes(self, router: http.Router[http.RouteHandler]): | ||
from miniflare.config import HANDLER_PATH_MINIFLARE | ||
|
||
logging.getLogger("miniflare").setLevel( | ||
logging.DEBUG if config.DEBUG else logging.INFO | ||
) | ||
|
||
LOG.info("miniflare: adding routes to activate extension") | ||
all_methods = ["GET", "POST", "PUT", "DELETE"] | ||
|
||
|
@@ -83,7 +88,7 @@ def __init__(self, script: WorkerScript, port: int): | |
super().__init__(port) | ||
|
||
def do_run(self): | ||
root_dir = os.path.join(config.dirs.var_libs, "miniflare", DEFAULT_VERSION) | ||
root_dir = os.path.join(config.dirs.var_libs, "miniflare", WRANGLER_VERSION) | ||
wrangler_bin = os.path.join(root_dir, "node_modules", ".bin", "wrangler") | ||
|
||
# add global aliases, and variable bindings | ||
|
@@ -102,7 +107,6 @@ def do_run(self): | |
cmd = [ | ||
wrangler_bin, | ||
"dev", | ||
"--experimental-local", | ||
"--port", | ||
str(self.port), | ||
script_path_final, | ||
|
@@ -115,7 +119,7 @@ def do_run(self): | |
|
||
class MiniflareInstaller(ExecutableInstaller): | ||
def __init__(self): | ||
super().__init__("miniflare", version=DEFAULT_VERSION) | ||
super().__init__("miniflare", version=WRANGLER_VERSION) | ||
|
||
def _get_install_marker_path(self, install_dir: str) -> str: | ||
# force re-install on every start (requires npm package + system libs like libc++) | ||
|
@@ -134,5 +138,4 @@ def _install(self, target: InstallTarget) -> None: | |
run(["apt", "install", "-y", "libc++-dev"]) | ||
|
||
# install npm package | ||
run(["npm", "install", "--prefix", target_dir, "wrangler"]) | ||
run(["npm", "install", "--prefix", target_dir, "@miniflare/tre"]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No longer required to install |
||
run(["npm", "install", "--prefix", target_dir, f"wrangler@{WRANGLER_VERSION}"]) |
This file contains 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deprecated argument / no longer required ...