Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 25 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
- pull_request

env:
GO_BUILD_CMD: 'go build "-ldflags=-s -w" -trimpath'
GO_BUILD_TEST_CMD: "go test -mod=mod -gcflags=all=-d=checkptr -c -tags functional"
GO_BUILD_CMD: 'go build "-ldflags=-s -w -linkmode=external" -trimpath'
GO_BUILD_TEST_CMD: 'go test -mod=mod "-ldflags=-linkmode=external" -gcflags=all=-d=checkptr -c -tags functional'

GOTESTSUM_VERSION: "latest"

Expand Down Expand Up @@ -319,21 +319,28 @@ jobs:
# accept the eula
& '${{ github.workspace }}/bin/psexec' -accepteula -nobanner cmd /c "exit 0"

- name: Generate Resource Object Files
shell: pwsh
run: |
go generate -x ./cmd/...
cd test
go generate -x ./...

# run tests
- name: Test rego security policy
run: ${{ env.GOTESTSUM_CMD }} -tags=rego -timeout=30m -gcflags=all=-d=checkptr ./pkg/securitypolicy/...
run: ${{ env.GOTESTSUM_CMD }} -ldflags=-linkmode=external -gcflags=all=-d=checkptr -tags=rego -timeout=30m ./pkg/securitypolicy/...

- name: Test repo
run: ${{ env.GOTESTSUM_CMD }} -gcflags=all=-d=checkptr -tags admin -timeout=20m ./...
run: ${{ env.GOTESTSUM_CMD }} -ldflags=-linkmode=external -gcflags=all=-d=checkptr -tags=admin -timeout=20m ./...

- name: Test lcow tagged packages (shimV2)
run: ${{ env.GOTESTSUM_CMD }} -gcflags=all=-d=checkptr -tags lcow -timeout=10m ./...
run: ${{ env.GOTESTSUM_CMD }} -ldflags=-linkmode=external -gcflags=all=-d=checkptr -tags=lcow -timeout=10m ./...

- name: Test wcow tagged packages (shimV2)
run: ${{ env.GOTESTSUM_CMD }} -gcflags=all=-d=checkptr -tags wcow -timeout=10m ./...
run: ${{ env.GOTESTSUM_CMD }} -ldflags=-linkmode=external -gcflags=all=-d=checkptr -tags=wcow -timeout=10m ./...

- name: Run non-functional tests
run: ${{ env.GOTESTSUM_CMD }} -mod=mod -gcflags=all=-d=checkptr ./internal/... ./pkg/... ./parity/...
run: ${{ env.GOTESTSUM_CMD }} -ldflags=-linkmode=external -gcflags=all=-d=checkptr -mod=mod -timeout=10m ./internal/... ./pkg/... ./parity/...
working-directory: test

- name: Build and run containerd-shim-runhcs-v1 tests
Expand Down Expand Up @@ -537,8 +544,10 @@ jobs:

- name: Build the shim
working-directory: src/github.com/Microsoft/hcsshim
shell: powershell
shell: pwsh
run: |
go generate -x ./cmd/containerd-shim-runhcs-v1

${{ env.GO_BUILD_CMD }} -mod vendor -o "${{ github.workspace }}/src/github.com/containerd/containerd/bin/containerd-shim-runhcs-v1.exe" .\cmd\containerd-shim-runhcs-v1

- name: Install gotestsum
Expand Down Expand Up @@ -655,6 +664,13 @@ jobs:
$LASTEXITCODE = 0
}

- name: Generate Resource Object Files
shell: pwsh
run: |
go generate -x ./cmd/...
cd test
go generate -x ./...

- run: ${{ env.GO_BUILD_CMD }} -tags lcow ./...
name: Build lcow tagged packages (shimV2)
- run: ${{ env.GO_BUILD_CMD }} -tags wcow ./...
Expand Down Expand Up @@ -693,7 +709,7 @@ jobs:
name: Build rootfs.exe
- run: ${{ env.GO_BUILD_CMD }} ./internal/tools/securitypolicy
name: Build securitypolicy.exe
- run: ${{ env.GO_BUILD_CMD }} ./internal/tools/securitypolicy
- run: go build "-ldflags=-s -w" -trimpath ./internal/tools/securitypolicy
name: Build securitypolicy
env:
GOOS: linux
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
*.so
*.dylib

