Skip to content

Commit

Permalink
make repositories of install dependencies configurable
Browse files Browse the repository at this point in the history
make repositories of dependencies like runc, crun, cni and critools configurable

Signed-off-by: Akhil Mohan <makhil@vmware.com>
(cherry picked from commit 7a0ad09)
Signed-off-by: Akhil Mohan <makhil@vmware.com>
  • Loading branch information
akhilerm committed Aug 29, 2023
1 parent fe457eb commit a34e932
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion script/setup/install-cni
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ set -eu -o pipefail
CNI_COMMIT=${1:-$(go list -f "{{.Version}}" -m github.com/containernetworking/plugins)}
CNI_DIR=${DESTDIR:=''}/opt/cni
CNI_CONFIG_DIR=${DESTDIR}/etc/cni/net.d
: "${CNI_REPO:=https://github.com/containernetworking/plugins.git}"

# e2e and Cirrus will fail with "sudo: command not found"
SUDO=''
Expand All @@ -32,7 +33,7 @@ if (( $EUID != 0 )); then
fi

TMPROOT=$(mktemp -d)
git clone https://github.com/containernetworking/plugins.git "${TMPROOT}"/plugins
git clone "${CNI_REPO}" "${TMPROOT}"/plugins
pushd "${TMPROOT}"/plugins
git checkout "$CNI_COMMIT"
./build_linux.sh
Expand Down
3 changes: 2 additions & 1 deletion script/setup/install-critools
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ go install github.com/onsi/ginkgo/v2/ginkgo@v2.9.2

: "${CRITEST_COMMIT:=$(cat "${script_dir}/critools-version")}"
: "${DESTDIR:=""}"
: "${CRI_TOOLS_REPO:=https://github.com/kubernetes-sigs/cri-tools.git}"

TMPROOT=$(mktemp -d)
git clone https://github.com/kubernetes-sigs/cri-tools.git "${TMPROOT}/cri-tools"
git clone "${CRI_TOOLS_REPO}" "${TMPROOT}/cri-tools"
pushd "${TMPROOT}"/cri-tools
git checkout "$CRITEST_COMMIT"
make
Expand Down
6 changes: 4 additions & 2 deletions script/setup/install-runc
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ fi
function install_runc() {
# When updating runc-version, consider updating the runc module in go.mod as well
: "${RUNC_VERSION:=$(cat "${script_dir}/runc-version")}"
: "${RUNC_REPO:=https://github.com/opencontainers/runc.git}"

TMPROOT=$(mktemp -d)
git clone https://github.com/opencontainers/runc.git "${TMPROOT}"/runc
git clone "${RUNC_REPO}" "${TMPROOT}"/runc
pushd "${TMPROOT}"/runc
git checkout "${RUNC_VERSION}"
make BUILDTAGS='seccomp' runc
Expand All @@ -44,7 +45,8 @@ function install_runc() {

function install_crun() {
: "${CRUN_VERSION:=$(cat "${script_dir}/crun-version")}"
$SUDO curl -S -o /usr/local/sbin/runc -L https://github.com/containers/crun/releases/download/"${CRUN_VERSION}"/crun-"${CRUN_VERSION}"-linux-"$(go env GOARCH)"
: "${CRUN_REPO:=https://github.com/containers/crun}"
$SUDO curl -S -o /usr/local/sbin/runc -L "${CRUN_REPO}"/releases/download/"${CRUN_VERSION}"/crun-"${CRUN_VERSION}"-linux-"$(go env GOARCH)"
$SUDO chmod +x /usr/local/sbin/runc
}

Expand Down

0 comments on commit a34e932

Please sign in to comment.