Skip to content

Commit

Permalink
fix(umoci)!: umoci's copy buffer set to 1 MiB
Browse files Browse the repository at this point in the history
project-stacker/umoci@89a7ea1

Use updated umoci (project-stacker's fork) to use a 1 MiB copy buffer.
This change brings stacker inline with compression parameters used in
containers/image libraries and makes them compatible.

test(gzip): add unit tests for gzip

(cherry picked from commit 589a648)

Signed-off-by: Scott Moser <[email protected]>
  • Loading branch information
rchincha authored and smoser committed Nov 8, 2023
1 parent 431b1be commit 6aa9d6b
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 46 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -yy lxc-utils lxc-dev libacl1-dev jq libcap-dev libseccomp-dev libpam-dev bats parallel libzstd-dev
# skopeo deps
sudo apt-get install -yy \
libgpgme-dev \
libassuan-dev \
libbtrfs-dev \
libdevmapper-dev \
pkg-config
GO111MODULE=off go get github.com/opencontainers/umoci/cmd/umoci
sudo cp ~/go/bin/umoci /usr/bin
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
Expand Down
18 changes: 17 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ GO_SRC=$(shell find . -path ./.build -prune -false -o -name \*.go)
VERSION?=$(shell git describe --tags || git rev-parse HEAD)
VERSION_FULL?=$(if $(shell git status --porcelain --untracked-files=no),$(VERSION)-dirty,$(VERSION))

export SKOPEO = $(TOOLS_D)/bin/skopeo
export SKOPEO_VERSION = 1.9.3

LXC_VERSION?=$(shell pkg-config --modversion lxc)

BUILD_TAGS = exclude_graphdriver_btrfs exclude_graphdriver_devicemapper containers_image_openpgp osusergo netgo
Expand Down Expand Up @@ -44,13 +47,26 @@ lint: cmd/stacker/lxc-wrapper/lxc-wrapper $(GO_SRC)
go test -tags "$(BUILD_TAGS)" ./...
$(shell go env GOPATH)/bin/golangci-lint run --build-tags "$(BUILD_TAGS)"

$(SKOPEO):
@mkdir -p "$(TOOLS_D)/bin"; \
tmpdir=$$(mktemp -d); \
cd $$tmpdir; \
git clone https://github.com/containers/skopeo.git; \
cd skopeo; \
git fetch --all --tags --prune; \
git checkout tags/v$(SKOPEO_VERSION) -b tag-$(SKOPEO_VERSION); \
make bin/skopeo; \
cp bin/skopeo $(SKOPEO); \
cd $(TOP_LEVEL); \
rm -rf $$tmpdir;

TEST?=$(patsubst test/%.bats,%,$(wildcard test/*.bats))
PRIVILEGE_LEVEL?=

# make check TEST=basic will run only the basic test
# make check PRIVILEGE_LEVEL=unpriv will run only unprivileged tests
.PHONY: check
check: stacker lint
check: stacker lint $(SKOPEO)
sudo -E PATH="$$PATH" \
LXC_BRANCH=$(LXC_BRANCH) \
LXC_CLONE_URL=$(LXC_CLONE_URL) \
Expand Down
29 changes: 16 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,25 @@ require (
github.com/pkg/errors v0.9.1
github.com/pkg/xattr v0.4.9
github.com/smartystreets/goconvey v1.7.2
github.com/stretchr/testify v1.8.1
github.com/stretchr/testify v1.8.4
github.com/twmb/algoimpl v0.0.0-20170717182524-076353e90b94
github.com/udhos/equalfile v0.3.0
github.com/urfave/cli v1.22.10
github.com/vbatts/go-mtree v0.5.2
github.com/urfave/cli v1.22.12
github.com/vbatts/go-mtree v0.5.3
golang.org/x/sys v0.14.0
golang.org/x/term v0.3.0
golang.org/x/term v0.7.0
gopkg.in/yaml.v2 v2.4.0
)

require (
github.com/AdaLogics/go-fuzz-headers v0.0.0-20211102141018-f7be0cbad29c // indirect
github.com/BurntSushi/toml v0.4.1 // indirect
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230106234847-43070de90fa1 // indirect
github.com/BurntSushi/toml v1.2.1 // indirect
github.com/Microsoft/go-winio v0.5.2 // indirect
github.com/Microsoft/hcsshim v0.9.2 // indirect
github.com/VividCortex/ewma v1.2.0 // indirect
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/containerd/cgroups v1.0.3 // indirect
github.com/containerd/containerd v1.6.1 // indirect
Expand All @@ -56,7 +57,7 @@ require (
github.com/docker/docker-credential-helpers v0.6.4 // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-metrics v0.0.1 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/flosch/pongo2 v0.0.0-20200913210552-0d938eb266f3 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
Expand Down Expand Up @@ -86,7 +87,7 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mtrmac/gpgme v0.1.2 // indirect
github.com/opencontainers/runc v1.1.2 // indirect
github.com/opencontainers/runc v1.1.8 // indirect
github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 // indirect
github.com/opencontainers/selinux v1.10.0 // indirect
github.com/pborman/uuid v1.2.1 // indirect
Expand All @@ -96,7 +97,7 @@ require (
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/rootless-containers/proto/go-proto v0.0.0-20210921234734-69430b6543fb // indirect
github.com/rootless-containers/proto/go-proto v0.0.0-20230421021042-4cd87ebadd67 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/smartystreets/assertions v1.2.0 // indirect
Expand All @@ -109,16 +110,18 @@ require (
go.etcd.io/bbolt v1.3.6 // indirect
go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352 // indirect
go.opencensus.io v0.23.0 // indirect
golang.org/x/crypto v0.3.0 // indirect
golang.org/x/net v0.2.0 // indirect
golang.org/x/crypto v0.8.0 // indirect
golang.org/x/net v0.9.0 // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
golang.org/x/text v0.4.0 // indirect
golang.org/x/text v0.9.0 // indirect
google.golang.org/genproto v0.0.0-20220303160752-862486edd9cc // indirect
google.golang.org/grpc v1.44.0 // indirect
google.golang.org/protobuf v1.28.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/robfig/cron.v2 v2.0.0-20150107220207-be2e0b0deed5 // indirect
gopkg.in/square/go-jose.v2 v2.5.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/containers/image/v5 => github.com/anuvu/image/v5 v5.0.0-20211117201351-4c24aa76235c

replace github.com/opencontainers/umoci => github.com/project-stacker/umoci v0.0.0-20231025233220-c7bb24d57e98
Loading

0 comments on commit 6aa9d6b

Please sign in to comment.