Skip to content

Commit

Permalink
Merge branch 'master' into createttr
Browse files Browse the repository at this point in the history
  • Loading branch information
mfrancisc authored Nov 25, 2024
2 parents dc38c17 + 924068a commit 22f4e64
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 172 deletions.
6 changes: 4 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,11 @@ If you are still confused by the different e2e/operator location, execution and
All e2e resources (host operator, member operator, registration-service, CRDs, etc) can be deployed without running tests:
* `make dev-deploy-e2e-local` - deploys the same resources as `make test-e2e-local` but doesn't run tests.
* `make dev-deploy-e2e-local` - deploys the same resources as `make test-e2e-local` in dev environment but doesn't run tests.
* `make dev-deploy-e2e` - deploys the same resources as `make test-e2e` but doesn't run tests.
* `make dev-deploy-e2e` - deploys the same resources as `make test-e2e` in dev environment but doesn't run tests.
* `make deploy-toolchain-resources-e2e` - deploys the same resources as `make test-e2e` but doesn't run tests.
NOTE: By default these targets deploy resources to `toolchain-host-operator` and `toolchain-member-operator` namespaces.
Expand Down
24 changes: 11 additions & 13 deletions make/dev.mk
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
DEV_MEMBER_NS := toolchain-member-operator
DEV_MEMBER_NS_2 := toolchain-member2-operator
DEV_HOST_NS := toolchain-host-operator
DEV_SSO_NS := toolchain-dev-sso
DEV_REGISTRATION_SERVICE_NS := $(DEV_HOST_NS)
DEV_ENVIRONMENT := dev

DEFAULT_HOST_NS= toolchain-host-operator
DEFAULT_MEMBER_NS= toolchain-member-operator
DEFAULT_MEMBER_NS_2= toolchain-member2-operator
SHOW_CLEAN_COMMAND="make clean-dev-resources"

.PHONY: dev-deploy-latest
Expand All @@ -25,12 +23,12 @@ dev-deploy-e2e-two-members: deploy-e2e-to-dev-namespaces-two-members print-reg-s

.PHONY: deploy-e2e-to-dev-namespaces
deploy-e2e-to-dev-namespaces:
$(MAKE) deploy-e2e MEMBER_NS=${DEV_MEMBER_NS} SECOND_MEMBER_MODE=false HOST_NS=${DEV_HOST_NS} REGISTRATION_SERVICE_NS=${DEV_REGISTRATION_SERVICE_NS} ENVIRONMENT=${DEV_ENVIRONMENT} E2E_TEST_EXECUTION=false IS_OSD=${IS_OSD} DEPLOY_LATEST=${DEPLOY_LATEST}
$(MAKE) deploy-e2e MEMBER_NS=${DEFAULT_MEMBER_NS} SECOND_MEMBER_MODE=false HOST_NS=${DEFAULT_HOST_NS} REGISTRATION_SERVICE_NS=${DEFAULT_HOST_NS} ENVIRONMENT=${DEV_ENVIRONMENT} E2E_TEST_EXECUTION=false IS_OSD=${IS_OSD} DEPLOY_LATEST=${DEPLOY_LATEST}
$(MAKE) setup-dev-sso DEV_SSO=${DEV_SSO}

.PHONY: deploy-e2e-to-dev-namespaces-two-members
deploy-e2e-to-dev-namespaces-two-members:
$(MAKE) deploy-e2e MEMBER_NS=${DEV_MEMBER_NS} MEMBER_NS_2=${DEV_MEMBER_NS_2} HOST_NS=${DEV_HOST_NS} REGISTRATION_SERVICE_NS=${DEV_REGISTRATION_SERVICE_NS} ENVIRONMENT=${DEV_ENVIRONMENT} E2E_TEST_EXECUTION=false IS_OSD=${IS_OSD}
$(MAKE) deploy-e2e MEMBER_NS=${DEFAULT_MEMBER_NS} MEMBER_NS_2=${DEFAULT_MEMBER_NS_2} HOST_NS=${DEFAULT_HOST_NS} REGISTRATION_SERVICE_NS=${DEFAULT_HOST_NS} ENVIRONMENT=${DEV_ENVIRONMENT} E2E_TEST_EXECUTION=false IS_OSD=${IS_OSD}
$(MAKE) setup-dev-sso DEV_SSO=${DEV_SSO}

