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

Enable parsing the OCI linux configuration on non-linux platforms #135

Closed
wants to merge 3 commits into from

Commits on Sep 9, 2015

  1. Merge pull request opencontainers#162 from vbatts/formatting

    *.md: markdown formatting
    Mrunal Patel committed Sep 9, 2015
    Configuration menu
    Copy the full SHA
    6cc6798 View commit details
    Browse the repository at this point in the history
  2. change the user of the Process to a json.RawMessage

    The type of `user` becomes `json.RawMessage` instead of platform aware
    structure, so the Spec becomes a platform-independent structure.
    
    It makes we can parse the config.json as a Spec before knowing
    the os, and allows we move the linux related *.go to linux/.
    
    The runtime should parse the user with the corresponding platform
    specific User structure.
    
    Signed-off-by: Lai Jiangshan <[email protected]>
    laijs committed Sep 9, 2015
    Configuration menu
    Copy the full SHA
    44b4415 View commit details
    Browse the repository at this point in the history
  3. Enable parsing the OCI linux configuration on non-linux platforms

    What does this patch do?
     * Make the LinuxSpec be visible by golang on non-linux platforms when “go build”
    
    What did this patch change?
     * Add linux/
     * Rename config_linux.go to linux/config.go
     * Rename config-linux.md to linux/config.md
     * Rename runtime_config_linux.go to linux/runtime-config.go
     * Rename runtime-config-linux.md to linux/runtime-config.md
     * Rename runtime-linux.md -> linux/runtime.md
     * Remove the “// +build linux” from linux/config.go
     * The package name of linux/*.go is changed to “linux”
     * Add import of the “specs” in the linux/*.go
    
    The type LinuxSpec (or say the OCI linux configuration) is a structure
    describing some information, there is no executable code bound to the linux,
    so the LinuxSpec should be naturally usable by any platform when needed.
    
    But the file names (ended with “_linux.go”) and the build tag disallow
    us to do so. The patch changes it. Removing the “_linux” and the build tag
    makes `go build` accept the LinuxSpec on any platform. The linux related files
    are also moved to the linux/ to eliminate the future possible name clashing
    (include the file names and the type names).
    
    After making the LinuxSpec be visible on non-linux platforms, anyone can
    do anything of the following in any platforms. (They are also the useful usecases)
     * 1) parse the OCI linux configuration (config.json & runtime.json)
     * 2) verify the OCI linux configuration or the bundle
     * 3) check or test the OCI linux configuration or even the bundle
     * 4) discover/build/deliver linux OCI bundle
     * 5) Run the container via the hypervisor-based runtime on non-linux platforms
     * etc.)
    
    The 5) is one thing of what we are focusing on. After this patch applied,
    anyone can build the runv[1] and run linux container on darwin. (Also after
    we update the opencontainers/spec under Godeps/ in our runv.git[1] project.)
    
    [1]: https://github.com/hyperhq/runv
    
    Signed-off-by: Lai Jiangshan <[email protected]>
    laijs committed Sep 9, 2015
    Configuration menu
    Copy the full SHA
    e3028f5 View commit details
    Browse the repository at this point in the history