package client
import "github.com/Microsoft/opengcs/client"
Index ¶
- Constants
- func CopyFile(srcFile, destFile string, overwrite bool) error
- func LayerVhdDetails(folder string) (string, int64, bool, error)
- type Config
- func (config *Config) CreateExt4Vhdx(destFile string, sizeGB uint32, cacheFile string) error
- func (config *Config) DebugGCS()
- func (config *Config) GenerateDefault(options []string) error
- func (config *Config) HotAddVhd(hostPath string, containerPath string, readOnly bool, mount bool) error
- func (config *Config) HotRemoveVhd(hostPath string) error
- func (config *Config) RunProcess(commandLine string, stdin io.Reader, stdout io.Writer, stderr io.Writer) (hcsshim.Process, error)
- func (config *Config) StartUtilityVM() error
- func (config *Config) Validate() error
- func (config *Config) VhdToTar(vhdFile string, uvmMountPath string, isSandbox bool, vhdSize int64) (io.ReadCloser, error)
- type Mode
- type Options
Constants ¶
const ( // DefaultVhdxSizeGB is the size of the default sandbox & scratch in GB DefaultVhdxSizeGB = 20 )
Functions ¶
func CopyFile ¶
CopyFile is a utility for copying a file - used for the sandbox cache. Uses CopyFileW win32 API for performance
func LayerVhdDetails ¶
LayerVhdDetails is a utility for getting a file name, size and indication of sandbox for a VHD(x) in a folder. A read-only layer will be layer.vhd. A read-write layer will be sandbox.vhdx.
Types ¶
type Config ¶
type Config struct { Options // Configuration options Name string // Name of the utility VM UvmTimeoutSeconds int // How long to wait for the utility VM to respond in seconds Uvm hcsshim.Container // The actual container MappedVirtualDisks []hcsshim.MappedVirtualDisk // Data-disks to be attached }
Config is the structure used to configuring a utility VM. There are two ways of starting. Either supply a VHD, or a Kernel+Initrd. For the latter, both must be supplied, and both must be in the same directory.
VHD is the priority.
func (*Config) CreateExt4Vhdx ¶
CreateExt4Vhdx does what it says on the tin. It is the responsibility of the caller to synchronise simultaneous attempts to create the cache file.
func (*Config) DebugGCS ¶
func (config *Config) DebugGCS()
DebugGCS extracts logs from the GCS. It's a useful hack for debugging, but not necessarily optimal, but all that is available to us in RS3.
func (*Config) GenerateDefault ¶
GenerateDefault generates a default config from a set of options If baseDir is not supplied, defaults to $env:ProgramFiles\Linux Containers
func (*Config) HotAddVhd ¶
func (config *Config) HotAddVhd(hostPath string, containerPath string, readOnly bool, mount bool) error
HotAddVhd hot-adds a VHD to a utility VM. This is used in the global one-utility-VM- service-VM per host scenario. In order to do a graphdriver `Diff`, we hot-add the sandbox to /mnt/<id> so that we can run `exportSandbox` inside the utility VM to get a tar-stream of the sandboxes contents back to the daemon.
func (*Config) HotRemoveVhd ¶
HotRemoveVhd hot-removes a VHD from a utility VM. This is used in the global one-utility-VM- service-VM per host scenario.
func (*Config) RunProcess ¶
func (config *Config) RunProcess(commandLine string, stdin io.Reader, stdout io.Writer, stderr io.Writer) (hcsshim.Process, error)
RunProcess runs the given command line program in the utilityVM. It takes in an input to the reader to feed into stdin and returns stdout to output. IMPORTANT: It is the responsibility of the caller to call Close() on the returned process.
func (*Config) StartUtilityVM ¶
StartUtilityVM creates and starts a utility VM from a configuration.
func (*Config) Validate ¶
Validate validates a Config structure for starting a utility VM.
func (*Config) VhdToTar ¶
func (config *Config) VhdToTar(vhdFile string, uvmMountPath string, isSandbox bool, vhdSize int64) (io.ReadCloser, error)
VhdToTar does what is says - it exports a VHD in a specified folder (either a read-only layer.vhd, or a read-write sandbox.vhd) to a ReadCloser containing a tar-stream of the layers contents.
type Mode ¶
type Mode uint
Mode is the operational mode, both requested, and actual after verification
type Options ¶
type Options struct { KirdPath string // Path to where kernel/initrd are found (defaults to %PROGRAMFILES%\Linux Containers) TimeoutSeconds int // Requested time for the utility VM to respond in seconds (may be over-ridden by environment) BootParameters string // Additional boot parameters for initrd booting }
Options is the structure used by a client to define configurable options for a utility VM.
func ParseOptions ¶
ParseOptions parses a set of K-V pairs into options used by opengcs. Note for consistency with the LCOW graphdriver in docker, we keep the same convention of an `lcow.` prefix.
Source Files ¶
config.go createext4vhdx.go hotaddvhd.go hotremovevhd.go init.go layervhddetails.go process.go utilities.go vhdtotar.go
- Version
- v0.4.0 (latest)
- Published
- Dec 4, 2020
- Platform
- windows/amd64
- Imports
- 15 packages
- Last checked
- now –
Tools for package owners.