Skip to content

Commit

Permalink
Bump to latest kubevirtci that includes ocp-4.3
Browse files Browse the repository at this point in the history
Signed-off-by: Or Shoval <[email protected]>
  • Loading branch information
oshoval committed Jan 14, 2020
1 parent 2dd132c commit 2134313
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 30 deletions.
4 changes: 2 additions & 2 deletions automation/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ safe_download() (
fi
)

if [[ $TARGET =~ os-.* ]] || [[ $TARGET =~ okd-.* ]]; then
if [[ $TARGET =~ os-.* ]] || [[ $TARGET =~ (okd|ocp)-.* ]]; then
# Create images directory
if [[ ! -d $RHEL_NFS_DIR ]]; then
mkdir -p $RHEL_NFS_DIR
Expand Down Expand Up @@ -288,7 +288,7 @@ elif [[ $TARGET =~ sriov.* ]]; then
ginko_params="$ginko_params --ginkgo.focus=SRIOV"
elif [[ $TARGET =~ gpu.* ]]; then
ginko_params="$ginko_params --ginkgo.focus=GPU"
elif [[ $TARGET =~ okd.* ]]; then
elif [[ $TARGET =~ (okd|ocp).* ]]; then
ginko_params="$ginko_params --ginkgo.skip=Genie|SRIOV|GPU"
else
ginko_params="$ginko_params --ginkgo.skip=Multus|Genie|SRIOV|GPU"
Expand Down
2 changes: 1 addition & 1 deletion cluster-up-sha.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ad0920a05eef767e2dca64534f31082073d22b2d
485ca765a95ec0a7797a1a6128fc0edf9d358a70
8 changes: 4 additions & 4 deletions cluster-up/cluster/ephemeral-provider-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ set -e
source ${KUBEVIRTCI_PATH}/cluster/images.sh

if [ "${KUBEVIRTCI_RUNTIME}" = "podman" ]; then
_cli="pack8s"
_cli="pack8s"
else
_cli_container="${KUBEVIRTCI_GOCLI_CONTAINER:-kubevirtci/${IMAGES[gocli]}}"
_cli="docker run --privileged --net=host --rm ${USE_TTY} -v /var/run/docker.sock:/var/run/docker.sock ${_cli_container}"
_cli_container="${KUBEVIRTCI_GOCLI_CONTAINER:-kubevirtci/${IMAGES[gocli]}}"
_cli="docker run --privileged --net=host --rm ${USE_TTY} -v /var/run/docker.sock:/var/run/docker.sock ${_cli_container}"
fi

