1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #15901 from Microsoft/10662-revendorhcs

Windows: Revendor HCSShim with godoc
This commit is contained in:
David Calavera 2015-08-31 10:03:18 +02:00
commit 998699316c
22 changed files with 58 additions and 7 deletions

View file

@ -14,7 +14,7 @@ clone git github.com/gorilla/context 14f550f51a
clone git github.com/gorilla/mux e444e69cbd clone git github.com/gorilla/mux e444e69cbd
clone git github.com/kr/pty 5cf931ef8f clone git github.com/kr/pty 5cf931ef8f
clone git github.com/mattn/go-sqlite3 b4142c444a8941d0d92b0b7103a24df9cd815e42 clone git github.com/mattn/go-sqlite3 b4142c444a8941d0d92b0b7103a24df9cd815e42
clone git github.com/microsoft/hcsshim da093dac579302d7b413696b96dec0b5e1bce8d4 clone git github.com/microsoft/hcsshim 7f646aa6b26bcf90caee91e93cde4a80d0d8a83e
clone git github.com/mistifyio/go-zfs v2.1.1 clone git github.com/mistifyio/go-zfs v2.1.1
clone git github.com/tchap/go-patricia v2.1.0 clone git github.com/tchap/go-patricia v2.1.0
clone git golang.org/x/net 3cffabab72adf04f8e3b01c5baf775361837b5fe https://github.com/golang/net.git clone git golang.org/x/net 3cffabab72adf04f8e3b01c5baf775361837b5fe https://github.com/golang/net.git

View file