setup-dev-sso:
Expand All @@ -46,12 +44,12 @@ dev-deploy-e2e-local-two-members: deploy-e2e-local-to-dev-namespaces-two-members

.PHONY: deploy-e2e-local-to-dev-namespaces
deploy-e2e-local-to-dev-namespaces:
$(MAKE) deploy-e2e-local MEMBER_NS=${DEV_MEMBER_NS} SECOND_MEMBER_MODE=false HOST_NS=${DEV_HOST_NS} REGISTRATION_SERVICE_NS=${DEV_REGISTRATION_SERVICE_NS} ENVIRONMENT=${DEV_ENVIRONMENT} E2E_TEST_EXECUTION=false IS_OSD=${IS_OSD}
$(MAKE) deploy-e2e-local MEMBER_NS=${DEFAULT_MEMBER_NS} SECOND_MEMBER_MODE=false HOST_NS=${DEFAULT_HOST_NS} REGISTRATION_SERVICE_NS=${DEFAULT_HOST_NS} ENVIRONMENT=${DEV_ENVIRONMENT} E2E_TEST_EXECUTION=false IS_OSD=${IS_OSD}
$(MAKE) setup-dev-sso DEV_SSO=${DEV_SSO}

.PHONY: deploy-e2e-local-to-dev-namespaces-two-members
deploy-e2e-local-to-dev-namespaces-two-members:
$(MAKE) deploy-e2e-local MEMBER_NS=${DEV_MEMBER_NS} MEMBER_NS_2=${DEV_MEMBER_NS_2} HOST_NS=${DEV_HOST_NS} REGISTRATION_SERVICE_NS=${DEV_REGISTRATION_SERVICE_NS} ENVIRONMENT=${DEV_ENVIRONMENT} E2E_TEST_EXECUTION=false IS_OSD=${IS_OSD}
$(MAKE) deploy-e2e-local MEMBER_NS=${DEFAULT_MEMBER_NS} MEMBER_NS_2=${DEFAULT_MEMBER_NS_2} HOST_NS=${DEFAULT_HOST_NS} REGISTRATION_SERVICE_NS=${DEFAULT_HOST_NS} ENVIRONMENT=${DEV_ENVIRONMENT} E2E_TEST_EXECUTION=false IS_OSD=${IS_OSD}
$(MAKE) setup-dev-sso DEV_SSO=${DEV_SSO}


Expand All @@ -61,7 +59,7 @@ print-reg-service-link:
@echo "Deployment complete!"
@echo "Waiting for the registration-service route being available"
@echo -n "."
@while [[ -z `oc get routes registration-service -n ${DEV_REGISTRATION_SERVICE_NS} 2>/dev/null || true` ]]; do \
@while [[ -z `oc get routes registration-service -n ${DEFAULT_HOST_NS} 2>/dev/null || true` ]]; do \
if [[ $${NEXT_WAIT_TIME} -eq 100 ]]; then \
echo ""; \
echo "The timeout of waiting for the registration-service route has been reached. Try to run 'make print-reg-service-link' later or check the deployment logs"; \
Expand All @@ -73,7 +71,7 @@ print-reg-service-link:
@echo ""
@echo "Waiting for the api route (that is used by proxy) being available"
@echo -n "."
@while [[ -z `oc get routes api -n ${DEV_REGISTRATION_SERVICE_NS} 2>/dev/null || true` ]]; do \
@while [[ -z `oc get routes api -n ${DEFAULT_HOST_NS} 2>/dev/null || true` ]]; do \
if [[ $${NEXT_WAIT_TIME} -eq 100 ]]; then \
echo ""; \
echo "The timeout of waiting for the api route (that is used by proxy) has been reached. Try to run 'make print-reg-service-link' later or check the deployment logs"; \
Expand All @@ -85,8 +83,8 @@ print-reg-service-link:
@echo ""
@echo ""
@echo "==========================================================================================================================================="
@echo Access the Landing Page here: https://$$(oc get routes registration-service -n ${DEV_REGISTRATION_SERVICE_NS} -o=jsonpath='{.spec.host}')
@echo Access Proxy here: https://$$(oc get routes api -n ${DEV_REGISTRATION_SERVICE_NS} -o=jsonpath='{.spec.host}')
@echo Access the Landing Page here: https://$$(oc get routes registration-service -n ${DEFAULT_HOST_NS} -o=jsonpath='{.spec.host}')
@echo Access Proxy here: https://$$(oc get routes api -n ${DEFAULT_HOST_NS} -o=jsonpath='{.spec.host}')
@echo "==========================================================================================================================================="
@echo ""
@echo "To clean the cluster run '${SHOW_CLEAN_COMMAND}'"
Expand Down
9 changes: 9 additions & 0 deletions make/test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ print-local-debug-info:
@echo 'os.Setenv("KUBECONFIG","$(or ${KUBECONFIG}, ${HOME}/.kube/config)")'
@echo 'os.Setenv("MEMBER_NS","${MEMBER_NS}")'
@echo 'os.Setenv("MEMBER_NS_2","${MEMBER_NS_2}")'
@echo 'os.Setenv("SECOND_MEMBER_MODE","true")'
@echo 'os.Setenv("HOST_NS","${HOST_NS}")'
@echo 'os.Setenv("REGISTRATION_SERVICE_NS","${REGISTRATION_SERVICE_NS}")'