function _main_ip() {
Expand Down Expand Up @@ -43,7 +43,7 @@ function _add_common_params() {
params=" --nfs-data $RHEL_NFS_DIR $params"
fi
if [ -n "${KUBEVIRTCI_PROVISION_CHECK}" ]; then
params=" --container-registry= $params"
params=" --container-registry= $params"
fi
echo $params
}
Expand Down
36 changes: 21 additions & 15 deletions cluster-up/cluster/images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,27 @@
set -e

declare -A IMAGES
IMAGES[k8s-1.17.0]="k8s-1.17.0@sha256:7ec5504f84983dc1dd3dd2dfdcaf2aeeb4314de021c6636e099e616be76f73a0"
IMAGES[k8s-1.16.2]="k8s-1.16.2@sha256:5bae6a5f3b996952c5ceb4ba12ac635146425909801df89d34a592f3d3502b0c"
IMAGES[k8s-1.15.1]="k8s-1.15.1@sha256:14d7b1806f24e527167d2913deafd910ea46e69b830bf0b094dde35ba961b159"
IMAGES[k8s-1.14.6]="k8s-1.14.6@sha256:ec29c07c94fce22f37a448cb85ca1fb9215d1854f52573316752d19a1c88bcb3"
IMAGES[k8s-1.13.3]="k8s-1.13.3@sha256:afbdd9b4208e5ce2ec327f302c336cea3ed3c22488603eab63b92c3bfd36d6cd"
IMAGES[k8s-1.11.0]="k8s-1.11.0@sha256:696ba7860fc635628e36713a2181ef72568d825f816911cf857b2555ea80a98a"
IMAGES[k8s-genie-1.11.1]="k8s-genie-1.11.1@sha256:19af1961fdf92c08612d113a3cf7db40f02fd213113a111a0b007a4bf0f3f7e7"
IMAGES[k8s-multus-1.13.3]="k8s-multus-1.13.3@sha256:c0bcf0d2e992e5b4d96a7bcbf988b98b64c4f5aef2f2c4d1c291e90b85529738"
IMAGES[okd-4.1]="okd-4.1@sha256:e7e3a03bb144eb8c0be4dcd700592934856fb623d51a2b53871d69267ca51c86"
IMAGES[okd-4.2]="okd-4.2@sha256:a830064ca7bf5c5c2f15df180f816534e669a9a038fef4919116d61eb33e84c5"
IMAGES[okd-4.3]="okd-4.3@sha256:63abc3884002a615712dfac5f42785be864ea62006892bf8a086ccdbca8b3d38"
IMAGES[ocp-4.3]="kubevirtci/ocp-4.3@sha256:63bc365f97acab249b34a048825edd650973764355b3f232db7d74f7d08e6ea4"
IMAGES[gocli]="gocli@sha256:f5543a427a0e4c83b7251fbf71aa9d562f80f182e8662f5a4df13beb9c8aaba8"
IMAGES[gocli]="gocli@sha256:e48c7285ac9e4e61fe0f89f35ac5f9090497ea7c8165deeadb61e464c88d8afd"
if [ -z $KUBEVIRTCI_PROVISION_CHECK ]; then
IMAGES[k8s-1.17.0]="k8s-1.17.0@sha256:7ec5504f84983dc1dd3dd2dfdcaf2aeeb4314de021c6636e099e616be76f73a0"
IMAGES[k8s-1.16.2]="k8s-1.16.2@sha256:5bae6a5f3b996952c5ceb4ba12ac635146425909801df89d34a592f3d3502b0c"
IMAGES[k8s-1.15.1]="k8s-1.15.1@sha256:14d7b1806f24e527167d2913deafd910ea46e69b830bf0b094dde35ba961b159"
IMAGES[k8s-1.14.6]="k8s-1.14.6@sha256:ec29c07c94fce22f37a448cb85ca1fb9215d1854f52573316752d19a1c88bcb3"
IMAGES[k8s-1.13.3]="k8s-1.13.3@sha256:afbdd9b4208e5ce2ec327f302c336cea3ed3c22488603eab63b92c3bfd36d6cd"
IMAGES[k8s-1.11.0]="k8s-1.11.0@sha256:696ba7860fc635628e36713a2181ef72568d825f816911cf857b2555ea80a98a"
IMAGES[k8s-genie-1.11.1]="k8s-genie-1.11.1@sha256:19af1961fdf92c08612d113a3cf7db40f02fd213113a111a0b007a4bf0f3f7e7"
IMAGES[k8s-multus-1.13.3]="k8s-multus-1.13.3@sha256:c0bcf0d2e992e5b4d96a7bcbf988b98b64c4f5aef2f2c4d1c291e90b85529738"
IMAGES[okd-4.1]="okd-4.1@sha256:e7e3a03bb144eb8c0be4dcd700592934856fb623d51a2b53871d69267ca51c86"
IMAGES[okd-4.2]="okd-4.2@sha256:a830064ca7bf5c5c2f15df180f816534e669a9a038fef4919116d61eb33e84c5"
IMAGES[okd-4.3]="okd-4.3@sha256:63abc3884002a615712dfac5f42785be864ea62006892bf8a086ccdbca8b3d38"
IMAGES[ocp-4.3]="ocp-4.3@sha256:8f59d625852ef285d6ce3ddd6ebd3662707d2c0fab19772b61dd0aa0f6b41e5f"
fi
export IMAGES

image="${IMAGES[$KUBEVIRT_PROVIDER]:-${KUBEVIRT_PROVIDER}:latest}"
export image
IMAGE_SUFFIX=""
if [[ $KUBEVIRT_PROVIDER =~ (ocp|okd).* ]]; then
IMAGE_SUFFIX="-provision"
fi

image="${IMAGES[$KUBEVIRT_PROVIDER]:-${KUBEVIRT_PROVIDER}${IMAGE_SUFFIX}:latest}"
export image
7 changes: 7 additions & 0 deletions cluster-up/cluster/ocp-4.3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ local machine and are then pushed to a registry which is exposed at

## Bringing the cluster up

The container is stored at a private repository at quay.io/kubevirtci, you
have to ask for pull permissions there and do a docker login before cluster-up

```bash
docker login -u [quay user] -p [quay password] quay.io
```

```bash
export KUBEVIRT_PROVIDER=ocp-4.3
export KUBEVIRT_NUM_NODES=3 # master + two workers
Expand Down
17 changes: 15 additions & 2 deletions cluster-up/cluster/ocp-4.3/provider.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ function _install_from_cluster() {
}

function up() {
container_registry="quay.io"
workers=$(($KUBEVIRT_NUM_NODES-1))
if [[ ( $workers < 1 ) ]]; then
workers=1
fi
echo "Number of workers: $workers"
params="--random-ports --background --prefix $provider_prefix --master-cpu 6 --workers-cpu 6 --secondary-nics ${KUBEVIRT_NUM_SECONDARY_NICS} --registry-volume $(_registry_volume) --workers $workers --container-registry docker-registry.upshift.redhat.com ${image}"
params="--random-ports --background --prefix $provider_prefix --master-cpu 6 --workers-cpu 6 --secondary-nics ${KUBEVIRT_NUM_SECONDARY_NICS} --registry-volume $(_registry_volume) --workers $workers kubevirtci/${image}"
if [[ ! -z "${RHEL_NFS_DIR}" ]]; then
params=" --nfs-data $RHEL_NFS_DIR ${params}"
fi
Expand All @@ -38,7 +39,19 @@ function up() {
params=" --installer-pull-secret-file ${INSTALLER_PULL_SECRET} ${params}"
fi

${_cli} run okd ${params}
# The auth has the format base64(user:password)
auth=$(cat ~/.docker/config.json | jq -r '.auths["'$container_registry'"]["auth"]' |base64 -d)
user=$(echo $auth |awk -F: '{print $1}')
password=$(echo $auth |awk -F: '{print $2}')

# If provision test mode is on, use local image
if [ -z $KUBEVIRTCI_PROVISION_CHECK ]; then
params=" --container-registry ${container_registry} $params"
else
params=" --container-registry= $params"
fi

${_cli} run okd ${params} --container-registry-user $user --container-registry-password $password

# Copy k8s config and kubectl
cluster_container_id=$(docker ps -f "name=$provider_prefix-cluster" --format "{{.ID}}")
Expand Down
2 changes: 1 addition & 1 deletion cluster-up/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3ec1eb863fde80cd50e2cfddc93659191b944ed1
78dcc4f8aaec467bba8ae325646056128268a169
11 changes: 9 additions & 2 deletions hack/cluster-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ source hack/common.sh
source cluster-up/cluster/$KUBEVIRT_PROVIDER/provider.sh
source hack/config.sh

kubectl() { cluster-up/kubectl.sh "$@"; }

echo "Building ..."

# Build everyting and publish it
Expand All @@ -54,8 +56,13 @@ if [[ $image_prefix_alt ]]; then
done
fi

# OKD provider has different node names and does not have docker
if [[ $KUBEVIRT_PROVIDER =~ okd.* ]]; then
# OKD/OCP providers has different node names and does not have docker
if [[ $KUBEVIRT_PROVIDER =~ ocp.* ]]; then
nodes=()
nodes+=($(kubectl get nodes --no-headers | awk '{print $1}' | grep master))
nodes+=($(kubectl get nodes --no-headers | awk '{print $1}' | grep worker))
pull_command="podman"
elif [[ $KUBEVIRT_PROVIDER =~ okd.* ]]; then
nodes=("master-0" "worker-0")
pull_command="podman"
elif [[ $KUBEVIRT_PROVIDER == "external" ]] || [[ $KUBEVIRT_PROVIDER =~ kind.* ]]; then
Expand Down
2 changes: 1 addition & 1 deletion hack/cluster-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ EOF
# Deploy kubevirt operator
_kubectl apply -f ${MANIFESTS_OUT_DIR}/release/kubevirt-operator.yaml

if [[ "$KUBEVIRT_PROVIDER" =~ os-* ]] || [[ "$KUBEVIRT_PROVIDER" =~ okd-* ]]; then
if [[ "$KUBEVIRT_PROVIDER" =~ os-* ]] || [[ "$KUBEVIRT_PROVIDER" =~ (okd|ocp)-* ]]; then
# Helpful for development. Allows admin to access everything KubeVirt creates in the web console
_kubectl adm policy add-scc-to-user privileged admin
fi
Expand Down
2 changes: 1 addition & 1 deletion hack/config-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cdi_namespace=cdi
image_pull_policy=${IMAGE_PULL_POLICY:-IfNotPresent}
verbosity=${VERBOSITY:-2}
package_name=${PACKAGE_NAME:-kubevirt-dev}
kubevirtci_git_hash="3ec1eb863fde80cd50e2cfddc93659191b944ed1"
kubevirtci_git_hash="78dcc4f8aaec467bba8ae325646056128268a169"

# try to derive csv_version from docker tag. But it must start with x.y.z, without leading v
default_csv_version="${docker_tag/latest/0.0.0}"
Expand Down
2 changes: 1 addition & 1 deletion hack/functests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ previous_release_registry=${PREVIOUS_RELEASE_REGISTRY:-$_default_previous_releas

functest_docker_prefix=${manifest_docker_prefix-${docker_prefix}}

if [[ ${KUBEVIRT_PROVIDER} == os-* ]] || [[ ${KUBEVIRT_PROVIDER} == okd-* ]]; then
if [[ ${KUBEVIRT_PROVIDER} == os-* ]] || [[ ${KUBEVIRT_PROVIDER} =~ (okd|ocp)-* ]]; then
oc=${kubectl}
fi

Expand Down

0 comments on commit 2134313

Please sign in to comment.