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

Add new exec package for host process containers #1233

Merged
merged 6 commits into from
Dec 18, 2021

Commits on Dec 16, 2021

  1. Add new exec package for host process containers

    This change adds a new exec package thats main goal is to run
    external processes on Windows. Unfortunately due to a couple
    things that can't be accomplished with the stdlib os/exec package,
    this new package is meant to replace how processes for host process
    containers are launched.
    
    The main shortcomings are not being able to pass in a pseudo console to use
    for tty scenarios, and not being able to start a process assigned to a job object
    instead of doing the Create -> Assign dance. Both of these issue are centered
    around not having access to the process thread attribute list that is setup inside
    of syscall.StartProcess. This is needed to be able to properly setup both cases,
    as it requires calling UpdateProcThreadAttribute and passing in what's necessary
    for both scenarios.
    
    Signed-off-by: Daniel Canter <dcanter@microsoft.com>
    dcantah committed Dec 16, 2021
    Configuration menu
    Copy the full SHA
    8b9a11b View commit details
    Browse the repository at this point in the history
  2. PR feedback

    * Remove conpty comments
    * Terminate the process if os.FindProcess doesn't work.
    
    Signed-off-by: Daniel Canter <dcanter@microsoft.com>
    dcantah committed Dec 16, 2021
    Configuration menu
    Copy the full SHA
    46e016f View commit details
    Browse the repository at this point in the history
  3. Add pseudo console support to exec package

    This change adds pseudo console support to the exec package.
    
    Signed-off-by: Daniel Canter <dcanter@microsoft.com>
    dcantah committed Dec 16, 2021
    Configuration menu
    Copy the full SHA
    6861cd6 View commit details
    Browse the repository at this point in the history
  4. Change to x/sys/windows for /internal/exec package

    x/sys/windows has the Proc thread attribute work we need already, so swap
    to this instead of our own definitions.
    
    Signed-off-by: Daniel Canter <dcanter@microsoft.com>
    dcantah committed Dec 16, 2021
    Configuration menu
    Copy the full SHA
    49f270a View commit details
    Browse the repository at this point in the history

Commits on Dec 17, 2021

  1. PR feedback

    1. Add comment regarding thread safety
    2. Add check on job object test to make sure the pids slice has at least
    one element before testing what's in [0].
    3. Change stdioOurEnd -> stdioPipesOurSide and
    stdioProcEnd -> stdioPipesProcSide.
    4. Misc. clarification comments on fields and methods.
    5. Change from raw string literal in powershell test to string with carriage
    return at the end.
    
    Signed-off-by: Daniel Canter <dcanter@microsoft.com>
    dcantah committed Dec 17, 2021
    Configuration menu
    Copy the full SHA
    006bfb1 View commit details
    Browse the repository at this point in the history

Commits on Dec 18, 2021

  1. Pr feedback

    1. Add nod to using e.ExitCode() in the process lifecycle comment
    2. Change to different way to defer close the thread handle to avoid
    nolint comment
    
    Signed-off-by: Daniel Canter <dcanter@microsoft.com>
    dcantah committed Dec 18, 2021
    Configuration menu
    Copy the full SHA
    0b4db2c View commit details
    Browse the repository at this point in the history