Expand Down Expand Up @@ -268,6 +269,12 @@ setup-toolchainclusters: ksctl
oc delete pods --namespace ${HOST_NS} -l control-plane=controller-manager


.PHONY: deploy-single-member-e2e
## Deploy operators in e2e mode with single member without running tests
deploy-single-member-e2e:
$(MAKE) prepare-and-deploy-e2e SECOND_MEMBER_MODE=false HOST_NS=${DEFAULT_HOST_NS} MEMBER_NS=${DEFAULT_MEMBER_NS} REGISTRATION_SERVICE_NS=${DEFAULT_HOST_NS}


###########################################################
#
# Fetching and building Member and Host Operators
Expand Down Expand Up @@ -369,7 +376,9 @@ create-member1:

.PHONY: create-member2
create-member2:
@echo SECOND_MEMBER_MODE=$(SECOND_MEMBER_MODE)
ifeq ($(SECOND_MEMBER_MODE),true)
@echo SECOND_MEMBER_MODE inside=$(SECOND_MEMBER_MODE)
@echo "Preparing namespace for second member operator: ${MEMBER_NS_2}..."
$(MAKE) create-project PROJECT_NAME=${MEMBER_NS_2}
-oc label ns --overwrite=true ${MEMBER_NS_2} app=member-operator
Expand Down
94 changes: 0 additions & 94 deletions scripts/ci/collect-logs.sh

This file was deleted.

11 changes: 1 addition & 10 deletions scripts/ci/manage-host-operator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,7 @@ else
set -e
fi

MANAGE_OPERATOR_FILE=scripts/ci/manage-operator.sh
OWNER_AND_BRANCH_LOCATION=${OWNER_AND_BRANCH_LOCATION:-codeready-toolchain/toolchain-cicd/master}
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SCRIPT_NAME=$(basename ${MANAGE_OPERATOR_FILE})

if [[ -f ${SCRIPT_DIR}/${SCRIPT_NAME} ]]; then
source ${SCRIPT_DIR}/${SCRIPT_NAME}
else
source /dev/stdin <<< "$(curl -sSL https://raw.githubusercontent.com/${OWNER_AND_BRANCH_LOCATION}/${MANAGE_OPERATOR_FILE})"
fi
source scripts/ci/manage-operator.sh

if [[ -n "${CI}${REG_REPO_PATH}${HOST_REPO_PATH}" ]] && [[ $(echo ${REPO_NAME} | sed 's/"//g') != "release" ]]; then
REPOSITORY_NAME=registration-service
Expand Down
11 changes: 1 addition & 10 deletions scripts/ci/manage-member-operator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,7 @@ else
set -e
fi

