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

nogui parameter is not working in docker environment #20

Closed
mkaring opened this issue Feb 15, 2021 · 4 comments
Closed

nogui parameter is not working in docker environment #20

mkaring opened this issue Feb 15, 2021 · 4 comments
Assignees

Comments

@mkaring
Copy link

mkaring commented Feb 15, 2021

Hello,

I noticed that the nogui flag is not working properly when using the process governor inside docker.

This dockerfile works as an example:

# escape=`
FROM mcr.microsoft.com/windows/servercore:ltsc2019

# Install Process Povernor
ARG PROCGOV_VERSION=2.6.20324.1
ARG PROCGOV_SHA1=A231E777922736C8160B2FE250BCDE18CBA83AFB

RUN `
    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; `
    Invoke-WebRequest $('https://github.com/lowleveldesign/process-governor/releases/download/v{0}/procgov.zip' -f $env:PROCGOV_VERSION) -OutFile procgov.zip -UseBasicParsing ; `
    if ((Get-FileHash 'procgov.zip' -Algorithm SHA1).Hash -ne $env:PROCGOV_SHA1) { Write-Error 'Process Governor SHA1 mismatch'; exit 1 } ; `
    Expand-Archive 'procgov.zip' -Destination "c:/ProgramData" ; `
    Remove-Item -Path 'procgov.zip' ; `
    setx /M PATH $('c:\ProgramData\procgov;{0}' -f $env:PATH) | Out-Null

RUN procgov64.exe --cpu 1 --nogui -- ping -n 1 localhost

To build this file I simply run:

docker build .

I expected to only see the output of the command line from the last command, but what I actually get is this:

Process Governor v2.6.20324.1 - sets limits on your processes
Copyright (C) 2019 Sebastian Solnica (lowleveldesign.org)

CPU affinity mask:                      0x1
Max CPU rate:                           (not set)
Maximum committed memory (MB):          (not set)
Minimum WS memory (MB):                 (not set)
Maximum WS memory (MB):                 (not set)
Preferred NUMA node:                    (not set)
Process user-time execution limit (ms): (not set)
Job user-time execution limit (ms):     (not set)
Clock-time execution limit (ms):        (not set)

Press Ctrl-C to end execution without terminating the process.


Pinging 8abc905ec0f5 [::1] with 32 bytes of data:
Reply from ::1: time<1ms

Ping statistics for ::1:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Testing this requires a Windows Server 2016, 2019 or Windows 10 Pro 1809 or later with docker installed and setup to create windows containers. If you don't have the required setup to run any tests, I can easily run test builds.

@lowleveldesign
Copy link
Owner

Thanks Martin for the detailed description. The --nogui option hides the console window when procgov is installed as a debugger on the system. So it's not really what you're looking for. However, it should be no problem to add a --quiet option to hide all procgov output. I will try to do that in the coming days. Out of curiosity, why do you use procgov in the container instead of the docker limits?

@mkaring
Copy link
Author

mkaring commented Feb 15, 2021

The problem is that basically all of these limits only work on Linux and not in the docker for windows version. I was looking to limit the processes inside the container to one specific numa node, but the --cpuset-cpus does not work on windows. So I'm working around this issue using procgov.

There is a very old issue on that matter moby/moby#30594. I don't see that being changed in docker any time soon.

procgov does the job nicely, but currently makes anything parsing the output of the application a bit tricky, due to that header.

@lowleveldesign
Copy link
Owner

Thanks for the explanation. I wasn't aware of the problems in Docker. Nevertheless, I am happy procgov can help here. I updated the latest release, so try ARG PROCGOV_VERSION=2.6.21047.1 and a new -q or --quiet option. It suppresses all procgov messages apart from errors (which go to the standard error stream).

@mkaring
Copy link
Author

mkaring commented Feb 17, 2021

Thank you! I tested it and it works exactly as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants