[jira] [Commented] (MESOS-10093) Docker containerizer does handle whitespace correctly on Windows

2020-02-06 Thread Greg Mann (Jira)


[ 
https://issues.apache.org/jira/browse/MESOS-10093?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17031650#comment-17031650
 ] 

Greg Mann commented on MESOS-10093:
---

I heard from [~kaysoky] that this may have been a relic from earlier days in 
Mesos-on-Windows development, when PowerShell was the intended default shell on 
that platform. This was later changed to {{cmd}} to reduce the resource 
overhead.

> Docker containerizer does handle whitespace correctly on Windows
> 
>
> Key: MESOS-10093
> URL: https://issues.apache.org/jira/browse/MESOS-10093
> Project: Mesos
>  Issue Type: Bug
>Affects Versions: 1.9.0
>Reporter: Greg Mann
>Priority: Major
>  Labels: containerization, docker, mesosphere, windows
>
> When running some tests of Mesos on Windows, I discovered that the following 
> command would not execute successfully when passed to the Docker 
> containerizer in {{TaskInfo.command}}:
> {noformat}
> python -c "print('hello world')"
> {noformat}
> The following error is found in the task sandbox:
> {noformat}
>   File "", line 1
> "print('hello
> ^
> SyntaxError: EOL while scanning string literal
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (MESOS-10093) Docker containerizer does handle whitespace correctly on Windows

2020-02-05 Thread Greg Mann (Jira)


[ 
https://issues.apache.org/jira/browse/MESOS-10093?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17031100#comment-17031100
 ] 

Greg Mann commented on MESOS-10093:
---

On windows, we execute shell commands as arguments to {{cmd.exe}}. I ran the 
following test in the command prompt:
{noformat}
C:\Users\Administrator>cmd /c "python -c \"print('hello world')\""
  File "", line 1
"print('hello
^
SyntaxError: EOL while scanning string literal

C:\Users\Administrator>cmd /c "python -c ^"print('hello world')^""
hello world
{noformat}

In libprocess, it looks like we currently escape double quotes using a 
backslash: 
https://github.com/apache/mesos/blob/4990d2cd6e76da340b30e200be0d700124dac2b1/3rdparty/stout/include/stout/os/windows/shell.hpp#L188-L191

Based on the above test, it appears that escaping them with caret instead.

NOTE that before merging such a change, we should confirm that changing this 
escaping behavior doesn't break Mesos containerizer tasks.

> Docker containerizer does handle whitespace correctly on Windows
> 
>
> Key: MESOS-10093
> URL: https://issues.apache.org/jira/browse/MESOS-10093
> Project: Mesos
>  Issue Type: Bug
>Affects Versions: 1.9.0
>Reporter: Greg Mann
>Priority: Major
>  Labels: containerization, docker, mesosphere, windows
>
> When running some tests of Mesos on Windows, I discovered that the following 
> command would not execute successfully when passed to the Docker 
> containerizer in {{TaskInfo.command}}:
> {noformat}
> python -c "print('hello world')"
> {noformat}
> The following error is found in the task sandbox:
> {noformat}
>   File "", line 1
> "print('hello
> ^
> SyntaxError: EOL while scanning string literal
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)