From 7972e6405c9223a0fdd0350d8680f1f14fecf2d0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Jul 2021 21:35:21 +0000 Subject: [PATCH] Bump github.com/containerd/containerd from 1.5.2 to 1.5.4 in /test Bumps [github.com/containerd/containerd](https://github.com/containerd/containerd) from 1.5.2 to 1.5.4. - [Release notes](https://github.com/containerd/containerd/releases) - [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md) - [Commits](https://github.com/containerd/containerd/compare/v1.5.2...v1.5.4) --- updated-dependencies: - dependency-name: github.com/containerd/containerd dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- test/go.mod | 4 +- test/go.sum | 8 +- .../Microsoft/hcsshim/hcn/hcnpolicy.go | 2 +- .../hcsshim/internal/hcs/schema2/container.go | 2 + .../hcsshim/internal/hcs/schema2/device.go | 8 +- .../model_container_definition_device.go | 14 ++ .../hcs/schema2/model_device_category.go | 15 ++ .../hcs/schema2/model_device_extension.go | 15 ++ .../hcs/schema2/model_device_instance.go | 17 ++ .../hcs/schema2/model_device_namespace.go | 16 ++ .../hcs/schema2/model_interface_class.go | 16 ++ .../internal/hcs/schema2/model_namespace.go | 15 ++ .../hcs/schema2/model_object_directory.go | 18 ++ .../hcs/schema2/model_object_namespace.go | 16 ++ .../hcs/schema2/model_object_symlink.go | 18 ++ .../hcsshim/internal/hcsoci/devices.go | 61 +++--- .../hcsshim/internal/hcsoci/hcsdoc_wcow.go | 9 +- .../hcsshim/internal/hcsoci/resources_wcow.go | 16 ++ .../hcsshim/internal/hns/hnspolicy.go | 30 +-- .../hcsshim/internal/oci/annotations.go | 4 + .../Microsoft/hcsshim/internal/oci/uvm.go | 11 ++ .../github.com/containerd/containerd/.mailmap | 1 + .../containerd/containerd/Vagrantfile | 2 +- .../containerd/containerd/archive/tar.go | 5 +- .../containerd/archive/tar_freebsd.go | 14 +- .../containerd/archive/tar_mostunix.go | 21 ++- .../containerd/containerd/archive/tar_unix.go | 15 -- .../containerd/archive/tar_windows.go | 2 +- .../github.com/containerd/containerd/go.mod | 2 +- .../github.com/containerd/containerd/go.sum | 3 +- .../containerd/remotes/docker/auth/fetch.go | 7 + .../containerd/remotes/docker/pusher.go | 2 + .../containerd/containerd/version/version.go | 2 +- .../klauspost/compress/fse/README.md | 156 +++++++-------- .../klauspost/compress/huff0/README.md | 178 +++++++++--------- test/vendor/modules.txt | 4 +- 36 files changed, 485 insertions(+), 244 deletions(-) create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_container_definition_device.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_device_category.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_device_extension.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_device_instance.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_device_namespace.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_interface_class.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_namespace.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_object_directory.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_object_namespace.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_object_symlink.go diff --git a/test/go.mod b/test/go.mod index 4671525fa8..8bcf950db8 100644 --- a/test/go.mod +++ b/test/go.mod @@ -4,8 +4,8 @@ go 1.16 require ( github.com/Microsoft/go-winio v0.4.17 - github.com/Microsoft/hcsshim v0.8.16 - github.com/containerd/containerd v1.5.2 + github.com/Microsoft/hcsshim v0.8.18 + github.com/containerd/containerd v1.5.4 github.com/containerd/go-runc v1.0.0 github.com/containerd/ttrpc v1.0.2 github.com/containerd/typeurl v1.0.2 diff --git a/test/go.sum b/test/go.sum index 0b2df6d184..d3416c5ec4 100644 --- a/test/go.sum +++ b/test/go.sum @@ -115,10 +115,9 @@ github.com/containerd/containerd v1.4.3/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMX github.com/containerd/containerd v1.5.0-beta.1/go.mod h1:5HfvG1V2FsKesEGQ17k5/T7V960Tmcumvqn8Mc+pCYQ= github.com/containerd/containerd v1.5.0-beta.3/go.mod h1:/wr9AVtEM7x9c+n0+stptlo/uBBoBORwEx6ardVcmKU= github.com/containerd/containerd v1.5.0-rc.0/go.mod h1:V/IXoMqNGgBlabz3tHD2TWDoTJseu1FGOKuoA4nNb2s= -github.com/containerd/containerd v1.5.1 h1:xWHPAoe6VkUiI9GAvndJM7s/0MTrmwX3AQiYTr3olf0= -github.com/containerd/containerd v1.5.1/go.mod h1:0DOxVqwDy2iZvrZp2JUx/E+hS0UNTVn7dJnIOwtYR4g= -github.com/containerd/containerd v1.5.2 h1:MG/Bg1pbmMb61j3wHCFWPxESXHieiKr2xG64px/k8zQ= github.com/containerd/containerd v1.5.2/go.mod h1:0DOxVqwDy2iZvrZp2JUx/E+hS0UNTVn7dJnIOwtYR4g= +github.com/containerd/containerd v1.5.4 h1:uPF0og3ByFzDnaStfiQj3fVGTEtaSNyU+bW7GR/nqGA= +github.com/containerd/containerd v1.5.4/go.mod h1:sx18RgvW6ABJ4iYUw7Q5x7bgFOAB9B6G7+yO0XBc4zw= github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/containerd/continuity v0.0.0-20191127005431-f65d91d395eb/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/containerd/continuity v0.0.0-20200710164510-efbc4488d8fe/go.mod h1:cECdGN1O8G9bgKTlLhuPJimka6Xb/Gg7vYzCTNVxhvo= @@ -387,7 +386,6 @@ github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfn github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= @@ -427,7 +425,6 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= @@ -851,7 +848,6 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= diff --git a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnpolicy.go b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnpolicy.go index 4aec8534f6..c2aa599f33 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnpolicy.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnpolicy.go @@ -320,7 +320,7 @@ type L4ProxyPolicySetting struct { Protocol ProtocolType `json:",omitempty"` Exceptions []string `json:",omitempty"` Destination string - OutboundNAT bool `json:",omitempty"` + OutboundNAT bool `json:",omitempty"` } // TierAclRule represents an ACL within TierAclPolicySetting diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/container.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/container.go index 4fb2310768..39a54432c0 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/container.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/container.go @@ -31,4 +31,6 @@ type Container struct { RegistryChanges *RegistryChanges `json:"RegistryChanges,omitempty"` AssignedDevices []Device `json:"AssignedDevices,omitempty"` + + AdditionalDeviceNamespace *ContainerDefinitionDevice `json:"AdditionalDeviceNamespace,omitempty"` } diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/device.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/device.go index 107caddada..31c4538aff 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/device.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/device.go @@ -12,9 +12,9 @@ package hcsschema type DeviceType string const ( - ClassGUID DeviceType = "ClassGuid" - DeviceInstance DeviceType = "DeviceInstance" - GPUMirror DeviceType = "GpuMirror" + ClassGUID DeviceType = "ClassGuid" + DeviceInstanceID DeviceType = "DeviceInstance" + GPUMirror DeviceType = "GpuMirror" ) type Device struct { @@ -22,6 +22,6 @@ type Device struct { Type DeviceType `json:"Type,omitempty"` // The interface class guid of the device interfaces to assign to the container. Only used when Type is ClassGuid. InterfaceClassGuid string `json:"InterfaceClassGuid,omitempty"` - // The location path of the device to assign to the container. Only used when Type is DeviceInstance. + // The location path of the device to assign to the container. Only used when Type is DeviceInstanceID. LocationPath string `json:"LocationPath,omitempty"` } diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_container_definition_device.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_container_definition_device.go new file mode 100644 index 0000000000..8dbe40b3be --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_container_definition_device.go @@ -0,0 +1,14 @@ +/* + * HCS API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type ContainerDefinitionDevice struct { + DeviceExtension []DeviceExtension `json:"device_extension,omitempty"` +} diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_device_category.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_device_category.go new file mode 100644 index 0000000000..8fe89f9274 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_device_category.go @@ -0,0 +1,15 @@ +/* + * HCS API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type DeviceCategory struct { + Name string `json:"name,omitempty"` + InterfaceClass []InterfaceClass `json:"interface_class,omitempty"` +} diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_device_extension.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_device_extension.go new file mode 100644 index 0000000000..a62568d892 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_device_extension.go @@ -0,0 +1,15 @@ +/* + * HCS API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type DeviceExtension struct { + DeviceCategory *DeviceCategory `json:"device_category,omitempty"` + Namespace *DeviceExtensionNamespace `json:"namespace,omitempty"` +} diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_device_instance.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_device_instance.go new file mode 100644 index 0000000000..a7410febd6 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_device_instance.go @@ -0,0 +1,17 @@ +/* + * HCS API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type DeviceInstance struct { + Id string `json:"id,omitempty"` + LocationPath string `json:"location_path,omitempty"` + PortName string `json:"port_name,omitempty"` + InterfaceClass []InterfaceClass `json:"interface_class,omitempty"` +} diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_device_namespace.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_device_namespace.go new file mode 100644 index 0000000000..3553640647 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_device_namespace.go @@ -0,0 +1,16 @@ +/* + * HCS API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type DeviceNamespace struct { + RequiresDriverstore bool `json:"requires_driverstore,omitempty"` + DeviceCategory []DeviceCategory `json:"device_category,omitempty"` + DeviceInstance []DeviceInstance `json:"device_instance,omitempty"` +} diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_interface_class.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_interface_class.go new file mode 100644 index 0000000000..7be98b5410 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_interface_class.go @@ -0,0 +1,16 @@ +/* + * HCS API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type InterfaceClass struct { + Type_ string `json:"type,omitempty"` + Identifier string `json:"identifier,omitempty"` + Recurse bool `json:"recurse,omitempty"` +} diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_namespace.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_namespace.go new file mode 100644 index 0000000000..3ab9cf1ecf --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_namespace.go @@ -0,0 +1,15 @@ +/* + * HCS API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type DeviceExtensionNamespace struct { + Ob *ObjectNamespace `json:"ob,omitempty"` + Device *DeviceNamespace `json:"device,omitempty"` +} diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_object_directory.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_object_directory.go new file mode 100644 index 0000000000..d2f51b3b53 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_object_directory.go @@ -0,0 +1,18 @@ +/* + * HCS API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type ObjectDirectory struct { + Name string `json:"name,omitempty"` + Clonesd string `json:"clonesd,omitempty"` + Shadow string `json:"shadow,omitempty"` + Symlink []ObjectSymlink `json:"symlink,omitempty"` + Objdir []ObjectDirectory `json:"objdir,omitempty"` +} diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_object_namespace.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_object_namespace.go new file mode 100644 index 0000000000..47dfb55bfa --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_object_namespace.go @@ -0,0 +1,16 @@ +/* + * HCS API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type ObjectNamespace struct { + Shadow string `json:"shadow,omitempty"` + Symlink []ObjectSymlink `json:"symlink,omitempty"` + Objdir []ObjectDirectory `json:"objdir,omitempty"` +} diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_object_symlink.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_object_symlink.go new file mode 100644 index 0000000000..8867ebe5f0 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/model_object_symlink.go @@ -0,0 +1,18 @@ +/* + * HCS API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.4 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type ObjectSymlink struct { + Name string `json:"name,omitempty"` + Path string `json:"path,omitempty"` + Scope string `json:"scope,omitempty"` + Pathtoclone string `json:"pathtoclone,omitempty"` + AccessMask int32 `json:"access_mask,omitempty"` +} diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/devices.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/devices.go index 1c5e6f9553..ede997bb7e 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/devices.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/devices.go @@ -2,12 +2,14 @@ package hcsoci import ( "context" + "encoding/json" "fmt" + "io/ioutil" "os" "path/filepath" - "strings" "github.com/Microsoft/hcsshim/internal/devices" + hcsschema "github.com/Microsoft/hcsshim/internal/hcs/schema2" "github.com/Microsoft/hcsshim/internal/log" "github.com/Microsoft/hcsshim/internal/oci" "github.com/Microsoft/hcsshim/internal/resources" @@ -20,14 +22,8 @@ const deviceUtilExeName = "device-util.exe" // getAssignedDeviceKernelDrivers gets any device drivers specified on the spec. // Drivers are optional, therefore do not return an error if none are on the spec. -// -// See comment on oci.AnnotationAssignedDeviceKernelDrivers for expected format. func getAssignedDeviceKernelDrivers(annotations map[string]string) ([]string, error) { - csDrivers, ok := annotations[oci.AnnotationAssignedDeviceKernelDrivers] - if !ok || csDrivers == "" { - return nil, nil - } - drivers := strings.Split(csDrivers, ",") + drivers := oci.ParseAnnotationCommaSeparated(oci.AnnotationAssignedDeviceKernelDrivers, annotations) for _, driver := range drivers { if _, err := os.Stat(driver); err != nil { return nil, errors.Wrapf(err, "failed to find path to drivers at %s", driver) @@ -36,11 +32,47 @@ func getAssignedDeviceKernelDrivers(annotations map[string]string) ([]string, er return drivers, nil } +// getDeviceExtensionPaths gets any device extensions paths specified on the spec. +// device extensions are optional, therefore if none are on the spec, do not return an error. +func getDeviceExtensionPaths(annotations map[string]string) ([]string, error) { + extensions := oci.ParseAnnotationCommaSeparated(oci.AnnotationDeviceExtensions, annotations) + for _, ext := range extensions { + if _, err := os.Stat(ext); err != nil { + return nil, errors.Wrapf(err, "failed to find path to driver extensions at %s", ext) + } + } + return extensions, nil +} + // getDeviceUtilHostPath is a simple helper function to find the host path of the device-util tool func getDeviceUtilHostPath() string { return filepath.Join(filepath.Dir(os.Args[0]), deviceUtilExeName) } +// getDeviceExtensions is a helper function to read the files at `extensionPaths` and unmarshal the contents +// into a `hcsshema.DeviceExtension` to be added to a container's hcs create document. +func getDeviceExtensions(annotations map[string]string) (*hcsschema.ContainerDefinitionDevice, error) { + extensionPaths, err := getDeviceExtensionPaths(annotations) + if err != nil { + return nil, err + } + results := &hcsschema.ContainerDefinitionDevice{ + DeviceExtension: []hcsschema.DeviceExtension{}, + } + for _, extensionPath := range extensionPaths { + data, err := ioutil.ReadFile(extensionPath) + if err != nil { + return nil, errors.Wrapf(err, "failed to read extension file at %s", extensionPath) + } + extension := hcsschema.DeviceExtension{} + if err := json.Unmarshal(data, &extension); err != nil { + return nil, errors.Wrapf(err, "failed to unmarshal extension file at %s", extensionPath) + } + results.DeviceExtension = append(results.DeviceExtension, extension) + } + return results, nil +} + // handleAssignedDevicesWindows does all of the work to setup the hosting UVM, assign in devices // specified on the spec, and install any necessary, specified kernel drivers into the UVM. // @@ -91,18 +123,5 @@ func handleAssignedDevicesWindows(ctx context.Context, vm *uvm.UtilityVM, annota } } - // get the spec specified kernel drivers and install them on the UVM - drivers, err := getAssignedDeviceKernelDrivers(annotations) - if err != nil { - return nil, closers, err - } - for _, d := range drivers { - driverCloser, err := devices.InstallWindowsDriver(ctx, vm, d) - if err != nil { - return nil, closers, err - } - closers = append(closers, driverCloser) - } - return resultDevs, closers, nil } diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/hcsdoc_wcow.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/hcsdoc_wcow.go index 7423668dda..eb7019698f 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/hcsdoc_wcow.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/hcsdoc_wcow.go @@ -367,6 +367,13 @@ func createWindowsContainerDocument(ctx context.Context, coi *createOptionsInter return nil, nil, err } + // add any device extensions + extensions, err := getDeviceExtensions(coi.Spec.Annotations) + if err != nil { + return nil, nil, err + } + v2Container.AdditionalDeviceNamespace = extensions + return v1, v2Container, nil } @@ -383,7 +390,7 @@ func parseAssignedDevices(ctx context.Context, coi *createOptionsInternal, v2 *h switch d.IDType { case uvm.VPCILocationPathIDType: v2Dev.LocationPath = d.ID - v2Dev.Type = hcsschema.DeviceInstance + v2Dev.Type = hcsschema.DeviceInstanceID case uvm.VPCIClassGUIDTypeLegacy: v2Dev.InterfaceClassGuid = d.ID case uvm.VPCIClassGUIDType: diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/resources_wcow.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/resources_wcow.go index 7f3c67140b..83646dd0c1 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/resources_wcow.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/resources_wcow.go @@ -12,6 +12,7 @@ import ( "strings" "github.com/Microsoft/hcsshim/internal/credentials" + "github.com/Microsoft/hcsshim/internal/devices" "github.com/Microsoft/hcsshim/internal/layers" "github.com/Microsoft/hcsshim/internal/log" "github.com/Microsoft/hcsshim/internal/resources" @@ -102,6 +103,21 @@ func allocateWindowsResources(ctx context.Context, coi *createOptionsInternal, r coi.Spec.Windows.Devices = windowsDevices } + if coi.HostingSystem != nil { + // get the spec specified kernel drivers and install them on the UVM + drivers, err := getAssignedDeviceKernelDrivers(coi.Spec.Annotations) + if err != nil { + return err + } + for _, d := range drivers { + driverCloser, err := devices.InstallWindowsDriver(ctx, coi.HostingSystem, d) + if err != nil { + return err + } + r.Add(driverCloser) + } + } + return nil } diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnspolicy.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnspolicy.go index 6765aaead5..591a2631e4 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnspolicy.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnspolicy.go @@ -22,9 +22,9 @@ const ( type NatPolicy struct { Type PolicyType `json:"Type"` - Protocol string - InternalPort uint16 - ExternalPort uint16 + Protocol string `json:",omitempty"` + InternalPort uint16 `json:",omitempty"` + ExternalPort uint16 `json:",omitempty"` } type QosPolicy struct { @@ -88,20 +88,20 @@ const ( type ACLPolicy struct { Type PolicyType `json:"Type"` Id string `json:"Id,omitempty"` - Protocol uint16 - Protocols string `json:"Protocols,omitempty"` - InternalPort uint16 + Protocol uint16 `json:",omitempty"` + Protocols string `json:"Protocols,omitempty"` + InternalPort uint16 `json:",omitempty"` Action ActionType Direction DirectionType - LocalAddresses string - RemoteAddresses string - LocalPorts string `json:"LocalPorts,omitempty"` - LocalPort uint16 - RemotePorts string `json:"RemotePorts,omitempty"` - RemotePort uint16 - RuleType RuleType `json:"RuleType,omitempty"` - Priority uint16 - ServiceName string + LocalAddresses string `json:",omitempty"` + RemoteAddresses string `json:",omitempty"` + LocalPorts string `json:"LocalPorts,omitempty"` + LocalPort uint16 `json:",omitempty"` + RemotePorts string `json:"RemotePorts,omitempty"` + RemotePort uint16 `json:",omitempty"` + RuleType RuleType `json:"RuleType,omitempty"` + Priority uint16 `json:",omitempty"` + ServiceName string `json:",omitempty"` } type Policy struct { diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/oci/annotations.go b/test/vendor/github.com/Microsoft/hcsshim/internal/oci/annotations.go index 9ac11dcbcd..eb011c656a 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/oci/annotations.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/oci/annotations.go @@ -79,6 +79,10 @@ const ( // .inf, .cer, and/or other files used during standard installation with pnputil. AnnotationAssignedDeviceKernelDrivers = "io.microsoft.assigneddevice.kerneldrivers" + // AnnotationDeviceExtensions contains a comma separated list of full paths to device extension files. + // The content of these are added to a container's hcs create document. + AnnotationDeviceExtensions = "io.microsoft.container.wcow.deviceextensions" + // AnnotationHostProcessInheritUser indicates whether to ignore the username passed in to run a host process // container as and instead inherit the user token from the executable that is launching the container process. AnnotationHostProcessInheritUser = "microsoft.com/hostprocess-inherit-user" diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/oci/uvm.go b/test/vendor/github.com/Microsoft/hcsshim/internal/oci/uvm.go index 5b8c5e75c1..06715099f0 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/oci/uvm.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/oci/uvm.go @@ -36,6 +36,17 @@ func parseAnnotationsBool(ctx context.Context, a map[string]string, key string, return def } +// ParseAnnotationCommaSeparated searches `annotations` for `annotation` corresponding to a +// list of comma separated strings +func ParseAnnotationCommaSeparated(annotation string, annotations map[string]string) []string { + cs, ok := annotations[annotation] + if !ok || cs == "" { + return nil + } + results := strings.Split(cs, ",") + return results +} + // ParseAnnotationsCPUCount searches `s.Annotations` for the CPU annotation. If // not found searches `s` for the Windows CPU section. If neither are found // returns `def`. diff --git a/test/vendor/github.com/containerd/containerd/.mailmap b/test/vendor/github.com/containerd/containerd/.mailmap index 90c850eaa8..860654ac77 100644 --- a/test/vendor/github.com/containerd/containerd/.mailmap +++ b/test/vendor/github.com/containerd/containerd/.mailmap @@ -19,6 +19,7 @@ Cao Zhihao Cao Zhihao Carlos Eduardo chenxiaoyu +Cory Bennett Cristian Staretu Cristian Staretu Daniel Dao diff --git a/test/vendor/github.com/containerd/containerd/Vagrantfile b/test/vendor/github.com/containerd/containerd/Vagrantfile index 573b34c6f2..e2cceb2564 100644 --- a/test/vendor/github.com/containerd/containerd/Vagrantfile +++ b/test/vendor/github.com/containerd/containerd/Vagrantfile @@ -77,7 +77,7 @@ Vagrant.configure("2") do |config| config.vm.provision "install-golang", type: "shell", run: "once" do |sh| sh.upload_path = "/tmp/vagrant-install-golang" sh.env = { - 'GO_VERSION': ENV['GO_VERSION'] || "1.16.4", + 'GO_VERSION': ENV['GO_VERSION'] || "1.16.6", } sh.inline = <<~SHELL #!/usr/bin/env bash diff --git a/test/vendor/github.com/containerd/containerd/archive/tar.go b/test/vendor/github.com/containerd/containerd/archive/tar.go index 0fcfb65391..78a287317f 100644 --- a/test/vendor/github.com/containerd/containerd/archive/tar.go +++ b/test/vendor/github.com/containerd/containerd/archive/tar.go @@ -393,9 +393,8 @@ func createTarFile(ctx context.Context, path, extractDir string, hdr *tar.Header } } - // There is no LChmod, so ignore mode for symlink. Also, this - // must happen after chown, as that can modify the file mode - if err := handleLChmod(hdr, path, hdrInfo); err != nil { + // call lchmod after lchown since lchown can modify the file mode + if err := lchmod(path, hdrInfo.Mode()); err != nil { return err } diff --git a/test/vendor/github.com/containerd/containerd/archive/tar_freebsd.go b/test/vendor/github.com/containerd/containerd/archive/tar_freebsd.go index f484134df1..ce4dffd6dd 100644 --- a/test/vendor/github.com/containerd/containerd/archive/tar_freebsd.go +++ b/test/vendor/github.com/containerd/containerd/archive/tar_freebsd.go @@ -18,7 +18,11 @@ package archive -import "golang.org/x/sys/unix" +import ( + "os" + + "golang.org/x/sys/unix" +) // mknod wraps unix.Mknod. FreeBSD's unix.Mknod signature is different from // other Unix and Unix-like operating systems. @@ -34,3 +38,11 @@ func lsetxattrCreate(link string, attr string, data []byte) error { } return err } + +func lchmod(path string, mode os.FileMode) error { + err := unix.Fchmodat(unix.AT_FDCWD, path, uint32(mode), unix.AT_SYMLINK_NOFOLLOW) + if err != nil { + err = &os.PathError{Op: "lchmod", Path: path, Err: err} + } + return err +} diff --git a/test/vendor/github.com/containerd/containerd/archive/tar_mostunix.go b/test/vendor/github.com/containerd/containerd/archive/tar_mostunix.go index bd3f98a4a6..9cd1f0fa8f 100644 --- a/test/vendor/github.com/containerd/containerd/archive/tar_mostunix.go +++ b/test/vendor/github.com/containerd/containerd/archive/tar_mostunix.go @@ -18,7 +18,11 @@ package archive -import "golang.org/x/sys/unix" +import ( + "os" + + "golang.org/x/sys/unix" +) // mknod wraps Unix.Mknod and casts dev to int func mknod(path string, mode uint32, dev uint64) error { @@ -34,3 +38,18 @@ func lsetxattrCreate(link string, attr string, data []byte) error { } return err } + +// lchmod checks for symlink and changes the mode if not a symlink +func lchmod(path string, mode os.FileMode) error { + fi, err := os.Lstat(path) + if err != nil { + return err + } + + if fi.Mode()&os.ModeSymlink == 0 { + if err := os.Chmod(path, mode); err != nil { + return err + } + } + return nil +} diff --git a/test/vendor/github.com/containerd/containerd/archive/tar_unix.go b/test/vendor/github.com/containerd/containerd/archive/tar_unix.go index 896d11d401..cd2be74a08 100644 --- a/test/vendor/github.com/containerd/containerd/archive/tar_unix.go +++ b/test/vendor/github.com/containerd/containerd/archive/tar_unix.go @@ -111,21 +111,6 @@ func handleTarTypeBlockCharFifo(hdr *tar.Header, path string) error { return mknod(path, mode, unix.Mkdev(uint32(hdr.Devmajor), uint32(hdr.Devminor))) } -func handleLChmod(hdr *tar.Header, path string, hdrInfo os.FileInfo) error { - if hdr.Typeflag == tar.TypeLink { - if fi, err := os.Lstat(hdr.Linkname); err == nil && (fi.Mode()&os.ModeSymlink == 0) { - if err := os.Chmod(path, hdrInfo.Mode()); err != nil && !os.IsNotExist(err) { - return err - } - } - } else if hdr.Typeflag != tar.TypeSymlink { - if err := os.Chmod(path, hdrInfo.Mode()); err != nil { - return err - } - } - return nil -} - func getxattr(path, attr string) ([]byte, error) { b, err := sysx.LGetxattr(path, attr) if err == unix.ENOTSUP || err == sysx.ENODATA { diff --git a/test/vendor/github.com/containerd/containerd/archive/tar_windows.go b/test/vendor/github.com/containerd/containerd/archive/tar_windows.go index e30229f7eb..3184070ac5 100644 --- a/test/vendor/github.com/containerd/containerd/archive/tar_windows.go +++ b/test/vendor/github.com/containerd/containerd/archive/tar_windows.go @@ -98,7 +98,7 @@ func handleTarTypeBlockCharFifo(hdr *tar.Header, path string) error { return nil } -func handleLChmod(hdr *tar.Header, path string, hdrInfo os.FileInfo) error { +func lchmod(path string, mode os.FileMode) error { return nil } diff --git a/test/vendor/github.com/containerd/containerd/go.mod b/test/vendor/github.com/containerd/containerd/go.mod index fa38451212..c131b72c47 100644 --- a/test/vendor/github.com/containerd/containerd/go.mod +++ b/test/vendor/github.com/containerd/containerd/go.mod @@ -4,7 +4,7 @@ go 1.16 require ( github.com/Microsoft/go-winio v0.4.17 - github.com/Microsoft/hcsshim v0.8.16 + github.com/Microsoft/hcsshim v0.8.18 github.com/containerd/aufs v1.0.0 github.com/containerd/btrfs v1.0.0 github.com/containerd/cgroups v1.0.1 diff --git a/test/vendor/github.com/containerd/containerd/go.sum b/test/vendor/github.com/containerd/containerd/go.sum index 2cae0be392..221b0b3603 100644 --- a/test/vendor/github.com/containerd/containerd/go.sum +++ b/test/vendor/github.com/containerd/containerd/go.sum @@ -39,8 +39,9 @@ github.com/Microsoft/go-winio v0.4.17-0.20210324224401-5516f17a5958/go.mod h1:JP github.com/Microsoft/go-winio v0.4.17 h1:iT12IBVClFevaf8PuVyi3UmZOVh4OqnaLxDTW2O6j3w= github.com/Microsoft/go-winio v0.4.17/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/hcsshim v0.8.6/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= -github.com/Microsoft/hcsshim v0.8.16 h1:8/auA4LFIZFTGrqfKhGBSXwM6/4X1fHa/xniyEHu8ac= github.com/Microsoft/hcsshim v0.8.16/go.mod h1:o5/SZqmR7x9JNKsW3pu+nqHm0MF8vbA+VxGOoXdC600= +github.com/Microsoft/hcsshim v0.8.18 h1:cYnKADiM1869gvBpos3YCteeT6sZLB48lB5dmMMs8Tg= +github.com/Microsoft/hcsshim v0.8.18/go.mod h1:+w2gRZ5ReXQhFOrvSQeNfhrYB/dg3oDwTOcER2fw4I4= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= diff --git a/test/vendor/github.com/containerd/containerd/remotes/docker/auth/fetch.go b/test/vendor/github.com/containerd/containerd/remotes/docker/auth/fetch.go index 0d01c81ac5..8b0a87e755 100644 --- a/test/vendor/github.com/containerd/containerd/remotes/docker/auth/fetch.go +++ b/test/vendor/github.com/containerd/containerd/remotes/docker/auth/fetch.go @@ -26,6 +26,7 @@ import ( "github.com/containerd/containerd/log" remoteserrors "github.com/containerd/containerd/remotes/errors" + "github.com/containerd/containerd/version" "github.com/pkg/errors" "golang.org/x/net/context/ctxhttp" ) @@ -109,6 +110,9 @@ func FetchTokenWithOAuth(ctx context.Context, client *http.Client, headers http. for k, v := range headers { req.Header[k] = append(req.Header[k], v...) } + if len(req.Header.Get("User-Agent")) == 0 { + req.Header.Set("User-Agent", "containerd/"+version.Version) + } resp, err := ctxhttp.Do(ctx, client, req) if err != nil { @@ -153,6 +157,9 @@ func FetchToken(ctx context.Context, client *http.Client, headers http.Header, t for k, v := range headers { req.Header[k] = append(req.Header[k], v...) } + if len(req.Header.Get("User-Agent")) == 0 { + req.Header.Set("User-Agent", "containerd/"+version.Version) + } reqParams := req.URL.Query() diff --git a/test/vendor/github.com/containerd/containerd/remotes/docker/pusher.go b/test/vendor/github.com/containerd/containerd/remotes/docker/pusher.go index 8028d1421f..eae5a251d9 100644 --- a/test/vendor/github.com/containerd/containerd/remotes/docker/pusher.go +++ b/test/vendor/github.com/containerd/containerd/remotes/docker/pusher.go @@ -190,6 +190,7 @@ func (p dockerPusher) push(ctx context.Context, desc ocispec.Descriptor, ref str return nil, err } } + defer resp.Body.Close() switch resp.StatusCode { case http.StatusOK, http.StatusAccepted, http.StatusNoContent: @@ -382,6 +383,7 @@ func (pw *pushWriter) Commit(ctx context.Context, size int64, expected digest.Di if resp.err != nil { return resp.err } + defer resp.Response.Body.Close() // 201 is specified return status, some registries return // 200, 202 or 204. diff --git a/test/vendor/github.com/containerd/containerd/version/version.go b/test/vendor/github.com/containerd/containerd/version/version.go index aca0c4562d..4f8986230c 100644 --- a/test/vendor/github.com/containerd/containerd/version/version.go +++ b/test/vendor/github.com/containerd/containerd/version/version.go @@ -23,7 +23,7 @@ var ( Package = "github.com/containerd/containerd" // Version holds the complete version number. Filled in at linking time. - Version = "1.5.2+unknown" + Version = "1.5.4+unknown" // Revision is filled with the VCS (e.g. git) revision being used to build // the program at linking time. diff --git a/test/vendor/github.com/klauspost/compress/fse/README.md b/test/vendor/github.com/klauspost/compress/fse/README.md index 27d8ed56fc..ea7324da67 100644 --- a/test/vendor/github.com/klauspost/compress/fse/README.md +++ b/test/vendor/github.com/klauspost/compress/fse/README.md @@ -1,79 +1,79 @@ -# Finite State Entropy - -This package provides Finite State Entropy encoding and decoding. - -Finite State Entropy (also referenced as [tANS](https://en.wikipedia.org/wiki/Asymmetric_numeral_systems#tANS)) -encoding provides a fast near-optimal symbol encoding/decoding -for byte blocks as implemented in [zstandard](https://github.com/facebook/zstd). - -This can be used for compressing input with a lot of similar input values to the smallest number of bytes. -This does not perform any multi-byte [dictionary coding](https://en.wikipedia.org/wiki/Dictionary_coder) as LZ coders, -but it can be used as a secondary step to compressors (like Snappy) that does not do entropy encoding. - -* [Godoc documentation](https://godoc.org/github.com/klauspost/compress/fse) - -## News - - * Feb 2018: First implementation released. Consider this beta software for now. - -# Usage - -This package provides a low level interface that allows to compress single independent blocks. - -Each block is separate, and there is no built in integrity checks. -This means that the caller should keep track of block sizes and also do checksums if needed. - -Compressing a block is done via the [`Compress`](https://godoc.org/github.com/klauspost/compress/fse#Compress) function. -You must provide input and will receive the output and maybe an error. - -These error values can be returned: - -| Error | Description | -|---------------------|-----------------------------------------------------------------------------| -| `` | Everything ok, output is returned | -| `ErrIncompressible` | Returned when input is judged to be too hard to compress | -| `ErrUseRLE` | Returned from the compressor when the input is a single byte value repeated | -| `(error)` | An internal error occurred. | - -As can be seen above there are errors that will be returned even under normal operation so it is important to handle these. - -To reduce allocations you can provide a [`Scratch`](https://godoc.org/github.com/klauspost/compress/fse#Scratch) object -that can be re-used for successive calls. Both compression and decompression accepts a `Scratch` object, and the same -object can be used for both. - -Be aware, that when re-using a `Scratch` object that the *output* buffer is also re-used, so if you are still using this -you must set the `Out` field in the scratch to nil. The same buffer is used for compression and decompression output. - -Decompressing is done by calling the [`Decompress`](https://godoc.org/github.com/klauspost/compress/fse#Decompress) function. -You must provide the output from the compression stage, at exactly the size you got back. If you receive an error back -your input was likely corrupted. - -It is important to note that a successful decoding does *not* mean your output matches your original input. -There are no integrity checks, so relying on errors from the decompressor does not assure your data is valid. - -For more detailed usage, see examples in the [godoc documentation](https://godoc.org/github.com/klauspost/compress/fse#pkg-examples). - -# Performance - -A lot of factors are affecting speed. Block sizes and compressibility of the material are primary factors. -All compression functions are currently only running on the calling goroutine so only one core will be used per block. - -The compressor is significantly faster if symbols are kept as small as possible. The highest byte value of the input -is used to reduce some of the processing, so if all your input is above byte value 64 for instance, it may be -beneficial to transpose all your input values down by 64. - -With moderate block sizes around 64k speed are typically 200MB/s per core for compression and -around 300MB/s decompression speed. - -The same hardware typically does Huffman (deflate) encoding at 125MB/s and decompression at 100MB/s. - -# Plans - -At one point, more internals will be exposed to facilitate more "expert" usage of the components. - -A streaming interface is also likely to be implemented. Likely compatible with [FSE stream format](https://github.com/Cyan4973/FiniteStateEntropy/blob/dev/programs/fileio.c#L261). - -# Contributing - -Contributions are always welcome. Be aware that adding public functions will require good justification and breaking +# Finite State Entropy + +This package provides Finite State Entropy encoding and decoding. + +Finite State Entropy (also referenced as [tANS](https://en.wikipedia.org/wiki/Asymmetric_numeral_systems#tANS)) +encoding provides a fast near-optimal symbol encoding/decoding +for byte blocks as implemented in [zstandard](https://github.com/facebook/zstd). + +This can be used for compressing input with a lot of similar input values to the smallest number of bytes. +This does not perform any multi-byte [dictionary coding](https://en.wikipedia.org/wiki/Dictionary_coder) as LZ coders, +but it can be used as a secondary step to compressors (like Snappy) that does not do entropy encoding. + +* [Godoc documentation](https://godoc.org/github.com/klauspost/compress/fse) + +## News + + * Feb 2018: First implementation released. Consider this beta software for now. + +# Usage + +This package provides a low level interface that allows to compress single independent blocks. + +Each block is separate, and there is no built in integrity checks. +This means that the caller should keep track of block sizes and also do checksums if needed. + +Compressing a block is done via the [`Compress`](https://godoc.org/github.com/klauspost/compress/fse#Compress) function. +You must provide input and will receive the output and maybe an error. + +These error values can be returned: + +| Error | Description | +|---------------------|-----------------------------------------------------------------------------| +| `` | Everything ok, output is returned | +| `ErrIncompressible` | Returned when input is judged to be too hard to compress | +| `ErrUseRLE` | Returned from the compressor when the input is a single byte value repeated | +| `(error)` | An internal error occurred. | + +As can be seen above there are errors that will be returned even under normal operation so it is important to handle these. + +To reduce allocations you can provide a [`Scratch`](https://godoc.org/github.com/klauspost/compress/fse#Scratch) object +that can be re-used for successive calls. Both compression and decompression accepts a `Scratch` object, and the same +object can be used for both. + +Be aware, that when re-using a `Scratch` object that the *output* buffer is also re-used, so if you are still using this +you must set the `Out` field in the scratch to nil. The same buffer is used for compression and decompression output. + +Decompressing is done by calling the [`Decompress`](https://godoc.org/github.com/klauspost/compress/fse#Decompress) function. +You must provide the output from the compression stage, at exactly the size you got back. If you receive an error back +your input was likely corrupted. + +It is important to note that a successful decoding does *not* mean your output matches your original input. +There are no integrity checks, so relying on errors from the decompressor does not assure your data is valid. + +For more detailed usage, see examples in the [godoc documentation](https://godoc.org/github.com/klauspost/compress/fse#pkg-examples). + +# Performance + +A lot of factors are affecting speed. Block sizes and compressibility of the material are primary factors. +All compression functions are currently only running on the calling goroutine so only one core will be used per block. + +The compressor is significantly faster if symbols are kept as small as possible. The highest byte value of the input +is used to reduce some of the processing, so if all your input is above byte value 64 for instance, it may be +beneficial to transpose all your input values down by 64. + +With moderate block sizes around 64k speed are typically 200MB/s per core for compression and +around 300MB/s decompression speed. + +The same hardware typically does Huffman (deflate) encoding at 125MB/s and decompression at 100MB/s. + +# Plans + +At one point, more internals will be exposed to facilitate more "expert" usage of the components. + +A streaming interface is also likely to be implemented. Likely compatible with [FSE stream format](https://github.com/Cyan4973/FiniteStateEntropy/blob/dev/programs/fileio.c#L261). + +# Contributing + +Contributions are always welcome. Be aware that adding public functions will require good justification and breaking changes will likely not be accepted. If in doubt open an issue before writing the PR. \ No newline at end of file diff --git a/test/vendor/github.com/klauspost/compress/huff0/README.md b/test/vendor/github.com/klauspost/compress/huff0/README.md index 26d5101b36..8b6e5c6638 100644 --- a/test/vendor/github.com/klauspost/compress/huff0/README.md +++ b/test/vendor/github.com/klauspost/compress/huff0/README.md @@ -1,89 +1,89 @@ -# Huff0 entropy compression - -This package provides Huff0 encoding and decoding as used in zstd. - -[Huff0](https://github.com/Cyan4973/FiniteStateEntropy#new-generation-entropy-coders), -a Huffman codec designed for modern CPU, featuring OoO (Out of Order) operations on multiple ALU -(Arithmetic Logic Unit), achieving extremely fast compression and decompression speeds. - -This can be used for compressing input with a lot of similar input values to the smallest number of bytes. -This does not perform any multi-byte [dictionary coding](https://en.wikipedia.org/wiki/Dictionary_coder) as LZ coders, -but it can be used as a secondary step to compressors (like Snappy) that does not do entropy encoding. - -* [Godoc documentation](https://godoc.org/github.com/klauspost/compress/huff0) - -## News - -This is used as part of the [zstandard](https://github.com/klauspost/compress/tree/master/zstd#zstd) compression and decompression package. - -This ensures that most functionality is well tested. - -# Usage - -This package provides a low level interface that allows to compress single independent blocks. - -Each block is separate, and there is no built in integrity checks. -This means that the caller should keep track of block sizes and also do checksums if needed. - -Compressing a block is done via the [`Compress1X`](https://godoc.org/github.com/klauspost/compress/huff0#Compress1X) and -[`Compress4X`](https://godoc.org/github.com/klauspost/compress/huff0#Compress4X) functions. -You must provide input and will receive the output and maybe an error. - -These error values can be returned: - -| Error | Description | -|---------------------|-----------------------------------------------------------------------------| -| `` | Everything ok, output is returned | -| `ErrIncompressible` | Returned when input is judged to be too hard to compress | -| `ErrUseRLE` | Returned from the compressor when the input is a single byte value repeated | -| `ErrTooBig` | Returned if the input block exceeds the maximum allowed size (128 Kib) | -| `(error)` | An internal error occurred. | - - -As can be seen above some of there are errors that will be returned even under normal operation so it is important to handle these. - -To reduce allocations you can provide a [`Scratch`](https://godoc.org/github.com/klauspost/compress/huff0#Scratch) object -that can be re-used for successive calls. Both compression and decompression accepts a `Scratch` object, and the same -object can be used for both. - -Be aware, that when re-using a `Scratch` object that the *output* buffer is also re-used, so if you are still using this -you must set the `Out` field in the scratch to nil. The same buffer is used for compression and decompression output. - -The `Scratch` object will retain state that allows to re-use previous tables for encoding and decoding. - -## Tables and re-use - -Huff0 allows for reusing tables from the previous block to save space if that is expected to give better/faster results. - -The Scratch object allows you to set a [`ReusePolicy`](https://godoc.org/github.com/klauspost/compress/huff0#ReusePolicy) -that controls this behaviour. See the documentation for details. This can be altered between each block. - -Do however note that this information is *not* stored in the output block and it is up to the users of the package to -record whether [`ReadTable`](https://godoc.org/github.com/klauspost/compress/huff0#ReadTable) should be called, -based on the boolean reported back from the CompressXX call. - -If you want to store the table separate from the data, you can access them as `OutData` and `OutTable` on the -[`Scratch`](https://godoc.org/github.com/klauspost/compress/huff0#Scratch) object. - -## Decompressing - -The first part of decoding is to initialize the decoding table through [`ReadTable`](https://godoc.org/github.com/klauspost/compress/huff0#ReadTable). -This will initialize the decoding tables. -You can supply the complete block to `ReadTable` and it will return the data part of the block -which can be given to the decompressor. - -Decompressing is done by calling the [`Decompress1X`](https://godoc.org/github.com/klauspost/compress/huff0#Scratch.Decompress1X) -or [`Decompress4X`](https://godoc.org/github.com/klauspost/compress/huff0#Scratch.Decompress4X) function. - -For concurrently decompressing content with a fixed table a stateless [`Decoder`](https://godoc.org/github.com/klauspost/compress/huff0#Decoder) can be requested which will remain correct as long as the scratch is unchanged. The capacity of the provided slice indicates the expected output size. - -You must provide the output from the compression stage, at exactly the size you got back. If you receive an error back -your input was likely corrupted. - -It is important to note that a successful decoding does *not* mean your output matches your original input. -There are no integrity checks, so relying on errors from the decompressor does not assure your data is valid. - -# Contributing - -Contributions are always welcome. Be aware that adding public functions will require good justification and breaking -changes will likely not be accepted. If in doubt open an issue before writing the PR. +# Huff0 entropy compression + +This package provides Huff0 encoding and decoding as used in zstd. + +[Huff0](https://github.com/Cyan4973/FiniteStateEntropy#new-generation-entropy-coders), +a Huffman codec designed for modern CPU, featuring OoO (Out of Order) operations on multiple ALU +(Arithmetic Logic Unit), achieving extremely fast compression and decompression speeds. + +This can be used for compressing input with a lot of similar input values to the smallest number of bytes. +This does not perform any multi-byte [dictionary coding](https://en.wikipedia.org/wiki/Dictionary_coder) as LZ coders, +but it can be used as a secondary step to compressors (like Snappy) that does not do entropy encoding. + +* [Godoc documentation](https://godoc.org/github.com/klauspost/compress/huff0) + +## News + +This is used as part of the [zstandard](https://github.com/klauspost/compress/tree/master/zstd#zstd) compression and decompression package. + +This ensures that most functionality is well tested. + +# Usage + +This package provides a low level interface that allows to compress single independent blocks. + +Each block is separate, and there is no built in integrity checks. +This means that the caller should keep track of block sizes and also do checksums if needed. + +Compressing a block is done via the [`Compress1X`](https://godoc.org/github.com/klauspost/compress/huff0#Compress1X) and +[`Compress4X`](https://godoc.org/github.com/klauspost/compress/huff0#Compress4X) functions. +You must provide input and will receive the output and maybe an error. + +These error values can be returned: + +| Error | Description | +|---------------------|-----------------------------------------------------------------------------| +| `` | Everything ok, output is returned | +| `ErrIncompressible` | Returned when input is judged to be too hard to compress | +| `ErrUseRLE` | Returned from the compressor when the input is a single byte value repeated | +| `ErrTooBig` | Returned if the input block exceeds the maximum allowed size (128 Kib) | +| `(error)` | An internal error occurred. | + + +As can be seen above some of there are errors that will be returned even under normal operation so it is important to handle these. + +To reduce allocations you can provide a [`Scratch`](https://godoc.org/github.com/klauspost/compress/huff0#Scratch) object +that can be re-used for successive calls. Both compression and decompression accepts a `Scratch` object, and the same +object can be used for both. + +Be aware, that when re-using a `Scratch` object that the *output* buffer is also re-used, so if you are still using this +you must set the `Out` field in the scratch to nil. The same buffer is used for compression and decompression output. + +The `Scratch` object will retain state that allows to re-use previous tables for encoding and decoding. + +## Tables and re-use + +Huff0 allows for reusing tables from the previous block to save space if that is expected to give better/faster results. + +The Scratch object allows you to set a [`ReusePolicy`](https://godoc.org/github.com/klauspost/compress/huff0#ReusePolicy) +that controls this behaviour. See the documentation for details. This can be altered between each block. + +Do however note that this information is *not* stored in the output block and it is up to the users of the package to +record whether [`ReadTable`](https://godoc.org/github.com/klauspost/compress/huff0#ReadTable) should be called, +based on the boolean reported back from the CompressXX call. + +If you want to store the table separate from the data, you can access them as `OutData` and `OutTable` on the +[`Scratch`](https://godoc.org/github.com/klauspost/compress/huff0#Scratch) object. + +## Decompressing + +The first part of decoding is to initialize the decoding table through [`ReadTable`](https://godoc.org/github.com/klauspost/compress/huff0#ReadTable). +This will initialize the decoding tables. +You can supply the complete block to `ReadTable` and it will return the data part of the block +which can be given to the decompressor. + +Decompressing is done by calling the [`Decompress1X`](https://godoc.org/github.com/klauspost/compress/huff0#Scratch.Decompress1X) +or [`Decompress4X`](https://godoc.org/github.com/klauspost/compress/huff0#Scratch.Decompress4X) function. + +For concurrently decompressing content with a fixed table a stateless [`Decoder`](https://godoc.org/github.com/klauspost/compress/huff0#Decoder) can be requested which will remain correct as long as the scratch is unchanged. The capacity of the provided slice indicates the expected output size. + +You must provide the output from the compression stage, at exactly the size you got back. If you receive an error back +your input was likely corrupted. + +It is important to note that a successful decoding does *not* mean your output matches your original input. +There are no integrity checks, so relying on errors from the decompressor does not assure your data is valid. + +# Contributing + +Contributions are always welcome. Be aware that adding public functions will require good justification and breaking +changes will likely not be accepted. If in doubt open an issue before writing the PR. diff --git a/test/vendor/modules.txt b/test/vendor/modules.txt index 1346ab93cd..e8d8249a91 100644 --- a/test/vendor/modules.txt +++ b/test/vendor/modules.txt @@ -6,7 +6,7 @@ github.com/Microsoft/go-winio/pkg/guid github.com/Microsoft/go-winio/pkg/process github.com/Microsoft/go-winio/pkg/security github.com/Microsoft/go-winio/vhd -# github.com/Microsoft/hcsshim v0.8.16 => ../ +# github.com/Microsoft/hcsshim v0.8.18 => ../ ## explicit github.com/Microsoft/hcsshim github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options @@ -72,7 +72,7 @@ github.com/blang/semver github.com/containerd/cgroups/stats/v1 # github.com/containerd/console v1.0.2 github.com/containerd/console -# github.com/containerd/containerd v1.5.2 +# github.com/containerd/containerd v1.5.4 ## explicit github.com/containerd/containerd github.com/containerd/containerd/api/events