Skip to content

Commit

Permalink
updated CI to work with a forked version of containerd
Browse files Browse the repository at this point in the history
Signed-off-by: Robbie Buxton <138501839+rbpdt@users.noreply.github.com>
  • Loading branch information
rbpdt committed Aug 11, 2023
1 parent 9e9e7a5 commit 209aaf5
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 27 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Tests
on:
push:
branches:
- main
- v1.7.2-stargz
pull_request:

env:
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
strategy:
fail-fast: false
matrix:
buildargs: ["", "--build-arg=CONTAINERD_VERSION=main"] # released version & main version
buildargs: ["", "--build-arg=CONTAINERD_VERSION=v1.7.2-stargz"] # released version & v1.7.2-stargz version
builtin: ["true", "false"]
metadata-store: ["memory", "db"]
exclude:
Expand All @@ -61,7 +61,7 @@ jobs:
- metadata-store: "db"
builtin: "true"
- metadata-store: "db"
buildargs: "--build-arg=CONTAINERD_VERSION=main"
buildargs: "--build-arg=CONTAINERD_VERSION=v1.7.2-stargz"
steps:
- name: Install htpasswd for setting up private registry
run: sudo apt-get update -y && sudo apt-get --no-install-recommends install -y apache2-utils
Expand All @@ -79,7 +79,7 @@ jobs:
strategy:
fail-fast: false
matrix:
buildargs: ["", "--build-arg=CONTAINERD_VERSION=main"] # released version & main version
buildargs: ["", "--build-arg=CONTAINERD_VERSION=v1.7.2-stargz"] # released version & v1.7.2-stargz version
steps:
- name: Install htpasswd for setting up private registry
run: sudo apt-get update -y && sudo apt-get --no-install-recommends install -y apache2-utils
Expand All @@ -95,7 +95,7 @@ jobs:
strategy:
fail-fast: false
matrix:
buildargs: ["", "--build-arg=CONTAINERD_VERSION=main"] # released version & main version
buildargs: ["", "--build-arg=CONTAINERD_VERSION=v1.7.2-stargz"] # released version & v1.7.2-stargz version
builtin: ["true", "false"]
exclude:
- buildargs: ""
Expand All @@ -116,7 +116,7 @@ jobs:
strategy:
fail-fast: false
matrix:
buildargs: ["", "--build-arg=CONTAINERD_VERSION=main"] # released version & main version
buildargs: ["", "--build-arg=CONTAINERD_VERSION=v1.7.2-stargz"] # released version & v1.7.2-stargz version
builtin: ["true", "false"]
exclude:
- buildargs: ""
Expand All @@ -137,7 +137,7 @@ jobs:
strategy:
fail-fast: false
matrix:
buildargs: ["", "--build-arg=CONTAINERD_VERSION=main"] # released version & main version
buildargs: ["", "--build-arg=CONTAINERD_VERSION=v1.7.2-stargz"] # released version & v1.7.2-stargz version
builtin: ["true", "false"]
metadata-store: ["memory", "db"]
exclude:
Expand All @@ -146,7 +146,7 @@ jobs:
- metadata-store: "db"
builtin: "true"
- metadata-store: "db"
buildargs: "--build-arg=CONTAINERD_VERSION=main"
buildargs: "--build-arg=CONTAINERD_VERSION=v1.7.2-stargz"
steps:
- uses: actions/checkout@v3
- name: Validate containerd through CRI
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

ARG CONTAINERD_VERSION=v1.7.2
ARG CONTAINERD_VERSION=v1.7.2-stargz
ARG RUNC_VERSION=v1.1.7
ARG CNI_PLUGINS_VERSION=v1.3.0
ARG NERDCTL_VERSION=1.4.0
Expand All @@ -32,14 +32,14 @@ ARG CRI_TOOLS_VERSION=v1.27.0
# Legacy builder that doesn't support TARGETARCH should set this explicitly using --build-arg.
# If TARGETARCH isn't supported by the builder, the default value is "amd64".

FROM golang:1.20.6-bullseye AS golang-base
FROM golang:1.20.7-bullseye AS golang-base

# Build containerd
FROM golang-base AS containerd-dev
ARG CONTAINERD_VERSION
RUN apt-get update -y && apt-get install -y libbtrfs-dev libseccomp-dev && \
git clone -b ${CONTAINERD_VERSION} --depth 1 \
https://github.com/containerd/containerd $GOPATH/src/github.com/containerd/containerd && \
https://github.com/pdtpartners/containerd $GOPATH/src/github.com/containerd/containerd && \
cd $GOPATH/src/github.com/containerd/containerd && \
make && DESTDIR=/out/ PREFIX= make install

