Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
Down containerd binaries from official release.
Browse files Browse the repository at this point in the history
Signed-off-by: Lantao Liu <lantaol@google.com>
  • Loading branch information
Random-Liu committed Apr 24, 2018
1 parent 906ea17 commit e22ebf4
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 19 deletions.
4 changes: 2 additions & 2 deletions docs/release.md
Expand Up @@ -19,9 +19,9 @@ Publish the release tarball `cri-containerd-${CONTAINERD_VERSION}.${OS}-${ARCH}.
git checkout ${RELEASE_VERSION}

# Publish the release tarball without cni.
DEPLOY_BUCKET=cri-containerd-release make push TARBALL_PREFIX=cri-containerd VERSION=${CONTAINERD_VERSION}
DEPLOY_BUCKET=cri-containerd-release make push TARBALL_PREFIX=cri-containerd OFFICIAL_RELEASE=true VERSION=${CONTAINERD_VERSION}

# Publish the release tarball with cni.
DEPLOY_BUCKET=cri-containerd-release make push TARBALL_PREFIX=cri-containerd-cni INCLUDE_CNI=true VERSION=${CONTAINERD_VERSION}
DEPLOY_BUCKET=cri-containerd-release make push TARBALL_PREFIX=cri-containerd-cni OFFICIAL_RELEASE=true INCLUDE_CNI=true VERSION=${CONTAINERD_VERSION}
```
## Step 6: Update release note with release tarball information
17 changes: 2 additions & 15 deletions hack/install/install-deps.sh
Expand Up @@ -28,27 +28,14 @@ set -o pipefail

cd $(dirname "${BASH_SOURCE[0]}")

# INSTALL_CNI indicates whether to install CNI. CNI installation
# makes sense for local testing, but doesn't make sense for cluster
# setup, because CNI daemonset is usually used to deploy CNI binaries
# and configurations in cluster.
INSTALL_CNI=${INSTALL_CNI:-true}

# INSTALL_CNI indicates whether to install CNI config.
INSTALL_CNI_CONFIG=${INSTALL_CNI_CONFIG:-true}

# Install runc
./install-runc.sh

# Install cni
if ${INSTALL_CNI}; then
./install-cni.sh
fi
./install-cni.sh

# Install cni config
if ${INSTALL_CNI_CONFIG}; then
./install-cni-config.sh
fi
./install-cni-config.sh

# Install containerd
./install-containerd.sh
Expand Down
32 changes: 30 additions & 2 deletions hack/release.sh
Expand Up @@ -31,6 +31,8 @@ INCLUDE_CNI=${INCLUDE_CNI:-false}
# CUSTOM_CONTAINERD indicates whether to install customized containerd
# for CI test.
CUSTOM_CONTAINERD=${CUSTOM_CONTAINERD:-false}
# OFFICIAL_RELEASE indicates whether to use official containerd release.
OFFICIAL_RELEASE=${OFFICIAL_RELEASE:-false}

destdir=${BUILD_DIR}/release-stage

Expand All @@ -42,9 +44,35 @@ fi
# Remove release-stage directory to avoid including old files.
rm -rf ${destdir}

# download_containerd downloads containerd from official release.
download_containerd() {
local -r tmppath="$(mktemp -d /tmp/download-containerd.XXXX)"
local -r tarball="${tmppath}/containerd.tar.gz"
local -r url="https://github.com/containerd/containerd/releases/download/v${VERSION}/containerd-${VERSION}.linux-amd64.tar.gz"
wget -O "${tarball}" "${url}"
tar -C "${destdir}/usr/local/bin" -xzf "${tarball}"
rm -rf "${tmppath}"
}

# Install dependencies into release stage.
NOSUDO=true INSTALL_CNI=${INCLUDE_CNI} INSTALL_CNI_CONFIG=false DESTDIR=${destdir} \
./hack/install/install-deps.sh
# Install runc
NOSUDO=true DESTDIR=${destdir} ./hack/install/install-runc.sh

if ${INCLUDE_CNI}; then
# Install cni
NOSUDO=true DESTDIR=${destdir} ./hack/install/install-cni.sh
fi

# Install critools
NOSUDO=true DESTDIR=${destdir} ./hack/install/install-critools.sh

# Install containerd
if $OFFICIAL_RELEASE; then
download_containerd
else
# Build containerd from source
NOSUDO=true DESTDIR=${destdir} ./hack/install/install-containerd.sh
fi

if ${CUSTOM_CONTAINERD}; then
make install -e DESTDIR=${destdir}
Expand Down

0 comments on commit e22ebf4

Please sign in to comment.