From: Ricardo Noriega Date: Thu, 22 Oct 2020 14:31:31 +0000 (+0200) Subject: Remove libvirt job and fix knictl paths X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=2673ad8728567987a148bf476b3b04084b50dd57;p=kni%2Finstaller.git Remove libvirt job and fix knictl paths Signed-off-by: Ricardo Noriega Change-Id: Ie0f822e57240fc6dad840be166268f3136b722d9 --- diff --git a/ci/kni_deploy_aws.sh b/ci/kni_deploy_aws.sh index b3d41d5..a649225 100755 --- a/ci/kni_deploy_aws.sh +++ b/ci/kni_deploy_aws.sh @@ -42,8 +42,8 @@ sed -i "s#- git::https://gerrit.akraino.org/r/kni/${GIT_CHECKOUT_DIR}.git/#- fil # start the workflow sudo rm -rf /$HOME/.kni/${SITE_NAME} || true -./knictl fetch_requirements file://${BLUEPRINT_PATH}/sites/${SITE_NAME} 2>&1 | tee ${WORKSPACE}/aws_requirements.log -./knictl prepare_manifests ${SITE_NAME} 2>&1 | tee ${WORKSPACE}/aws_manifests.log +./bin/knictl fetch_requirements file://${BLUEPRINT_PATH}/sites/${SITE_NAME} 2>&1 | tee ${WORKSPACE}/aws_requirements.log +./bin/knictl prepare_manifests ${SITE_NAME} 2>&1 | tee ${WORKSPACE}/aws_manifests.log # now run the cluster source $HOME/.kni/${SITE_NAME}/profile.env @@ -61,7 +61,7 @@ if [ $STATUS -ne 0 ]; then fi echo "Cluster successfully deployed! Start applying workloads" -./knictl apply_workloads ${SITE_NAME} 2>&1 | tee ${WORKSPACE}/aws_workloads.go +./bin/knictl apply_workloads ${SITE_NAME} 2>&1 | tee ${WORKSPACE}/aws_workloads.go STATUS=$? if [ $STATUS -ne 0 ]; then diff --git a/ci/kni_deploy_baremetal.sh b/ci/kni_deploy_baremetal.sh index 9ff1a6f..8002757 100755 --- a/ci/kni_deploy_baremetal.sh +++ b/ci/kni_deploy_baremetal.sh @@ -30,12 +30,12 @@ sudo -E bash -c "yes Y | ./virsh-cleanup.sh" rm -rf $HOME/.kni/$SITE_NAME || true pushd $HOME/go/src/gerrit.akraino.org/kni/installer -./knictl fetch_requirements file://${WORKSPACE}/kni-blueprint-pae/sites/$SITE_NAME -./knictl prepare_manifests $SITE_NAME +./bin/knictl fetch_requirements file://${WORKSPACE}/kni-blueprint-pae/sites/$SITE_NAME +./bin/knictl prepare_manifests $SITE_NAME popd pushd $HOME/go/src/gerrit.akraino.org/kni/installer -./knictl deploy_masters $SITE_NAME +./bin/knictl deploy_masters $SITE_NAME # just sleep for some time, for masters to be up sleep 20m @@ -51,7 +51,7 @@ set -e popd pushd $HOME/go/src/gerrit.akraino.org/kni/installer -./knictl deploy_workers $SITE_NAME +./bin/knictl deploy_workers $SITE_NAME # destroy bootstrap node virsh destroy ${UPI_NAME}-bootstrap @@ -65,7 +65,7 @@ echo "Cluster successfully deployed! Start applying workloads" rm -rf $HOME/.kni/$SITE_NAME/baremetal_automation/build/openshift-patches/99-ifcfg-*.yaml pushd $HOME/go/src/gerrit.akraino.org/kni/installer -./knictl apply_workloads $SITE_NAME --kubeconfig $HOME/.kni/$SITE_NAME/baremetal_automation/ocp/auth/kubeconfig +./bin/knictl apply_workloads $SITE_NAME --kubeconfig $HOME/.kni/$SITE_NAME/baremetal_automation/ocp/auth/kubeconfig STATUS=$? popd @@ -78,6 +78,6 @@ fi if [ -z "${PRESERVE_CLUSTER}" ]; then # now destroy the cluster pushd $HOME/go/src/gerrit.akraino.org/kni/installer - ./knictl destroy_cluster $SITE_NAME + ./bin/knictl destroy_cluster $SITE_NAME popd fi diff --git a/ci/kni_deploy_libvirt.sh b/ci/kni_deploy_libvirt.sh deleted file mode 100755 index 3c20840..0000000 --- a/ci/kni_deploy_libvirt.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2019 Red Hat -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -e -u -x -o pipefail - -export PATH=$PATH:/usr/local/go/bin:/usr/local/bin -KNI_PATH='src/gerrit.akraino.org/kni/' -SITE_NAME='testing.virt.edge-sites.net' - -echo '---> Starting kni installer generation' -export GOPATH=${WORKSPACE}/ - -# first build kni installer -sudo rm -rf ${WORKSPACE}/${KNI_PATH} -mkdir -p ${WORKSPACE}/${KNI_PATH}/installer -cp -a installer ${WORKSPACE}/${KNI_PATH}/ -pushd ${WORKSPACE}/${KNI_PATH}/installer -make build 2>&1 | tee ${WORKSPACE}/build.log - -# do a host preparation and cleanup -bash utils/prep_host.sh virt.edge-sites.net -wget https://raw.githubusercontent.com/openshift/installer/master/scripts/maintenance/virsh-cleanup.sh -chmod a+x ./virsh-cleanup.sh -sudo -E bash -c "yes Y | ./virsh-cleanup.sh" - -# add the right credentials to kni -mkdir $HOME/.kni || true -cp $HOME/.ssh/id_rsa.pub $HOME/.kni/id_rsa.pub || true - -# replace site path with a local ref to the cloned blueprint -BLUEPRINT_PATH="${WORKSPACE}/${GIT_CHECKOUT_DIR}/" -KUSTOMIZATION_FILE=${BLUEPRINT_PATH}/sites/${SITE_NAME}/00_install-config/kustomization.yaml -sed -i "s#- git::https://gerrit.akraino.org/r/kni/${GIT_CHECKOUT_DIR}.git/#- file://${BLUEPRINT_PATH}#g" ${KUSTOMIZATION_FILE} - -# start the workflow -sudo rm -rf /$HOME/.kni/${SITE_NAME} || true -./knictl fetch_requirements file://${BLUEPRINT_PATH}/sites/${SITE_NAME} 2>&1 | tee ${WORKSPACE}/libvirt_requirements.log -./knictl prepare_manifests ${SITE_NAME} 2>&1 | tee ${WORKSPACE}/libvirt_manifests.log - -# move the binary to /usr/bin, due to create cluster constraints -sudo cp $HOME/.kni/${SITE_NAME}/requirements/openshift-install /usr/bin/openshift-install - -# now run the cluster -pushd /usr/bin -source $HOME/.kni/${SITE_NAME}/profile.env -sudo -E /usr/bin/openshift-install create cluster --dir=/$HOME/.kni/${SITE_NAME}/final_manifests 2>&1 | tee ${WORKSPACE}/libvirt_deploy.log || true - -# additional step of wait for installer to complete -for i in 1 2 3; do - sudo -E /usr/bin/openshift-install wait-for install-complete --dir=/$HOME/.kni/${SITE_NAME}/final_manifests && break -done -STATUS=$? - -if [ $STATUS -ne 0 ]; then - echo "Error deploying in libvirt" - exit 1 -fi -popd - -# output tfstate -echo "metadata.json for removing cluster" -sudo cat $HOME/.kni/${SITE_NAME}/final_manifests/metadata.json - -echo "Cluster successfully deployed! Start applying workloads" -sudo -E ./knictl apply_workloads ${SITE_NAME} --build_path $HOME/.kni 2>&1 | tee ${WORKSPACE}/libvirt_workloads.log -STATUS=$? - -if [ $STATUS -ne 0 ]; then - echo "Error applying workloads to libvirt" - exit 1 -fi - -popd - -exit $STATUS