Expand All @@ -49,7 +49,7 @@ ARG CONTAINERD_VERSION
COPY . $GOPATH/src/github.com/containerd/stargz-snapshotter
RUN apt-get update -y && apt-get install -y libbtrfs-dev libseccomp-dev && \
git clone -b ${CONTAINERD_VERSION} --depth 1 \
https://github.com/containerd/containerd $GOPATH/src/github.com/containerd/containerd && \
https://github.com/pdtpartners/containerd $GOPATH/src/github.com/containerd/containerd && \
cd $GOPATH/src/github.com/containerd/containerd && \
echo 'require github.com/containerd/stargz-snapshotter v0.0.0' >> go.mod && \
echo 'replace github.com/containerd/stargz-snapshotter => '$GOPATH'/src/github.com/containerd/stargz-snapshotter' >> go.mod && \
Expand Down
6 changes: 4 additions & 2 deletions cmd/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/containerd/stargz-snapshotter/cmd
go 1.19

require (
github.com/containerd/containerd v1.7.2
github.com/containerd/containerd v1.7.3
github.com/containerd/go-cni v1.1.9
github.com/containerd/stargz-snapshotter v0.14.3
github.com/containerd/stargz-snapshotter/estargz v0.14.3
Expand Down Expand Up @@ -36,7 +36,7 @@ require (
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cilium/ebpf v0.9.1 // indirect
github.com/containerd/cgroups v1.1.0 // indirect
github.com/containerd/cgroups/v3 v3.0.1 // indirect
github.com/containerd/cgroups/v3 v3.0.2 // indirect
github.com/containerd/console v1.0.3 // indirect
github.com/containerd/continuity v0.4.1 // indirect
github.com/containerd/fifo v1.1.0 // indirect
Expand Down Expand Up @@ -144,3 +144,5 @@ replace (
github.com/containerd/stargz-snapshotter/estargz => ../estargz
github.com/containerd/stargz-snapshotter/ipfs => ../ipfs
)

replace github.com/containerd/containerd => github.com/pdtpartners/containerd v1.7.2-stargz
8 changes: 4 additions & 4 deletions cmd/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM=
github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw=
github.com/containerd/cgroups/v3 v3.0.1 h1:4hfGvu8rfGIwVIDd+nLzn/B9ZXx4BcCjzt5ToenJRaE=
github.com/containerd/cgroups/v3 v3.0.1/go.mod h1:/vtwk1VXrtoa5AaZLkypuOJgA/6DyPMZHJPGQNtlHnw=
github.com/containerd/cgroups/v3 v3.0.2 h1:f5WFqIVSgo5IZmtTT3qVBo6TzI1ON6sycSBKkymb9L0=
github.com/containerd/cgroups/v3 v3.0.2/go.mod h1:JUgITrzdFqp42uI2ryGA+ge0ap/nxzYgkGmIcetmErE=
github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw=
github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw=
github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U=
github.com/containerd/containerd v1.7.2 h1:UF2gdONnxO8I6byZXDi5sXWiWvlW3D/sci7dTQimEJo=
github.com/containerd/containerd v1.7.2/go.mod h1:afcz74+K10M/+cjGHIVQrCt3RAQhUSCAjJ9iMYhhkuI=
github.com/containerd/continuity v0.4.1 h1:wQnVrjIyQ8vhU2sgOiL5T07jo+ouqc2bnKsv5/EqGhU=
github.com/containerd/continuity v0.4.1/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ=
github.com/containerd/fifo v1.1.0 h1:4I2mbh5stb1u6ycIABlBw9zgtlK8viPI9QkQNRQEEmY=
Expand Down Expand Up @@ -280,6 +278,8 @@ github.com/opencontainers/runtime-spec v1.1.0-rc.3/go.mod h1:jwyrGlmzljRJv/Fgzds
github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI=
github.com/opencontainers/selinux v1.11.0 h1:+5Zbo97w3Lbmb3PeqQtpmTkMwsW5nRI3YaLpt7tQ7oU=
github.com/opencontainers/selinux v1.11.0/go.mod h1:E5dMC3VPuVvVHDYmi78qvhJp8+M586T4DlDRYpFkyec=
github.com/pdtpartners/containerd v1.7.2-stargz h1:b/o+aD51Am8oWD01MRAbfuBWt+oR1OzJaXWIWtAhLis=
github.com/pdtpartners/containerd v1.7.2-stargz/go.mod h1:afcz74+K10M/+cjGHIVQrCt3RAQhUSCAjJ9iMYhhkuI=
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ go 1.19
require (
github.com/containerd/console v1.0.3
github.com/containerd/containerd v1.7.2
github.com/containerd/continuity v0.4.1
github.com/containerd/stargz-snapshotter/estargz v0.14.3
github.com/docker/cli v24.0.4+incompatible
github.com/docker/go-metrics v0.0.1
Expand Down Expand Up @@ -39,6 +38,7 @@ require (
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/containerd/cgroups v1.1.0 // indirect
github.com/containerd/cgroups/v3 v3.0.1 // indirect
github.com/containerd/continuity v0.4.1 // indirect
github.com/containerd/fifo v1.1.0 // indirect
github.com/containerd/go-cni v1.1.9 // indirect
github.com/containerd/ttrpc v1.2.2 // indirect
Expand Down Expand Up @@ -116,3 +116,5 @@ require (

// Import local package for estargz.
replace github.com/containerd/stargz-snapshotter/estargz => ./estargz

replace github.com/containerd/containerd => github.com/pdtpartners/containerd v1.7.2-stargz
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ github.com/containerd/cgroups/v3 v3.0.1 h1:4hfGvu8rfGIwVIDd+nLzn/B9ZXx4BcCjzt5To
github.com/containerd/cgroups/v3 v3.0.1/go.mod h1:/vtwk1VXrtoa5AaZLkypuOJgA/6DyPMZHJPGQNtlHnw=
github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw=
github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U=
github.com/containerd/containerd v1.7.2 h1:UF2gdONnxO8I6byZXDi5sXWiWvlW3D/sci7dTQimEJo=
github.com/containerd/containerd v1.7.2/go.mod h1:afcz74+K10M/+cjGHIVQrCt3RAQhUSCAjJ9iMYhhkuI=
github.com/containerd/continuity v0.4.1 h1:wQnVrjIyQ8vhU2sgOiL5T07jo+ouqc2bnKsv5/EqGhU=
github.com/containerd/continuity v0.4.1/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ=
github.com/containerd/fifo v1.1.0 h1:4I2mbh5stb1u6ycIABlBw9zgtlK8viPI9QkQNRQEEmY=
Expand Down Expand Up @@ -230,6 +228,8 @@ github.com/opencontainers/runtime-spec v1.1.0-rc.3/go.mod h1:jwyrGlmzljRJv/Fgzds
github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI=
github.com/opencontainers/selinux v1.11.0 h1:+5Zbo97w3Lbmb3PeqQtpmTkMwsW5nRI3YaLpt7tQ7oU=
github.com/opencontainers/selinux v1.11.0/go.mod h1:E5dMC3VPuVvVHDYmi78qvhJp8+M586T4DlDRYpFkyec=
github.com/pdtpartners/containerd v1.7.2-stargz h1:b/o+aD51Am8oWD01MRAbfuBWt+oR1OzJaXWIWtAhLis=
github.com/pdtpartners/containerd v1.7.2-stargz/go.mod h1:afcz74+K10M/+cjGHIVQrCt3RAQhUSCAjJ9iMYhhkuI=
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand Down
2 changes: 1 addition & 1 deletion ipfs/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/containerd/stargz-snapshotter/ipfs
go 1.19

require (
github.com/containerd/containerd v1.7.2
github.com/containerd/containerd v1.7.3
github.com/mitchellh/go-homedir v1.1.0
github.com/multiformats/go-multiaddr v0.10.1
github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b
Expand Down
4 changes: 2 additions & 2 deletions ipfs/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX
github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM=
github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw=
github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U=
github.com/containerd/containerd v1.7.2 h1:UF2gdONnxO8I6byZXDi5sXWiWvlW3D/sci7dTQimEJo=
github.com/containerd/containerd v1.7.2/go.mod h1:afcz74+K10M/+cjGHIVQrCt3RAQhUSCAjJ9iMYhhkuI=
github.com/containerd/containerd v1.7.3 h1:cKwYKkP1eTj54bP3wCdXXBymmKRQMrWjkLSWZZJDa8o=
github.com/containerd/containerd v1.7.3/go.mod h1:32FOM4/O0RkNg7AjQj3hDzN9cUGtu+HMvaKUNiqCZB8=
github.com/containerd/continuity v0.4.1 h1:wQnVrjIyQ8vhU2sgOiL5T07jo+ouqc2bnKsv5/EqGhU=
github.com/containerd/continuity v0.4.1/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ=
github.com/containerd/fifo v1.1.0 h1:4I2mbh5stb1u6ycIABlBw9zgtlK8viPI9QkQNRQEEmY=
Expand Down
5 changes: 4 additions & 1 deletion script/k3s-argo-workflow/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ REPO="${CONTEXT}../../"

K3S_VERSION=master
K3S_REPO=https://github.com/k3s-io/k3s
K3S_CONTAINERD_REPO=https://github.com/k3s-io/containerd
K3S_CONTAINERD_REPO=https://github.com/pdtpartners/containerd

K3S_NODE_REPO=ghcr.io/stargz-containers
K3S_NODE_IMAGE_NAME=k3s
Expand Down Expand Up @@ -126,6 +126,8 @@ wget -O "${ORG_ARGOYAML}" https://raw.githubusercontent.com/argoproj/argo-workfl

git clone -b ${K3S_VERSION} --depth 1 "${K3S_REPO}" "${TMP_K3S_REPO}"
sed -i "s|github.com/k3s-io/stargz-snapshotter .*$|$(realpath ${REPO})|g" "${TMP_K3S_REPO}/go.mod"
sed -i "s|github.com/k3s-io/containerd v1.7.3-k3s1|github.com/pdtpartners/containerd v1.7.2-stargz|g" "${TMP_K3S_REPO}/go.mod"

echo "replace github.com/containerd/stargz-snapshotter/estargz => $(realpath ${REPO})/estargz" >> "${TMP_K3S_REPO}/go.mod"

# typeurl version stargz-snapshotter indirectly depends on is incompatible to the one github.com/k3s-io/containerd depends on.
Expand All @@ -137,6 +139,7 @@ cat "${TMP_K3S_REPO}/go.mod"

sed -i -E 's|(ENV DAPPER_RUN_ARGS .*)|\1 -v '"$(realpath ${REPO})":"$(realpath ${REPO})"':ro|g' "${TMP_K3S_REPO}/Dockerfile.dapper"
sed -i -E 's|(ENV DAPPER_ENV .*)|\1 DOCKER_BUILDKIT|g' "${TMP_K3S_REPO}/Dockerfile.dapper"
sed -i -E 's|github.com/k3s-io/containerd|github.com/pdtpartners/containerd|g' "${TMP_K3S_REPO}/scripts/download"
(
cd "${TMP_K3S_REPO}" && \
git config user.email "dummy@example.com" && \
Expand Down
6 changes: 5 additions & 1 deletion script/k3s/run-k3s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ set -euo pipefail

K3S_VERSION=master
K3S_REPO=https://github.com/k3s-io/k3s
K3S_CONTAINERD_REPO=https://github.com/k3s-io/containerd
K3S_CONTAINERD_REPO=https://github.com/pdtpartners/containerd

REGISTRY_HOST=k3s-private-registry
K3S_NODE_REPO=ghcr.io/stargz-containers
Expand Down Expand Up @@ -55,6 +55,8 @@ trap 'cleanup "$?"' EXIT SIGHUP SIGINT SIGQUIT SIGTERM
echo "Preparing node image..."
git clone -b ${K3S_VERSION} --depth 1 "${K3S_REPO}" "${TMP_K3S_REPO}"
sed -i "s|github.com/k3s-io/stargz-snapshotter .*$|$(realpath ${REPO})|g" "${TMP_K3S_REPO}/go.mod"
sed -i "s|github.com/k3s-io/containerd v1.7.3-k3s1|github.com/pdtpartners/containerd v1.7.2-stargz|g" "${TMP_K3S_REPO}/go.mod"

echo "replace github.com/containerd/stargz-snapshotter/estargz => $(realpath ${REPO})/estargz" >> "${TMP_K3S_REPO}/go.mod"

# typeurl version stargz-snapshotter indirectly depends on is incompatible to the one github.com/k3s-io/containerd depends on.
Expand All @@ -66,6 +68,8 @@ cat "${TMP_K3S_REPO}/go.mod"

sed -i -E 's|(ENV DAPPER_RUN_ARGS .*)|\1 -v '"$(realpath ${REPO})":"$(realpath ${REPO})"':ro|g' "${TMP_K3S_REPO}/Dockerfile.dapper"
sed -i -E 's|(ENV DAPPER_ENV .*)|\1 DOCKER_BUILDKIT|g' "${TMP_K3S_REPO}/Dockerfile.dapper"
sed -i -E 's|github.com/k3s-io/containerd|github.com/pdtpartners/containerd|g' "${TMP_K3S_REPO}/scripts/download"

(
cd "${TMP_K3S_REPO}" && \
git config user.email "dummy@example.com" && \
Expand Down
2 changes: 1 addition & 1 deletion service/keychain/kubeconfig/kubeconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func (kc *keychain) startSyncSecrets(ctx context.Context, client kubernetes.Inte
}

func (kc *keychain) runWorker() {
for kc.processNextItem() {
for kc.processNextItem() { //nolint:all
// continue looping
}
}
Expand Down

0 comments on commit 209aaf5

Please sign in to comment.