-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
updates to support Windows 10 using linux subsystem #700
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
updates to support Windows 10 using linux subsystem #700
Conversation
…ws except the SQS tests; tested using the Linux Subsystem for Windows on Windows 10.
} catch (IOException e) { | ||
throw new RuntimeException(e); | ||
if (IS_WINDOWS) { | ||
exec(false, "cd '" + getTmpInstallDir() + "/localstack/infra'; cat > " + INSTALLATION_FINISHED_MARKER); |
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.
Curious about this change - installationDoneMarker.createNewFile()
does not work under Windows?
@@ -192,11 +237,18 @@ public static boolean isEnvConfigSet(String configName) { | |||
} | |||
|
|||
private static String getEndpoint(String service) { | |||
LOG.info(String.format("fetching endpoint for '%s'...", service)); |
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.
Perhaps we can make this a debug
message instead of info
? (same for line 242)
@@ -241,21 +301,84 @@ public void run() { | |||
} | |||
} | |||
|
|||
/** | |||
* for Windows there are a several key differnces: |
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.
nit: differnces
if (cmd.length == 1 && !new File(cmd[0]).exists()) { | ||
String commandArg = "\"" + cmd[0] + "; exit\""; | ||
timeout = getProcessTimeout(commandArg); | ||
LOG.info(String.format("executing (timeout = %ds) : bash -c %s", timeout, commandArg)); |
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.
Maybe we should also reduce the log level from info
to debug
here.
}); | ||
} | ||
} else { | ||
/* make sure we destroy the process on JVM shutdown */ |
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.
nit: duplication with lines 291-296 - could be moved to a separate util method.
Process proc; | ||
try { | ||
proc = exec(false, cmd); | ||
LOG.info("starting..."); |
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.
Perhaps a more "verbose"/detailed message like:
LOG.info("Starting LocalStack infrastructure services from installation directory: " + getTmpInstallDir());
Then we can also remove line 381.
@@ -270,12 +393,39 @@ private void setupInfrastructure() { | |||
throw new RuntimeException("Unable to start local infrastructure. Debug output: " + output); | |||
} | |||
INFRA_STARTED.set(proc); | |||
LOG.info("started..."); |
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.
Perhaps a more "verbose"/detailed message like:
LOG.info("Successfully started LocalStack infrastructure services.");
} | ||
|
||
static { | ||
serviceMap.put(API_GATEWAY, "http://localhost:4567"); |
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.
I'd like to avoid hardcoding the service endpoints here. Is there any chance we can make getEndpointOnWindows
implement a logic similar to getEndpointOnLinux
? Can you elaborate a bit why the existing getEndpoint(...)
method doesn't work under Windows? Thanks
If the same approach (calling a python process that reads the configuration) does not work under Windows, another option to get the default service ports/endpoints would be to read the localstack_client
config file from the installation directory - typically $TMPDIR/localstack_install_dir/.venv/lib/python*/site-packages/localstack_client/config.py
(where python*
is a placeholder for the concrete python version, for example python2.7
or python3.6
).
The problem with using the default ports, though, is that this could lead to conflicts if users provide configuration settings that specify custom ports per service. Therefore, the dynamic port lookup (by calling the python process) would be the preferred option here.
Thanks for this comprehensive PR @rjackson64840 - great changes! I left a few comments - most of them are minor issues. One thing we should try to figure out is how to not hardcode the ports/endpoints in the code. Thanks |
Any update on this PR @rjackson64840 ? I think we're almost there, would be great to get these changes merged... thanks |
Trying one more time. @rjackson64840 any chance we can rebase this PR onto latest |
5200867
to
21a1db4
Compare
This PR is stale for quite a long time, a lot has changed since then. Please feel free to file a new PR or create an issue. |
The following issues are corrected:
Also added additional helpful logging/output which will assist Windows users in troubleshooting.
Tested on Windows 10 using the Linux Subsystem for Windows. All of the localstack tests pass except for the SQS messaging tests.
┆Issue is synchronized with this Jira Bug by Unito