Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
Delete wait_fo_cluster target
Browse files Browse the repository at this point in the history
  • Loading branch information
tsorya committed Jun 7, 2020
1 parent 10b1a6c commit 165aa24
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 33 deletions.
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@ _install_cluster:
install_cluster:
/usr/local/bin/skipper make _install_cluster $(SKIPPER_PARAMS)

wait_for_cluster:
scripts/assisted_deployment.sh wait_for_cluster

#########
# Nodes #
Expand Down
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ The following is a list of stages that will be run:
1. Set nodes roles in bm-inventory by matching VM names (worker/master)
1. Verify all nodes have required hardware to start installation
1. Install nodes
1. Download kubeconfig
1. Download kubeconfig-noingress to build/kubeconfig
1. Waiting till nodes are in "installed" state, while verifying that they don't move to "error" state
1. Verifying cluster is in state "installed"
1. Download kubeconfig to build/kubeconfig


**Note**: Please make sure no previous cluster is running before running a new one (it will rewrite its build files).

Expand Down Expand Up @@ -100,11 +104,6 @@ Install cluster after nodes were deployed. Can take ClusterId as os env
make install_cluster
```

### Wait for cluster to be installed
```bash
make wait_for_cluster
```

### Create cluster and download iso
```bash
make download_iso
Expand Down Expand Up @@ -155,28 +154,28 @@ SERVICE: bm-inventory image to use
```bash
make redeploy_all SERVICE=<image to test>
or
export PULL_SECRET='<pull secret json>'; make redeploy_all_with_install SERVICE=<image to test> && make wait_for_cluster
export PULL_SECRET='<pull secret json>'; make redeploy_all_with_install SERVICE=<image to test>
```

## Test agent image
```bash
make redeploy_all AGENT_DOCKER_IMAGE=<image to test>
or
make redeploy_all_with_install AGENT_DOCKER_IMAGE=<image to test> && make wait_for_cluster
make redeploy_all_with_install AGENT_DOCKER_IMAGE=<image to test>
```

## Test installer image
```bash
make redeploy_all INSTALLER_IMAGE=<image to test>
or
export PULL_SECRET='<pull secret json>'; make redeploy_all_with_install INSTALLER_IMAGE=<image to test> && make wait_for_cluster
export PULL_SECRET='<pull secret json>'; make redeploy_all_with_install INSTALLER_IMAGE=<image to test>
```

## Test installer, bm-inventory and agent images in the same flow
```bash
make redeploy_all INSTALLER_IMAGE=<image to test> AGENT_DOCKER_IMAGE=<image to test> SERVICE=<image to test>
or
export PULL_SECRET='<pull secret json>'; make redeploy_all_with_install INSTALLER_IMAGE=<image to test> AGENT_DOCKER_IMAGE=<image to test> SERVICE=<image to test> && make wait_for_cluster
export PULL_SECRET='<pull secret json>'; make redeploy_all_with_install INSTALLER_IMAGE=<image to test> AGENT_DOCKER_IMAGE=<image to test> SERVICE=<image to test>
```
# Test infra image

Expand Down
2 changes: 1 addition & 1 deletion install_env_and_run_full_flow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ source scripts/assisted_deployment.sh
echo "Starting cluster"
export SET_DNS="y"
export CLUSTER_NAME=${CLUSTER_NAME:-"test-infra-cluster"}
run_without_os_envs "run_full_flow_with_install" && set_dns && wait_for_cluster
run_without_os_envs "run_full_flow_with_install" && set_dns
22 changes: 2 additions & 20 deletions scripts/assisted_deployment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,9 @@ function set_dns() {
sudo systemctl reload NetworkManager
}

# Delete after pushing fix to dev-scripts
function wait_for_cluster() {
CONFIG=()
SLEEP=30
# Timeout 60 minutes
RETRIES=60*60/${SLEEP}
RETRIES=$((RETRIES))
echo "Waiting till we have 3 masters"
until [ $RETRIES -eq 0 ] || [ $(kubectl --kubeconfig=build/kubeconfig get nodes | grep master | grep -v NotReady | grep Ready | wc -l) -eq 3 ]; do
sleep ${SLEEP}s
RETRIES=$((RETRIES-1))
echo "Still waiting for 3 masters"
done
if [ $RETRIES -eq 0 ]; then
echo "Timeout reached, cluster still is down"
exit 1
fi
echo "Got 3 ready masters"
echo -e "$(kubectl --kubeconfig=build/kubeconfig get nodes)"
echo "Nothing to do"
}


Expand All @@ -44,9 +29,6 @@ function run() {
if [ $retVal -ne 0 ]; then
exit $retVal
fi
if [ "$1" = "run_full_flow_with_install" ]; then
wait_for_cluster
fi
}


Expand Down

0 comments on commit 165aa24

Please sign in to comment.