Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: curl download failure, as well as other errors #83

Merged
merged 2 commits into from
May 28, 2024
Merged
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
2 changes: 1 addition & 1 deletion build/installer/install_cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ precheck_os() {

# opy pre-installation dependency files
if [ -d /opt/deps ]; then
ensure_success $sh_c "mv /opt/deps/* ${BASE_DIR}/install-wizard"
ensure_success $sh_c "mv /opt/deps/* ${BASE_DIR}"
fi
}

Expand Down
4 changes: 2 additions & 2 deletions build/manifest/dependencies
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[components] format: url,filename
https://github.com/beclab/kubekey-ext/releases/download/${KKE_VERSION}/kubekey-ext-v0.1.20-linux-amd64.tar.gz,
https://github.com/beclab/kubekey-ext/releases/download/0.1.20/kubekey-ext-v0.1.20-linux-amd64.tar.gz,
https://src.fedoraproject.org/lookaside/pkgs/socat/socat-1.7.3.2.tar.gz/sha512/540658b2a3d1b87673196282e5c62b97681bd0f1d1e4759ff9d72909d11060235ee9e9521a973603c1b00376436a9444248e5fbc0ffac65f8edb9c9bc28e7972/socat-1.7.3.2.tar.gz,

https://github.com/fqrouter/conntrack-tools/archive/refs/tags/conntrack-tools-1.4.1.tar.gz,
Expand Down Expand Up @@ -43,7 +43,7 @@ https://storage.googleapis.com/kubernetes-release/release/v1.22.10/bin/linux/amd

https://github.com/docker/compose/releases/download/v2.2.2/docker-compose-linux-x86_64,registry/compose/v2.2.2,docker-compose-linux-x86_64,,
https://github.com/goharbor/harbor/releases/download/v2.5.3/harbor-offline-installer-v2.5.3.tgz,registry/harbor/v2.5.3,,
https://github.com/docker/distribution/releases/download/v2.7.1/registry-2.7.1.linux-amd64.tar.gz,registry/registry/2,,
https://github.com/kubesphere/kubekey/releases/download/v2.0.0-alpha.1/registry-2-linux-amd64.tar.gz,registry/registry/2,,

https://github.com/opencontainers/runc/releases/download/v1.1.1/runc.amd64,runc/v1.1.1,,
https://github.com/opencontainers/runc/releases/download/v1.1.4/runc.amd64,runc/v1.1.4,,
23 changes: 13 additions & 10 deletions scripts/build-full.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
BASE_DIR=$(dirname $(realpath -s $0))
rm -rf ${BASE_DIR}/../.dist
rm -rf ${BASE_DIR}/../.manifest
rm -rf ${BASE_DIR}/../.dependencies
DIST_PATH="${BASE_DIR}/../.dist/install-wizard"
VERSION=$1

Expand All @@ -19,27 +20,29 @@ bash ${BASE_DIR}/deps-manifest.sh

pushd ${BASE_DIR}/../.manifest
bash $BASE_DIR/save-images.sh images.mf
bash $BASE_DIR/save-deps.sh
popd

pushd ${BASE_DIR}/../.dependencies
bash $BASE_DIR/save-deps.sh
popd

pushd $DIST_PATH

rm -rf images
rm -rf components
rm -rf pkg

if [ -d ${BASE_DIR}/../.manifest/images ]; then
mv ${BASE_DIR}/../.manifest/images images
fi
if [ -d ${BASE_DIR}/../.manifest/components ]; then
mv ${BASE_DIR}/../.manifest/components components
mv ${BASE_DIR}/../.manifest images


if [ -d ${BASE_DIR}/../.dependencies/components ]; then
mv ${BASE_DIR}/../.dependencies/components components
fi
if [ -d ${BASE_DIR}/../.manifest/pkg ]; then
mv ${BASE_DIR}/../.manifest/pkg pkg
if [ -d ${BASE_DIR}/../.dependencies/pkg ]; then
mv ${BASE_DIR}/../.dependencies/pkg pkg
fi
if [ -f ${BASE_DIR}/../.manifest/dependencies.mf ]; then
cp ${BASE_DIR}/../.manifest/dependencies.mf ./
if [ -f ${BASE_DIR}/../.dependencies/dependencies.mf ]; then
cp ${BASE_DIR}/../.dependencies/dependencies.mf ./
fi

if [[ "$OSTYPE" == "darwin"* ]]; then
Expand Down
7 changes: 3 additions & 4 deletions scripts/deps-manifest.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#!/usr/bin/env bash

BASE_DIR=$(dirname $(realpath -s $0))
DEPENDENCIES_MANIFEST=".manifest/dependencies.mf"
DEPENDENCIES_MANIFEST=".dependencies/dependencies.mf"

if [ ! -d .manifest ]; then
mkdir -p .manifest
fi
rm -rf .dependencies
mkdir -p .dependencies

cp $BASE_DIR/../build/manifest/dependencies ${DEPENDENCIES_MANIFEST}
7 changes: 4 additions & 3 deletions scripts/download-deps.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
arch="amd64"
part=""
CURL_TRY="--connect-timeout 30 --retry 5 --retry-delay 1 --retry-max-time 10 "

cat ./dependencies.mf | while IFS= read -r line; do
[[ -z "$line" ]] && continue
Expand Down Expand Up @@ -31,9 +32,9 @@ cat ./dependencies.mf | while IFS= read -r line; do

if [ "$part" == "components" ]; then
if [ -z "$s2" ]; then
curl -L -o ./${part}/${file} ${s1}
curl ${CURL_TRY} -L -o ./${part}/${file} ${s1}
else
curl -L -o ./${part}/${s2} ${s1}
curl ${CURL_TRY} -L -o ./${part}/${s2} ${s1}
fi
else
s4=$(echo "$line" | cut -d',' -f4)
Expand All @@ -43,7 +44,7 @@ cat ./dependencies.mf | while IFS= read -r line; do
if [ ! -z ${s3} ]; then
filename=${s3}
fi
curl -L -o ${pkgpath}/${filename} ${s1}
curl ${CURL_TRY} -L -o ${pkgpath}/${filename} ${s1}

if [ "$s4" == "helm" ]; then
pushd ${pkgpath}
Expand Down
6 changes: 3 additions & 3 deletions scripts/upload-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
BASE_DIR=$(dirname $(realpath -s $0))
echo "Push Deps to S3 base_dir: ${BASE_DIR}"

if [ ! -d ".manifest" ]; then
if [ ! -d ".dependencies" ]; then
exit 1
fi

pushd ${BASE_DIR}/../.manifest
pushd ${BASE_DIR}/../.dependencies
fileprefix="deps"
name=$(md5sum dependencies.mf |awk '{print $1}')
echo "filename: ${fileprefix}-${name}.tar.gz"
Expand All @@ -26,7 +26,7 @@ if [ $? -ne 0 ]; then
echo "dependencies file ${fileprefix}-${name}.tar.gz not found, prepare to upload to S3"
tar -czf ./$name.tar.gz ./components ./pkg ./dependencies.mf && cp ./$name.tar.gz ../
popd
rm -rf ./.manifest/
rm -rf ./.dependencies/
aws s3 cp $name.tar.gz s3://terminus-os-install/${fileprefix}-$name.tar.gz --acl=public-read
echo "upload $name completed"
else
Expand Down
Loading