@ -8,6 +8,10 @@ import (
"github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus"
) )
// ActivateLayer will find the layer with the given id and mount it's filesystem.
// For a read/write layer, the mounted filesystem will appear as a volume on the
// host, while a read-only layer is generally expected to be a no-op.
// An activated layer must later be deactivated via DeactivateLayer.
func ActivateLayer(info DriverInfo, id string) error { func ActivateLayer(info DriverInfo, id string) error {
title := "hcsshim::ActivateLayer " title := "hcsshim::ActivateLayer "
logrus.Debugf(title+"Flavour %s ID %s", info.Flavour, id) logrus.Debugf(title+"Flavour %s ID %s", info.Flavour, id)

View file

@ -8,6 +8,10 @@ import (
"github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus"
) )
// CopyLayer performs a commit of the srcId (which is expected to be a read-write
// layer) into a new read-only layer at dstId. This requires the full list of
// on-disk paths to parent layers, provided in parentLayerPaths, in order to
// complete the commit.
func CopyLayer(info DriverInfo, srcId, dstId string, parentLayerPaths []string) error { func CopyLayer(info DriverInfo, srcId, dstId string, parentLayerPaths []string) error {
title := "hcsshim::CopyLayer " title := "hcsshim::CopyLayer "
logrus.Debugf(title+"srcId %s dstId", srcId, dstId) logrus.Debugf(title+"srcId %s dstId", srcId, dstId)

View file

@ -8,7 +8,9 @@ import (
"github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus"
) )
// CreateComputeSystem creates a container // CreateComputeSystem creates a container, initializing its configuration in
// the Host Compute Service such that it can be started by a call to the
// StartComputeSystem method.
func CreateComputeSystem(id string, configuration string) error { func CreateComputeSystem(id string, configuration string) error {
title := "HCSShim::CreateComputeSystem" title := "HCSShim::CreateComputeSystem"

View file

@ -8,6 +8,8 @@ import (
"github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus"
) )
// CreateLayer creates a new, empty, read-only layer on the filesystem based on
// the parent layer provided.
func CreateLayer(info DriverInfo, id, parent string) error { func CreateLayer(info DriverInfo, id, parent string) error {
title := "hcsshim::CreateLayer " title := "hcsshim::CreateLayer "
logrus.Debugf(title+"Flavour %s ID %s parent %s", info.Flavour, id, parent) logrus.Debugf(title+"Flavour %s ID %s parent %s", info.Flavour, id, parent)

View file

@ -11,7 +11,7 @@ import (
"github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus"
) )
// processParameters is use to both the input of CreateProcessInComputeSystem // CreateProcessParams is used as both the input of CreateProcessInComputeSystem
// and to convert the parameters to JSON for passing onto the HCS // and to convert the parameters to JSON for passing onto the HCS
type CreateProcessParams struct { type CreateProcessParams struct {
ApplicationName string ApplicationName string

View file

@ -8,6 +8,10 @@ import (
"github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus"
) )
// CreateSandboxLayer creates and populates new read-write layer for use by a container.
// This requires both the id of the direct parent layer, as well as the full list
// of paths to all parent layers up to the base (and including the direct parent
// whose id was provided).
func CreateSandboxLayer(info DriverInfo, layerId, parentId string, parentLayerPaths []string) error { func CreateSandboxLayer(info DriverInfo, layerId, parentId string, parentLayerPaths []string) error {
title := "hcsshim::CreateSandboxLayer " title := "hcsshim::CreateSandboxLayer "
logrus.Debugf(title+"layerId %s parentId %s", layerId, parentId) logrus.Debugf(title+"layerId %s parentId %s", layerId, parentId)

View file

@ -8,6 +8,7 @@ import (
"github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus"
) )
// DeactivateLayer will dismount a layer that was mounted via ActivateLayer.
func DeactivateLayer(info DriverInfo, id string) error { func DeactivateLayer(info DriverInfo, id string) error {
title := "hcsshim::DeactivateLayer " title := "hcsshim::DeactivateLayer "
logrus.Debugf(title+"Flavour %s ID %s", info.Flavour, id) logrus.Debugf(title+"Flavour %s ID %s", info.Flavour, id)

View file

@ -8,6 +8,8 @@ import (
"github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus"
) )
// DestroyLayer will remove the on-disk files representing the layer with the given
// id, including that layer's containing folder, if any.
func DestroyLayer(info DriverInfo, id string) error { func DestroyLayer(info DriverInfo, id string) error {
title := "hcsshim::DestroyLayer " title := "hcsshim::DestroyLayer "
logrus.Debugf(title+"Flavour %s ID %s", info.Flavour, id) logrus.Debugf(title+"Flavour %s ID %s", info.Flavour, id)

View file

@ -8,6 +8,11 @@ import (
"github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus"
) )
// ExportLayer will create a folder at exportFolderPath and fill that folder with
// the transport format version of the layer identified by layerId. This transport
// format includes any metadata required for later importing the layer (using
// ImportLayer), and requires the full list of parent layer paths in order to
// perform the export.
func ExportLayer(info DriverInfo, layerId string, exportFolderPath string, parentLayerPaths []string) error { func ExportLayer(info DriverInfo, layerId string, exportFolderPath string, parentLayerPaths []string) error {
title := "hcsshim::ExportLayer " title := "hcsshim::ExportLayer "
logrus.Debugf(title+"flavour %d layerId %s folder %s", info.Flavour, layerId, exportFolderPath) logrus.Debugf(title+"flavour %d layerId %s folder %s", info.Flavour, layerId, exportFolderPath)

View file

@ -8,6 +8,10 @@ import (
"github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus"
) )
// GetLayerMountPath will look for a mounted layer with the given id and return
// the path at which that layer can be accessed. This path may be a volume path
// if the layer is a mounted read-write layer, otherwise it is expected to be the
// folder path at which the layer is stored.
func GetLayerMountPath(info DriverInfo, id string) (string, error) { func GetLayerMountPath(info DriverInfo, id string) (string, error) {
title := "hcsshim::GetLayerMountPath " title := "hcsshim::GetLayerMountPath "
logrus.Debugf(title+"Flavour %s ID %s", info.Flavour, id) logrus.Debugf(title+"Flavour %s ID %s", info.Flavour, id)

View file

@ -8,6 +8,9 @@ import (
"github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus"
) )
// GetSharedBaseImages will enumerate the images stored in the common central
// image store and return descriptive info about those images for the purpose
// of registering them with the graphdriver, graph, and tagstore.
func GetSharedBaseImages() (imageData string, err error) { func GetSharedBaseImages() (imageData string, err error) {
title := "hcsshim::GetSharedBaseImages " title := "hcsshim::GetSharedBaseImages "

View file

@ -8,6 +8,10 @@ import (
"github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus"
) )
// ImportLayer will take the contents of the folder at importFolderPath and import
// that into a layer with the id layerId. Note that in order to correctly populate
// the layer and interperet the transport format, all parent layers must already
// be present on the system at the paths provided in parentLayerPaths.
func ImportLayer(info DriverInfo, layerId string, importFolderPath string, parentLayerPaths []string) error { func ImportLayer(info DriverInfo, layerId string, importFolderPath string, parentLayerPaths []string) error {
title := "hcsshim::ImportLayer " title := "hcsshim::ImportLayer "
logrus.Debugf(title+"flavour %d layerId %s folder %s", info.Flavour, layerId, importFolderPath) logrus.Debugf(title+"flavour %d layerId %s folder %s", info.Flavour, layerId, importFolderPath)

View file

@ -8,6 +8,8 @@ import (
"github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus"
) )
// LayerExists will return true if a layer with the given id exists and is known
// to the system.
func LayerExists(info DriverInfo, id string) (bool, error) { func LayerExists(info DriverInfo, id string) (bool, error) {
title := "hcsshim::LayerExists " title := "hcsshim::LayerExists "
logrus.Debugf(title+"Flavour %s ID %s", info.Flavour, id) logrus.Debugf(title+"Flavour %s ID %s", info.Flavour, id)

View file

@ -8,6 +8,9 @@ import (
"github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus"
) )
// NameToGuid converts the given string into a GUID using the algorithm in the
// Host Compute Service, ensuring GUIDs generated with the same string are common
// across all clients.
func NameToGuid(name string) (id GUID, err error) { func NameToGuid(name string) (id GUID, err error) {
title := "hcsshim::NameToGuid " title := "hcsshim::NameToGuid "
logrus.Debugf(title+"Name %s", name) logrus.Debugf(title+"Name %s", name)

View file

@ -8,6 +8,11 @@ import (
"github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus"
) )
// PrepareLayer finds a mounted read-write layer matching layerId and enables the
// the filesystem filter for use on that layer. This requires the paths to all
// parent layers, and is necessary in order to view or interact with the layer
// as an actual filesystem (reading and writing files, creating directories, etc).
// Disabling the filter must be done via UnprepareLayer.
func PrepareLayer(info DriverInfo, layerId string, parentLayerPaths []string) error { func PrepareLayer(info DriverInfo, layerId string, parentLayerPaths []string) error {
title := "hcsshim::PrepareLayer " title := "hcsshim::PrepareLayer "
logrus.Debugf(title+"flavour %d layerId %s", info.Flavour, layerId) logrus.Debugf(title+"flavour %d layerId %s", info.Flavour, layerId)

View file

@ -8,6 +8,8 @@ import (
"github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus"
) )
// ResizeConsoleInComputeSystem updates the height and width of the console
// session for the process with the given id in the container with the given id.
func ResizeConsoleInComputeSystem(id string, processid uint32, h, w int) error { func ResizeConsoleInComputeSystem(id string, processid uint32, h, w int) error {
title := "HCSShim::ResizeConsoleInComputeSystem" title := "HCSShim::ResizeConsoleInComputeSystem"

View file

@ -8,7 +8,8 @@ import (
"github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus"
) )
// ShutdownComputeSystem shuts down a container // ShutdownComputeSystem shuts down a container by requesting a shutdown within
// the container operating system.
func ShutdownComputeSystem(id string) error { func ShutdownComputeSystem(id string) error {
var title = "HCSShim::ShutdownComputeSystem" var title = "HCSShim::ShutdownComputeSystem"

View file

@ -8,7 +8,8 @@ import (
"github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus"
) )
// StartComputeSystem starts a container // StartComputeSystem starts a container that has previously been created via
// CreateComputeSystem.
func StartComputeSystem(id string) error { func StartComputeSystem(id string) error {
title := "HCSShim::StartComputeSystem" title := "HCSShim::StartComputeSystem"

View file

@ -8,7 +8,7 @@ import (
"github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus"
) )
// TerminateComputeSystem force terminates a container // TerminateComputeSystem force terminates a container.
func TerminateComputeSystem(id string) error { func TerminateComputeSystem(id string) error {
var title = "HCSShim::TerminateComputeSystem" var title = "HCSShim::TerminateComputeSystem"

View file

@ -8,7 +8,7 @@ import (
"github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus"
) )
// TerminateProcessInComputeSystem kills a process in a running container // TerminateProcessInComputeSystem kills a process in a running container.
func TerminateProcessInComputeSystem(id string, processid uint32) (err error) { func TerminateProcessInComputeSystem(id string, processid uint32) (err error) {
title := "HCSShim::TerminateProcessInComputeSystem" title := "HCSShim::TerminateProcessInComputeSystem"

View file

@ -8,6 +8,8 @@ import (
"github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus"
) )
// UnprepareLayer disables the filesystem filter for the read-write layer with
// the given id.
func UnprepareLayer(info DriverInfo, layerId string) error { func UnprepareLayer(info DriverInfo, layerId string) error {
title := "hcsshim::UnprepareLayer " title := "hcsshim::UnprepareLayer "
logrus.Debugf(title+"flavour %d layerId %s", info.Flavour, layerId) logrus.Debugf(title+"flavour %d layerId %s", info.Flavour, layerId)