Skip to content

Commit

Permalink
Merged PR 8229246: update ado hcsshim to b8cf9e7
Browse files Browse the repository at this point in the history
Related work items: #1755, #1799, #1800, #1802, #1804
  • Loading branch information
ambarve committed Jun 6, 2023
2 parents dcb60ea + b8cf9e7 commit 89698c4
Show file tree
Hide file tree
Showing 44 changed files with 23,364 additions and 56 deletions.
95 changes: 58 additions & 37 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ env:
GOTESTSUM_VERSION: "latest"

jobs:

lint:
runs-on: "windows-2022"
strategy:
Expand All @@ -25,15 +26,18 @@ jobs:
./internal/tools/...
./pkg/...
./ext4/...
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
- name: Checkout
uses: actions/checkout@v3

- name: Install go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Clean mod cache
shell: Powershell
run: |
go clean -modcache
# sometimes go cache causes issues with lint
cache: false

- uses: golangci/golangci-lint-action@v3
with:
version: v1.52
Expand All @@ -42,6 +46,7 @@ jobs:
--max-issues-per-linter=0
--max-same-issues=0
--modules-download-mode=readonly
--timeout=10m
${{ matrix.dirs }}
working-directory: ${{ matrix.root }}
env:
Expand All @@ -55,14 +60,16 @@ jobs:
GOPATH: '${{ github.workspace }}\go'

steps:
- uses: actions/setup-go@v4
- name: Checkout hcsshim
uses: actions/checkout@v3
with:
go-version: ${{ env.GO_VERSION }}
path: go/src/github.com/Microsoft/hcsshim

- uses: actions/checkout@v3
- name: Install go
uses: actions/setup-go@v4
with:
path: "go/src/github.com/Microsoft/hcsshim"
name: Checkout hcsshim
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: go/src/github.com/Microsoft/hcsshim/go.sum

- name: Get containerd ref
shell: powershell
Expand All @@ -77,12 +84,12 @@ jobs:
"containerd_ref=$v" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
working-directory: go/src/github.com/Microsoft/hcsshim

- uses: actions/checkout@v3
- name: Checkout containerd
uses: actions/checkout@v3
with:
repository: containerd/containerd
path: "containerd"
ref: "${{ env.containerd_ref }}"
name: Checkout containerd

- name: Install protobuild and protoc-gen-gogoctrd
shell: powershell
Expand Down Expand Up @@ -143,9 +150,11 @@ jobs:
env:
GOPROXY: "https://proxy.golang.org,direct"
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3

- uses: actions/setup-go@v4
- name: Install go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

Expand Down Expand Up @@ -181,10 +190,14 @@ jobs:
name: Go Generate
runs-on: "windows-2022"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
- name: Checkout
uses: actions/checkout@v3

- name: Install go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

- name: Validate go generate
shell: powershell
run: |
Expand Down Expand Up @@ -243,8 +256,11 @@ jobs:
matrix:
os: [windows-2019, windows-2022]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
- name: Checkout
uses: actions/checkout@v3

- name: Install go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

Expand Down Expand Up @@ -304,10 +320,17 @@ jobs:
os: [windows-2019, windows-2022]

steps:
- uses: actions/setup-go@v4
- name: Checkout hcsshim
uses: actions/checkout@v3
with:
path: src/github.com/Microsoft/hcsshim

- name: Install go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache-dependency-path: src/github.com/Microsoft/hcsshim/go.sum

- name: Set env
shell: bash
Expand All @@ -317,11 +340,6 @@ jobs:
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
echo "${{ github.workspace }}/src/github.com/containerd/containerd/bin" >> $GITHUB_PATH
- uses: actions/checkout@v3
with:
path: src/github.com/Microsoft/hcsshim
name: Checkout hcsshim