MANAGE_OPERATOR_FILE=scripts/ci/manage-operator.sh
OWNER_AND_BRANCH_LOCATION=${OWNER_AND_BRANCH_LOCATION:-codeready-toolchain/toolchain-cicd/master}
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SCRIPT_NAME=$(basename ${MANAGE_OPERATOR_FILE})

if [[ -f ${SCRIPT_DIR}/${SCRIPT_NAME} ]]; then
source ${SCRIPT_DIR}/${SCRIPT_NAME}
else
source /dev/stdin <<< "$(curl -sSL https://raw.githubusercontent.com/${OWNER_AND_BRANCH_LOCATION}/${MANAGE_OPERATOR_FILE})"
fi
source scripts/ci/manage-operator.sh

if [[ -n "${CI}${MEMBER_REPO_PATH}" ]] && [[ $(echo ${REPO_NAME} | sed 's/"//g') != "release" ]]; then
REPOSITORY_NAME=member-operator
Expand Down
31 changes: 2 additions & 29 deletions scripts/ci/manage-operator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ else
fi

WAS_ALREADY_PAIRED_FILE=/tmp/toolchain_e2e_already_paired
OWNER_AND_BRANCH_LOCATION=${OWNER_AND_BRANCH_LOCATION:-codeready-toolchain/toolchain-cicd/master}

get_repo() {
PAIRED=false
Expand Down Expand Up @@ -204,8 +203,7 @@ install_operator() {
sleep 1
done
fi

# start_collecting_logs


CATALOG_SOURCE_OBJECT="
apiVersion: operators.coreos.com/v1alpha1
Expand Down Expand Up @@ -272,32 +270,7 @@ EOF
wait_until_is_installed
}


start_collecting_logs() {
COLLECT_LOGS=scripts/ci/collect-logs.sh
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SCRIPT_NAME=$(basename ${COLLECT_LOGS})

if [[ -f ${SCRIPT_DIR}/${SCRIPT_NAME} ]]; then
${SCRIPT_DIR}/${SCRIPT_NAME} -n ${NAMESPACE} &
${SCRIPT_DIR}/${SCRIPT_NAME} -n "openshift-operator-lifecycle-manager" &
else
SCRIPT_NAME=$(basename ${COLLECT_LOGS})
curl -sSL https://raw.githubusercontent.com/${OWNER_AND_BRANCH_LOCATION}/${COLLECT_LOGS} > /tmp/${SCRIPT_NAME} && chmod +x /tmp/${SCRIPT_NAME}
OWNER_AND_BRANCH_LOCATION=${OWNER_AND_BRANCH_LOCATION} /tmp/${SCRIPT_NAME} -n ${NAMESPACE} &
OWNER_AND_BRANCH_LOCATION=${OWNER_AND_BRANCH_LOCATION} /tmp/${SCRIPT_NAME} -n "openshift-operator-lifecycle-manager" &
fi
}

wait_until_is_installed() {
WAIT_UNTIL_IS_INSTALLED=scripts/ci/wait-until-is-installed.sh
PARAMS="-crd ${EXPECT_CRD} -cs ${CATALOGSOURCE_NAME} -n ${NAMESPACE} -s ${SUBSCRIPTION_NAME}"
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SCRIPT_NAME=$(basename ${WAIT_UNTIL_IS_INSTALLED})

if [[ -f ${SCRIPT_DIR}/${SCRIPT_NAME} ]]; then
${SCRIPT_DIR}/${SCRIPT_NAME} ${PARAMS}
else
curl -sSL https://raw.githubusercontent.com/${OWNER_AND_BRANCH_LOCATION}/${WAIT_UNTIL_IS_INSTALLED} > /tmp/${SCRIPT_NAME} && chmod +x /tmp/${SCRIPT_NAME} && OWNER_AND_BRANCH_LOCATION=${OWNER_AND_BRANCH_LOCATION} /tmp/${SCRIPT_NAME} ${PARAMS}
fi
scripts/ci/wait-until-is-installed.sh ${PARAMS}
}
10 changes: 1 addition & 9 deletions scripts/ci/setup-dev-sso.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,8 @@ check_command()
}

