Giter Site home page Giter Site logo

Comments (5)

gupta-ak avatar gupta-ak commented on May 18, 2024

It seems that all the devices are showing up in LCOW as well. The only difference is that stdin/stdout/stderr are sockets in LCOW and in pipes in Linux. Maybe that's causing the issue.
LCOW:

PS> docker run --rm --isolation=hyperv nginx readlink -f /var/log/nginx/access.log
/proc/1/fd/socket:[12131]
PS> docker run --rm --isolation=hyperv nginx readlink -f /var/log/nginx/error.log
/proc/1/fd/socket:[11395]

Linux:

# docker run --rm nginx readlink -f /var/log/nginx/error.log
/proc/1/fd/pipe:[657542]
# docker run --rm nginx readlink -f /var/log/nginx/access.log
/proc/1/fd/pipe:[658449]

from opengcs.

jstarks avatar jstarks commented on May 18, 2024

There are also issues with node.js because we are passing vsock sockets as stdin/out/err. We need to relay these sockets, unfortunately. We should only do it for container processes, not "external" processes so that we don't have perf overhead for tar2vhd and related processes.

from opengcs.

jterry75 avatar jterry75 commented on May 18, 2024

Ok looked into this. Just to be clear for container processes we need to wrap the socket based read/writes into a pipe and expose the pipe for /proc/$$/fd/{0, 1, 2}. This unfortunately creates a copy given that the Connection interface doesn't expose a stream based interface but overhead should be minimal if we reuse the buffer.

from opengcs.

gupta-ak avatar gupta-ak commented on May 18, 2024

Wouldn't it be easier to change the service\gcs\runtime\runc\runc.go file and change startProcess to take in an isExternal flag? If it's external, then call stdioSet.Files(). If its not external, just hook up the transports directly. The documentation for os/exec says this:

        // Stdin specifies the process's standard input.
        // If Stdin is nil, the process reads from the null device (os.DevNull).
        // If Stdin is an *os.File, the process's standard input is connected
        // directly to that file.
        // Otherwise, during the execution of the command a separate
        // goroutine reads from Stdin and delivers that data to the command
        // over a pipe. In this case, Wait does not complete until the goroutine
        // stops copying, either because it has reached the end of Stdin
        // (EOF or a read error) or because writing to the pipe returned an error.

So, the wrapping up into a pipe stuff is already handled by Go.

from opengcs.

jstarks avatar jstarks commented on May 18, 2024

The problem is that when we do a runc exection, the process exits well before we are done copying the pipe data. So we actually need to spawn copying goroutines manually, and we need to track them, cancel the stdin one, etc. just like we do in the tty case.

from opengcs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.