- name: Get containerd ref
shell: powershell
run: |
Expand Down Expand Up @@ -355,21 +373,18 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# needs to be a separate step since terminal reload is required to bring in new env variables and PATH
- name: Upgrade Chocolaty
shell: powershell
run: |
choco upgrade -y chocolatey 2>&1
- name: Install mingw
shell: powershell
run: |
$VerbosePreference = 'Continue'
# dont set $ErrorActionPreference since we want to allow choco install to fail later on
Write-Output '::group::Update chocolaty'
choco upgrade -y chocolatey
Write-Output '::endgroup::'
if ( $LASTEXITCODE ) {
Write-Output '::error::Could not update chocolatey.'
exit $LASTEXITCODE
}
Write-Output 'Install mingw'
# Install sometimes fails when downloading mingw zip from source-forge with:
# "ERROR: The remote file either doesn't exist, is unauthorized, or is forbidden for url"
Expand All @@ -386,7 +401,7 @@ jobs:
Sleep -Seconds 60
}
choco install -y --no-progress --stop-on-first-failure --force mingw --allow-downgrade --version 10.2.0
choco install -y --no-progress --stop-on-first-failure --force mingw --allow-downgrade --version 10.3.0
Write-Output '::endgroup::'
if ( -not $LASTEXITCODE ) {
Write-Output "Attempt $i succeeded (exit code: $LASTEXITCODE)"
Expand All @@ -400,6 +415,9 @@ jobs:
exit $LASTEXITCODE
}
# verify mingw32-make was installed
Get-Command -CommandType Application -ErrorAction Stop mingw32-make.exe
- name: Build binaries
shell: bash
working-directory: src/github.com/containerd/containerd
Expand Down Expand Up @@ -500,8 +518,11 @@ jobs:
needs: [test-windows, test-linux]
runs-on: "windows-2022"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
- name: Checkout
uses: actions/checkout@v3

- name: Install go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ require (
github.com/opencontainers/runtime-spec v1.1.0-rc.2
github.com/pelletier/go-toml v1.9.5
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.9.2
github.com/sirupsen/logrus v1.9.3
github.com/urfave/cli v1.22.13
github.com/veraison/go-cose v1.0.0-rc.1
github.com/vishvananda/netlink v1.2.1-beta.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -890,8 +890,8 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/sirupsen/logrus v1.9.2 h1:oxx1eChJGI6Uks2ZC4W1zpLlVgqB8ner4EuQwV4Ik1Y=
github.com/sirupsen/logrus v1.9.2/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
Expand Down
6 changes: 2 additions & 4 deletions internal/computeagent/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
//
// A mock service under `mock` is used for unit testing the various services
// used for ncproxy.
//
// The mock service is compiled using the following command:
//
// mockgen -source="computeagent.pb.go" -package="computeagent_mock" > mock\computeagent_mock.pb.go
package computeagent

//go:generate go run github.com/golang/mock/mockgen -source=computeagent.pb.go -package=computeagent_mock -destination=mock\computeagent_mock.pb.go
7 changes: 2 additions & 5 deletions pkg/ncproxy/nodenetsvc/v1/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
//
// A mock service under `mock` is used for unit testing the various services
// used for ncproxy.
//
// The mock service is compiled using the following command:
//
// mockgen -source="nodenetsvc.pb.go" -package="nodenetsvc_mock" > mock\nodenetsvc_mock.pb.go

package v1

//go:generate go run github.com/golang/mock/mockgen -source=nodenetsvc.pb.go -package=nodenetsvc_v1_mock -destination=mock\nodenetsvc_mock.pb.go
2 changes: 1 addition & 1 deletion test/cri-containerd/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const (
alpineAspnetUpgrade = "mcr.microsoft.com/dotnet/core/aspnet:3.1.2-alpine3.11"

imageWindowsProcessDump = "cplatpublic.azurecr.io/crashdump:latest"
imageWindowsArgsEscaped = "cplatpublic.azurecr.io/args-escaped-test-image-ns:latest"
imageWindowsArgsEscaped = "cplatpublic.azurecr.io/argsescaped:latest"
imageWindowsTimezone = "cplatpublic.azurecr.io/timezone:latest"

imageJobContainerHNS = "cplatpublic.azurecr.io/jobcontainer_hns:latest"
Expand Down
3 changes: 2 additions & 1 deletion test/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require (
github.com/opencontainers/runtime-spec v1.1.0-rc.2
github.com/opencontainers/runtime-tools v0.9.0
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.9.2
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.8.2
go.opencensus.io v0.24.0
golang.org/x/sync v0.2.0
Expand Down Expand Up @@ -52,6 +52,7 @@ require (
github.com/godbus/dbus/v5 v5.0.6 // indirect
github.com/gogo/googleapis v1.4.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
Expand Down
5 changes: 3 additions & 2 deletions test/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8=
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
Expand Down Expand Up @@ -960,8 +961,8 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/sirupsen/logrus v1.9.2 h1:oxx1eChJGI6Uks2ZC4W1zpLlVgqB8ner4EuQwV4Ik1Y=
github.com/sirupsen/logrus v1.9.2/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
Expand Down
10 changes: 9 additions & 1 deletion tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,12 @@

package hcsshim

import _ "github.com/Microsoft/go-winio/tools/mkwinsyscall"
import (
// for go generate directives

// generate Win32 API code
_ "github.com/Microsoft/go-winio/tools/mkwinsyscall"

// mock gRPC client and servers
_ "github.com/golang/mock/mockgen"
)
Loading

0 comments on commit 89698c4

Please sign in to comment.