run_wait_until_is_installed() {
WAIT_UNTIL_IS_INSTALLED=scripts/ci/wait-until-is-installed.sh
PARAMS="-crd keycloak.org -cs '' -n ${DEV_SSO_NS} -s ${SUBSCRIPTION_NAME}"
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SCRIPT_NAME=$(basename ${WAIT_UNTIL_IS_INSTALLED})

if [[ -f ${SCRIPT_DIR}/${SCRIPT_NAME} ]]; then
${SCRIPT_DIR}/${SCRIPT_NAME} ${PARAMS}
else
curl -sSL https://raw.githubusercontent.com/${OWNER_AND_BRANCH_LOCATION}/${WAIT_UNTIL_IS_INSTALLED} > /tmp/${SCRIPT_NAME} && chmod +x /tmp/${SCRIPT_NAME} && OWNER_AND_BRANCH_LOCATION=${OWNER_AND_BRANCH_LOCATION} /tmp/${SCRIPT_NAME} ${PARAMS}
fi
scripts/ci/wait-until-is-installed.sh ${PARAMS}
}

setup_oauth_generic()
Expand Down
10 changes: 5 additions & 5 deletions testsupport/tiers/checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func (a *baseTierChecks) GetExpectedTemplateRefs(t *testing.T, hostAwait *wait.H

func (a *baseTierChecks) GetClusterObjectChecks() []clusterObjectsCheck {
return clusterObjectsChecks(
clusterResourceQuotaCompute(baseCPULimit, "6000m", "28Gi", "40Gi"),
clusterResourceQuotaCompute(baseCPULimit, "6000m", "28Gi", "60Gi"),
clusterResourceQuotaDeployments(),
clusterResourceQuotaReplicas(),
clusterResourceQuotaRoutes(),
Expand All @@ -223,7 +223,7 @@ func (a *base1nsTierChecks) GetNamespaceObjectChecks(_ string) []namespaceObject
checks := []namespaceObjectsCheck{
resourceQuotaComputeDeploy("20", "18Gi", "3", "18Gi"),
resourceQuotaComputeBuild("20", "14Gi", "3", "14Gi"),
resourceQuotaStorage("15Gi", "40Gi", "15Gi", "5"),
resourceQuotaStorage("15Gi", "60Gi", "15Gi", "5"),
limitRange("1", "1000Mi", "10m", "64Mi"),
numberOfLimitRanges(1),
execPodsRole(),
Expand Down Expand Up @@ -325,7 +325,7 @@ type baselargeTierChecks struct {

func (a *baselargeTierChecks) GetClusterObjectChecks() []clusterObjectsCheck {
return clusterObjectsChecks(
clusterResourceQuotaCompute(baseCPULimit, "6000m", "32Gi", "40Gi"),
clusterResourceQuotaCompute(baseCPULimit, "6000m", "32Gi", "60Gi"),
clusterResourceQuotaDeployments(),
clusterResourceQuotaReplicas(),
clusterResourceQuotaRoutes(),
Expand All @@ -344,7 +344,7 @@ type baseextendedidlingTierChecks struct {

func (a *baseextendedidlingTierChecks) GetClusterObjectChecks() []clusterObjectsCheck {
return clusterObjectsChecks(
clusterResourceQuotaCompute(baseCPULimit, "6000m", "28Gi", "40Gi"),
clusterResourceQuotaCompute(baseCPULimit, "6000m", "28Gi", "60Gi"),
clusterResourceQuotaDeployments(),
clusterResourceQuotaReplicas(),
clusterResourceQuotaRoutes(),
Expand Down Expand Up @@ -390,7 +390,7 @@ type advancedTierChecks struct {

func (a *advancedTierChecks) GetClusterObjectChecks() []clusterObjectsCheck {
return clusterObjectsChecks(
clusterResourceQuotaCompute(baseCPULimit, "6000m", "32Gi", "40Gi"),
clusterResourceQuotaCompute(baseCPULimit, "6000m", "32Gi", "60Gi"),
clusterResourceQuotaDeployments(),
clusterResourceQuotaReplicas(),
clusterResourceQuotaRoutes(),
Expand Down

0 comments on commit 22f4e64

Please sign in to comment.