# manifest related generated files
*.syso
Comment thread
helsaawy marked this conversation as resolved.
manifest.xml
*.exe.manifest

# Ignore vscode setting files
.vscode/
.idea/
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion cmd/containerd-shim-lcow-v2/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
)

// Add a manifest to get proper Windows version detection.
//go:generate go tool github.com/josephspurrier/goversioninfo/cmd/goversioninfo -platform-specific
//go:generate pwsh -Command "../../scripts/New-ResourceObjectFile.ps1 -ErrorAction 'Stop' -Destination '.' -Name 'containerd-shim-lcow-v2' -UseVersionFile -Architecture 'all'"

func main() {
logrus.AddHook(log.NewHook())
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
44 changes: 0 additions & 44 deletions cmd/containerd-shim-lcow-v2/versioninfo.json

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion cmd/containerd-shim-runhcs-v1/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const usage = ``
const ttrpcAddressEnv = "TTRPC_ADDRESS"

// Add a manifest to get proper Windows version detection.
//go:generate go tool github.com/josephspurrier/goversioninfo/cmd/goversioninfo -platform-specific
//go:generate pwsh -Command "../../scripts/New-ResourceObjectFile.ps1 -ErrorAction 'Stop' -Destination '.' -Name 'containerd-shim-runhcs-v1' -UseVersionFile -Architecture 'all'"

// `-ldflags '-X ...'` only works if the variable is uninitialized or set to a constant value.
// keep empty and override with data from [internal/version] only if empty to allow
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
43 changes: 0 additions & 43 deletions cmd/containerd-shim-runhcs-v1/versioninfo.json

This file was deleted.

2 changes: 2 additions & 0 deletions cmd/ncproxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
"github.com/sirupsen/logrus"
)

//go:generate pwsh -Command "../../scripts/New-ResourceObjectFile.ps1 -ErrorAction 'Stop' -Destination '.' -Name 'ncproxy' -UseVersionFile -Architecture 'all'"

func main() {
if err := app().Run(os.Args); err != nil {
logrus.Fatal(err)
Expand Down
10 changes: 0 additions & 10 deletions cmd/ncproxy/ncproxy.exe.manifest

This file was deleted.

Binary file removed cmd/ncproxy/resource_windows_386.syso
Binary file not shown.
Binary file removed cmd/ncproxy/resource_windows_amd64.syso
Binary file not shown.
43 changes: 0 additions & 43 deletions cmd/ncproxy/versioninfo.json

This file was deleted.

2 changes: 1 addition & 1 deletion cmd/runhcs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
)

// Add a manifest to get proper Windows version detection.
//go:generate go tool github.com/josephspurrier/goversioninfo/cmd/goversioninfo -platform-specific
//go:generate pwsh -Command "../../scripts/New-ResourceObjectFile.ps1 -ErrorAction 'Stop' -Destination '.' -Name 'runhcs' -UseVersionFile -Architecture 'all'"

// `-ldflags '-X ...'` only works if the variable is uninitialized or set to a constant value.
// keep empty and override with data from [internal/version] only if empty to allow
Expand Down
Binary file removed cmd/runhcs/resource_windows_386.syso
Binary file not shown.
Binary file removed cmd/runhcs/resource_windows_amd64.syso
Binary file not shown.
Binary file removed cmd/runhcs/resource_windows_arm.syso
Binary file not shown.
Binary file removed cmd/runhcs/resource_windows_arm64.syso
Binary file not shown.
10 changes: 0 additions & 10 deletions cmd/runhcs/runhcs.exe.manifest

This file was deleted.

43 changes: 0 additions & 43 deletions cmd/runhcs/versioninfo.json

This file was deleted.

Binary file removed cmd/wclayer/resource_windows_386.syso
Binary file not shown.
Binary file removed cmd/wclayer/resource_windows_amd64.syso
Binary file not shown.
Binary file removed cmd/wclayer/resource_windows_arm.syso
Binary file not shown.
Binary file removed cmd/wclayer/resource_windows_arm64.syso
Binary file not shown.
Loading
Loading