-
Notifications
You must be signed in to change notification settings - Fork 31
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
base: main
Are you sure you want to change the base?
Conversation
fd86755
to
d2b6712
Compare
There was a problem hiding this 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?
docker/ceph/start-ceph.sh
Outdated
@@ -18,15 +18,29 @@ if [[ "$FRONTEND_BUILD_REQUIRED" == 1 ]]; then | |||
npm update @angular/cli | |||
fi | |||
|
|||
npm ci | |||
if [[ "$CEPH_MULTICLUSTER" != '1' ]]; then | |||
npm ci |
There was a problem hiding this comment.
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
.
docker/ceph/start-ceph.sh
Outdated
|
||
if [[ -z "${DASHBOARD_URL}" ]]; then | ||
if [[ -z "${DASHBOARD_URL}" ]]; then | ||
# Required to run dashboard python module. | ||
npm run build |
There was a problem hiding this comment.
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.
docker/ceph/start-ceph.sh
Outdated
else | ||
# Wait until the npm is finished for first cluster | ||
echo "Waiting for npm to finish..." | ||
sleep 180 |
There was a problem hiding this comment.
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]>
d2b6712
to
66471c3
Compare
@@ -2,6 +2,8 @@ | |||
|
|||
set -e | |||
|
|||
source /docker/set-mstart-env.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
echo "export $1" >> /root/.bashrc | ||
} | ||
|
||
echo $NUMBER_OF_CLUSTERS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
echo $NUMBER_OF_CLUSTERS | ||
declare -a CEPH_BIN_LIST | ||
declare -a CEPH_CLUSTERS | ||
for (( cluster=1; cluster<=$NUMBER_OF_CLUSTERS; cluster++ )); do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"$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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -1,14 +1,15 @@ | |||
#!/bin/bash | |||
|
|||
set -e | |||
source /docker/set-mstart-env.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
echo $CEPH1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -2,6 +2,8 @@ | |||
|
|||
set -e | |||
|
|||
source /docker/set-mstart-env.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Depends on ceph/ceph#47371
Adapting the script to run with the mstart.
I introduced a new variable called
NUMBER_OF_CLUSTERS
. All theclusters 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
Signed-off-by: Nizamudeen A [email protected]