Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve multicluster support #62

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

nizamial09
Copy link
Member

@nizamial09 nizamial09 commented Jun 27, 2022

Depends on ceph/ceph#47371

Adapting the script to run with the mstart.
I introduced a new variable called NUMBER_OF_CLUSTERS. All the
clusters deployed are on the same container but the dashboard is
accessbile on different ports.

The first port is configurable and a 100 will be added to the ports of
next cluster

for eg. CEPH1 is in 11000 and CEPH2 is in 11100 and CEPH3 is in
11200....

This will co-exist with the current approach of two cluster support.

LIMITATIONS SO FAR

  • DEV SERVER ON FIRST CLUSTER ONLY
  • localhost:11000 is somehow not there :(
  • MONITORING STACKS CAN ONLY DEPLOYED ON FIRST CLUSTER

Signed-off-by: Nizamudeen A [email protected]

@nizamial09 nizamial09 requested a review from epuertat June 27, 2022 06:51
@nizamial09 nizamial09 force-pushed the multi-cluster-fixes branch from fd86755 to d2b6712 Compare June 27, 2022 06:54
@pereman2 pereman2 self-requested a review June 27, 2022 09:18
Copy link
Member

@epuertat epuertat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not going with mstart here when MULTICLUSTER is enabled instead of using 2 ceph-dev clusters?

@@ -18,15 +18,29 @@ if [[ "$FRONTEND_BUILD_REQUIRED" == 1 ]]; then
npm update @angular/cli
fi

npm ci
if [[ "$CEPH_MULTICLUSTER" != '1' ]]; then
npm ci
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps a good chance to replace this with npm i (keeps the downloaded node_modules and only installs the changed ones)? npm ci deletes the node_modules dir. I find frustrating that after starting ceph-dev it always takes so long to download and build everything.

If we find that we need a clean install we could add some NPM_CLEAN_INSTALL=1.


if [[ -z "${DASHBOARD_URL}" ]]; then
if [[ -z "${DASHBOARD_URL}" ]]; then
# Required to run dashboard python module.
npm run build
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I wish we could also speed this up by only rebuilding if not there or only incremental builds like the ones from the ng serve instance.

else
# Wait until the npm is finished for first cluster
echo "Waiting for npm to finish..."
sleep 180
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed waits make cry! There are always better ways to avoid and use some busy wait.

Adapting the script to run with the mstart.
I introduced a new variable called `NUMBER_OF_CLUSTERS`. All the
clusters deployed are on the same container but the dashboard is
accessbile on different ports.

The first port is configurable and a 100 will be added to the ports of
next cluster.

for eg. CEPH1 is in 11000 and CEPH2 is in 11100 and CEPH3 is in
11200....

LIMITATIONS SO FAR
DEV SERVER ON FIRST CLUSTER ONLY
localhost:11000 is somehow not there :(
MONITORING STACKS CAN ONLY DEPLOYED ON FIRST CLUSTER

Signed-off-by: Nizamudeen A <[email protected]>
@nizamial09 nizamial09 force-pushed the multi-cluster-fixes branch from d2b6712 to 66471c3 Compare July 31, 2022 15:22
@@ -2,6 +2,8 @@

set -e

source /docker/set-mstart-env.sh

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [shellcheck] reported by reviewdog 🐶
Not following: /docker/set-mstart-env.sh: openBinaryFile: does not exist (No such file or directory) SC1091

@@ -264,12 +266,15 @@ run_frontend_e2e_tests() {

DASHBOARD_URL=null
while [[ "${DASHBOARD_URL}" == 'null' ]]; do
export DASHBOARD_URL=$("$CEPH_BIN"/ceph mgr services | jq -r .dashboard)
export DASHBOARD_URL=$(CEPH_CLI mgr services | jq -r .dashboard)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [shellcheck] reported by reviewdog 🐶
Declare and assign separately to avoid masking return values. SC2155

@@ -264,12 +266,15 @@ run_frontend_e2e_tests() {

DASHBOARD_URL=null
while [[ "${DASHBOARD_URL}" == 'null' ]]; do
export DASHBOARD_URL=$("$CEPH_BIN"/ceph mgr services | jq -r .dashboard)
export DASHBOARD_URL=$(CEPH_CLI mgr services | jq -r .dashboard)
export DASHBOARD2_URL=$(CEPH2_CLI mgr services | jq -r .dashboard)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [shellcheck] reported by reviewdog 🐶
Declare and assign separately to avoid masking return values. SC2155

echo "export $1" >> /root/.bashrc
}

echo $NUMBER_OF_CLUSTERS

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [shellcheck] reported by reviewdog 🐶
Double quote to prevent globbing and word splitting. SC2086

echo $NUMBER_OF_CLUSTERS
declare -a CEPH_BIN_LIST
declare -a CEPH_CLUSTERS
for (( cluster=1; cluster<=$NUMBER_OF_CLUSTERS; cluster++ )); do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[shellcheck] reported by reviewdog 🐶
$/${} is unnecessary on arithmetic variables. SC2004

@@ -75,8 +90,8 @@ if [[ "$DASHBOARD_SSL" == 0 && "$VSTART_HAS_SSL_FLAG" == 0 && "$IS_FIRST_CLUSTER
SSL_OPTIONS=''
fi

"$CEPH_BIN"/ceph config set mgr mgr/dashboard/ssl false $SSL_OPTIONS
"$CEPH_BIN"/ceph config set mgr mgr/dashboard/x/server_port "$CEPH_MGR_DASHBOARD_PORT" $SSL_OPTIONS
CEPH_CLI_ALL config set mgr mgr/dashboard/ssl false $SSL_OPTIONS

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [shellcheck] reported by reviewdog 🐶
Double quote to prevent globbing and word splitting. SC2086

"$CEPH_BIN"/ceph config set mgr mgr/dashboard/ssl false $SSL_OPTIONS
"$CEPH_BIN"/ceph config set mgr mgr/dashboard/x/server_port "$CEPH_MGR_DASHBOARD_PORT" $SSL_OPTIONS
CEPH_CLI_ALL config set mgr mgr/dashboard/ssl false $SSL_OPTIONS
CEPH_CLI_ALL config set mgr mgr/dashboard/x/server_port "$CEPH_MGR_DASHBOARD_PORT" $SSL_OPTIONS

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [shellcheck] reported by reviewdog 🐶
Double quote to prevent globbing and word splitting. SC2086

@@ -1,14 +1,15 @@
#!/bin/bash

set -e
source /docker/set-mstart-env.sh

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [shellcheck] reported by reviewdog 🐶
Not following: /docker/set-mstart-env.sh: openBinaryFile: does not exist (No such file or directory) SC1091


echo $CEPH1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [shellcheck] reported by reviewdog 🐶
Double quote to prevent globbing and word splitting. SC2086

@@ -2,6 +2,8 @@

set -e

source /docker/set-mstart-env.sh

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [shellcheck] reported by reviewdog 🐶
Not following: /docker/set-mstart-env.sh: openBinaryFile: does not exist (No such file or directory) SC1091

@nizamial09 nizamial09 added the DNM label Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants