diff --git a/deploy/comm.sh b/deploy/comm.sh index fd22d09a06d6c3e6562809bd9b687e87a8c80e2d..5e40a868614624dfd515b77471712e85e00e65d3 100644 --- a/deploy/comm.sh +++ b/deploy/comm.sh @@ -6,16 +6,6 @@ DASHBOARD_LIST=( "JVM Metrics.json" "System Flame.json" ) -function config_docker() { - if ! grep "^INSECURE_REGISTRY" /etc/sysconfig/docker | grep -q "${DOCKER_HUB}" ; then - cat >> /etc/sysconfig/docker << EOF -INSECURE_REGISTRY='--insecure-registry ${DOCKER_HUB}' -EOF - systemctl daemon-reload - systemctl restart docker || echo_err_exit "Error: fail to configure docker" - fi -} - function docker_pull_image() { tag_name="$1" @@ -24,9 +14,17 @@ function docker_pull_image() { yum install docker -y [ $? -ne 0 ] && echo_err_exit "Error: fail to install docker" fi - config_docker - docker pull ${DOCKER_HUB_TAG_PREFIX}/"${tag_name}" - [ $? -ne 0 ] && echo_err_exit "Error: failed to pull docker image:" $tag_name + + docker pull ${DOCKER_HUB_TAG_PREFIX}/"${tag_name}" 2>gopher_deploy_err.log + if [ $? -ne 0 ] ; then + if cat gopher_deploy_err.log | grep -q "unknown authority" ; then + echo_warn "Add hub.oepgs.net to insecure-registries in /etc/docker/daemon.json and restart docker, then retry deploying" + fi + rm -rf gopher_deploy_err.log + echo_err_exit "Error: failed to pull docker image: ${DOCKER_HUB_TAG_PREFIX}/${tag_name}" + else + rm -rf gopher_deploy_err.log + fi } function yum_download() { diff --git a/deploy/deploy.sh b/deploy/deploy.sh index 23ac143a7459da2e30b820f63fd6261db9af17e9..874d5fbbb72f65c73f1538f968a633efeb80df0b 100755 --- a/deploy/deploy.sh +++ b/deploy/deploy.sh @@ -383,7 +383,7 @@ function deploy_gopher_daemonset() { echo -e "\n[2] Downloading template of gala-gopher daemonset yaml" if [ "$DEPLOY_TYPE" == "local" ] ; then [ ! -f "$LOCAL_DEPLOY_SRCDIR/daemonset.yaml.tmpl" ] && echo_err_exit "Failed to find daemonset yaml template" - mv -f ./daemonset.yaml.tmpl ${GOPHER_DAEMONSET_YAML} + mv -f "$LOCAL_DEPLOY_SRCDIR/daemonset.yaml.tmpl" ${GOPHER_DAEMONSET_YAML} else if [ ! -f ./daemonset.yaml.tmpl ] ; then wget https://gitee.com/openeuler/gala-gopher/raw/dev/k8s/daemonset.yaml.tmpl --no-check-certificate @@ -1189,7 +1189,7 @@ function detect_kylin_version() { OFFICIAL_RELEASE="no" kylin_milestone=$(cat /etc/.kyinfo | grep '^milestone=' | awk -F "=" '{print $2}') if [[ "$kylin_milestone" =~ "10-SP1" ]] ; then - REMOTE_REPO_PREFIX="$REMOTE_REPO_PREFIX/openEuler-20.03-LTS" + REMOTE_REPO_PREFIX="$REMOTE_REPO_PREFIX/openEuler-20.03-LTS-SP1" GOPHER_DOCKER_TAG="kylin-v10-sp1" elif [[ "$kylin_milestone" =~ "10-SP3" ]] ; then REMOTE_REPO_PREFIX="$REMOTE_REPO_PREFIX/openEuler-20.03-LTS-SP3" diff --git a/deploy/download_offline_res.sh b/deploy/download_offline_res.sh index 6a6674162b5c20f8dd68cda2bee837c87626ef3c..065a708725bdd43a0c2cc78a06d590a529ac28f5 100755 --- a/deploy/download_offline_res.sh +++ b/deploy/download_offline_res.sh @@ -222,6 +222,8 @@ download_gopher_image() { # use OS_TYPE OS_VERSION config yum repo function config_remote_repo() { + [ "x$OS_VERSION" == "x" ] && echo_err_exit "Unsupport OS version, aborting" + if [ "x$OS_TYPE" == "xopenEuler" ] ; then if [ "$OS_VERSION" == "openEuler-22.03-LTS-SP1" ] ; then REMOTE_REPO_PREFIX="$REMOTE_ALIYUN_REPO_PREFIX/$OS_VERSION" @@ -252,9 +254,25 @@ function detect_os() { OS_TYPE=$(cat /etc/os-release | grep '^ID=' | awk -F '\"' '{print $2}') [ -z "$OS_TYPE" ] && echo_err_exit "Unsupport OS type, aborting!" - OS_VERSION=$(cat /etc/openEuler-latest 2>/dev/null | head -n1 | awk -F= '{print $2}' ) - - config_remote_repo + if [ "x$OS_TYPE" == "xopenEuler" ] ; then + OS_VERSION=$(cat /etc/openEuler-latest | head -n1 | awk -F= '{print $2}') + elif [ "x$OS_TYPE" == "xkylin" ] ; then + kylin_milestone=$(cat /etc/.kyinfo | grep '^milestone=' | awk -F "=" '{print $2}') + if [[ "$kylin_milestone" =~ "10-SP1" ]] ; then + OS_VERSION="kylin-v10-sp1" + elif [[ "$kylin_milestone" =~ "10-SP3" ]] ; then + OS_VERSION="kylin-v10-sp3" + fi + elif [ "x$OS_TYPE" == "xeuleros" ] ; then + eulerversion=$(cat /etc/euleros-latest | grep '^eulerversion=' | awk -F "=" '{print $2}') + if [[ "$eulerversion" =~ "V200R008" ]] ; then + OS_VERSION="euleros-v2r8" + elif [[ "$eulerversion" =~ "V200R009" ]] ; then + OS_VERSION="euleros-v2r9" + elif [[ "$eulerversion" =~ "V200R010" ]] ; then + OS_VERSION="euleros-v2r10" + fi + fi } function config_os_version_type() { @@ -286,7 +304,6 @@ function parse_arg_gopher() { fi config_os_version_type $2 $3 - config_remote_repo } function parse_arch() { @@ -314,6 +331,7 @@ case "x$component" in if [ $# -gt 1 ]; then parse_arg_gopher $@ fi + config_remote_repo ;; xops) DOWNLOAD_COMPONENT_LIST="${DOWNLOAD_COMPONENT_LIST}ops "