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

Master from 24_05_28 #6070

Merged
merged 24 commits into from
Mar 18, 2025
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
5e7717f
Update changelog entry for combining cohorts
pnrgenc Mar 10, 2025
8a82723
[SER-2235] - Save button naming in survey drawer
pnrgenc Mar 11, 2025
f1fba81
[SER-2236] Character limit exceeded issue in feedback widget
pnrgenc Mar 11, 2025
d4341e2
[SER-2341] Add error message when global admin tries to remove itself
pnrgenc Mar 11, 2025
e189c22
[SER-2320] Clickability issue of break points in charts
pnrgenc Mar 11, 2025
fadc52e
Merge branch 'release.24.05' into changelog-combining-multiple-cohorts
coskunaydinoglu Mar 13, 2025
390d00a
Merge pull request #6048 from Countly/changelog-combining-multiple-co…
coskunaydinoglu Mar 13, 2025
021c40f
Merge branch 'release.24.05' into SER-2320
coskunaydinoglu Mar 13, 2025
b5112d1
Merge pull request #6052 from Countly/SER-2320
coskunaydinoglu Mar 13, 2025
3cb3fa2
Merge branch 'release.24.05' into SER-2341
coskunaydinoglu Mar 13, 2025
1e9d226
Merge pull request #6051 from Countly/SER-2341
coskunaydinoglu Mar 13, 2025
a7af557
Merge branch 'release.24.05' into SER-2236
coskunaydinoglu Mar 13, 2025
3e4789a
Merge pull request #6050 from Countly/SER-2236
coskunaydinoglu Mar 13, 2025
263dd6e
Merge branch 'release.24.05' into SER-2335
coskunaydinoglu Mar 13, 2025
467d38e
Merge pull request #6049 from Countly/SER-2335
coskunaydinoglu Mar 13, 2025
3689be3
Mongodb 8
ar2rsawseen Mar 17, 2025
ff4b2e4
Merge branch 'release.24.05' into ar2rsawseen/24.05
ar2rsawseen Mar 17, 2025
b717add
Merge pull request #6061 from Countly/ar2rsawseen/24.05
ar2rsawseen Mar 17, 2025
ed7ad2e
Update CHANGELOG.md
coskunaydinoglu Mar 18, 2025
5ae346f
Merge pull request #6069 from Countly/coskunaydinoglu-patch-10
coskunaydinoglu Mar 18, 2025
16b56f9
Merge branch 'release.24.05' into release.24.10
coskunaydinoglu Mar 18, 2025
c5bfffd
Merge branch 'master_from_24_05_28'
coskunaydinoglu Mar 18, 2025
3dde493
Update CHANGELOG.md
coskunaydinoglu Mar 18, 2025
482d899
Update CHANGELOG.md
coskunaydinoglu Mar 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Mongodb 8
ar2rsawseen committed Mar 17, 2025
commit 3689be39d991cda4ba6739610c96de7640d45e10
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -69,7 +69,7 @@ jobs:

services:
mongodb:
image: mongo:6.0
image: mongo:8.0
options: >-
--health-cmd mongosh
--health-interval 10s
@@ -126,7 +126,7 @@ jobs:

services:
mongodb:
image: mongo:6.0
image: mongo:8.0
options: >-
--health-cmd mongosh
--health-interval 10s
@@ -173,7 +173,7 @@ jobs:

services:
mongodb:
image: mongo:6.0
image: mongo:8.0
options: >-
--health-cmd mongosh
--health-interval 10s
@@ -226,7 +226,7 @@ jobs:

services:
mongodb:
image: mongo:6.0
image: mongo:8.0
options: >-
--health-cmd mongosh
--health-interval 10s
@@ -304,7 +304,7 @@ jobs:

services:
mongodb:
image: mongo:6.0
image: mongo:8.0
options: >-
--health-cmd mongosh
--health-interval 10s
14 changes: 7 additions & 7 deletions bin/scripts/mongodb.install.sh
Original file line number Diff line number Diff line change
@@ -341,12 +341,12 @@ if [ $# -eq 0 ]; then
exit 1
fi

echo "[mongodb-org-6.0]
echo "[mongodb-org-8.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/${CENTOS_MAJOR}/mongodb-org/6.0/x86_64/
baseurl=https://repo.mongodb.org/yum/redhat/${CENTOS_MAJOR}/mongodb-org/8.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-6.0.asc" > /etc/yum.repos.d/mongodb-org-6.0.repo
gpgkey=https://pgp.mongodb.com/server-8.0.asc" > /etc/yum.repos.d/mongodb-org-8.0.repo

yum install -y mongodb-org
elif [ -f /etc/lsb-release ]; then
@@ -359,12 +359,12 @@ gpgkey=https://www.mongodb.org/static/pgp/server-6.0.asc" > /etc/yum.repos.d/mon
exit 1
fi

wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu ${UBUNTU_RELEASE}/mongodb-org/6.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-6.0.list ;
curl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-8.0.gpg --dearmor
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu ${UBUNTU_RELEASE}/mongodb-org/8.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list
apt-get update
DEBIAN_FRONTEND="noninteractive" apt-get install -y mongodb-org || (echo "Failed to install mongodb." ; exit)
else
echo "Unsupported OS or version, only CentOS/RHEL 8 or 9 and Ubuntu 20 or 22."
echo "Unsupported OS or version, only CentOS/RHEL 8 or 9 and Ubuntu 20 or 22 or 24."
exit 1
fi

@@ -380,4 +380,4 @@ elif [ "$1" == "configure" ]; then
else
mongodb_configure
fi
fi
fi
146 changes: 146 additions & 0 deletions bin/upgrade/mongodb8/upgrade.mongo.70.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
#!/bin/bash

#we have to check since we cannot continue unless
if [ -f /etc/redhat-release ]; then
CENTOS_MAJOR="$(cat /etc/redhat-release |awk -F'[^0-9]+' '{ print $2 }')"

if [[ "$CENTOS_MAJOR" != "8" && "$CENTOS_MAJOR" != "9" ]]; then
echo "Unsupported OS version, only support CentOS/RHEL 8 and 9."
exit 1
fi
fi

if [ -f /etc/lsb-release ]; then
UBUNTU_YEAR="$(lsb_release -sr | cut -d '.' -f 1)";
UBUNTU_RELEASE="$(lsb_release -cs)"

if [[ "$UBUNTU_YEAR" != "20" && "$UBUNTU_YEAR" != "22" ]]; then
echo "Unsupported OS version, only support Ubuntu 20 and 22."
exit 1
fi
fi

#check if authentication is required
isAuth=0
if grep -Eq '^\s*authorization\s*:\s*enabled' /etc/mongod.conf; then
isAuth=1
fi

#check if we have previous upgrade needed
FEATVER=$(mongosh admin --eval "printjson(db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } ).featureCompatibilityVersion)" --quiet);
VER=$(mongod -version | grep "db version" | cut -d ' ' -f 3 | cut -d 'v' -f 2)

if [ "$isAuth" -eq "1" ]; then
echo "Since authentication is enabled, we cannot verify if you need to run this upgrade script"
echo ""
echo "Please run this command with authentication parameters:"
echo ""
echo "mongosh admin --eval \"db.adminCommand({ getParameter: 1, featureCompatibilityVersion: 1 } )\""
echo ""
echo "and continue only if \"featureCompatibilityVersion\" is 6.0 "
echo ""
read -r -p "Is your \"featureCompatibilityVersion\" version is 6.0? [y/N] " response
if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]
then
echo "Continue upgrading"
else
echo "Stopping script"
exit 0;
fi

fi

if [ -x "$(command -v mongosh)" ]; then
if echo "$VER" | grep -q -i "7.0" ; then
if echo "$FEATVER" | grep -q -i "6.0" ; then
echo "run this command to upgrade to 7.0";
echo "mongosh admin --eval \"db.adminCommand( { setFeatureCompatibilityVersion: \\\"7.0\\\" } )\"";
else
echo "We already have version 7.0";
fi
exit 0;
elif echo "$VER" | grep -q -i "6.0" ; then
if echo "$FEATVER" | grep -q -i "5.0" ; then
echo "run this command before upgrading to 7.0";
echo "mongosh admin --eval \"db.adminCommand( { setFeatureCompatibilityVersion: \\\"6.0\\\" } )\"";
exit 0;
else
echo "Upgrading to MongoDB 7.0";
fi
else
echo "Unsupported MongodB version $VER";
echo "Upgrade to MongoDB 6.0 first and then run this script";
exit 1;
fi

if [ -f /etc/redhat-release ]; then
#backup of systemd unit file and mongod.conf file
\cp /usr/lib/systemd/system/mongod.service /usr/lib/systemd/system/mongod.service.bak
\cp -f /etc/mongod.conf /etc/mongod.conf.bak
#uninstall mognodb
yum erase -y mongodb-org mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools
fi

if [ -f /etc/lsb-release ]; then
#uninstall mognodb
apt-get remove -y mongodb-org mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools
fi
fi

if [ -f /etc/redhat-release ]; then
#install latest mongodb
#select source based on release
echo "[mongodb-org-7.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/${CENTOS_MAJOR}/mongodb-org/7.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-7.0.asc" > /etc/yum.repos.d/mongodb-org-7.0.repo

yum install -y mongodb-org
\cp -f /etc/mongod.conf.bak /etc/mongod.conf
fi

if [ -f /etc/lsb-release ]; then
#install latest mongodb
wget -qO - https://www.mongodb.org/static/pgp/server-7.0.asc | sudo apt-key add -

echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu ${UBUNTU_RELEASE}/mongodb-org/7.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-7.0.list ;
apt-get update
#install mongodb
apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install -y mongodb-org --force-yes || (echo "Failed to install mongodb." ; exit)
fi

if [ -f /etc/redhat-release ]; then
#Restoring systemd unit file
\cp -f /usr/lib/systemd/system/mongod.service.bak /usr/lib/systemd/system/mongod.service
systemctl daemon-reload
fi

# check and comment out journal: enabled: true in mongod.conf
CONF_FILE="/etc/mongod.conf"
if grep -qP '^\s*journal\s*:\s*$' "$CONF_FILE" && grep -qP '^\s*enabled\s*:\s*true\s*$' "$CONF_FILE"; then
echo "Commenting out journal: enabled: true in $CONF_FILE"
sed -i '/^\s*journal\s*:/ { N; s/\(.*\n\s*\)\(enabled\s*:\s*true\s*$\)/# \1# \2/ }' "$CONF_FILE"
else
echo "Could not find 'journal: enabled: true' in $CONF_FILE or it's already commented."
fi

#mongodb might need to be started
systemctl restart mongod || echo "mongodb systemctl job does not exist"

#nc not available on latest centos
#until nc -z localhost 27017; do echo Waiting for MongoDB; sleep 1; done
mongosh --nodb --eval 'var conn; print("Waiting for MongoDB connection on port 27017. Exit if incorrect port"); var cnt = 0; while(!conn && cnt <= 300){try{conn = new Mongo("localhost:27017");}catch(Error){}sleep(1000);cnt++;}'

if [ "$isAuth" -eq "1" ]; then
echo "run this command with authentication to upgrade to 7.0"
echo "mongosh admin --eval \"db.adminCommand( { setFeatureCompatibilityVersion: \\\"7.0\\\" } )\""
elif ! mongosh admin --eval "printjson(db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } ))" ; then
echo "Could not connect to MongodB, run this command when Mongo is up and running"
echo "mongosh admin --eval \"db.adminCommand( { setFeatureCompatibilityVersion: \\\"7.0\\\" } )\""
else
mongosh admin --eval "printjson(db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } ))"
mongosh admin --eval "db.adminCommand( { setFeatureCompatibilityVersion: \"7.0\", confirm: true } )"
echo "Finished upgrading script"
fi
138 changes: 138 additions & 0 deletions bin/upgrade/mongodb8/upgrade.mongo.80.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
#!/bin/bash

#we have to check since we cannot continue unless
if [ -f /etc/redhat-release ]; then
CENTOS_MAJOR="$(cat /etc/redhat-release |awk -F'[^0-9]+' '{ print $2 }')"

if [[ "$CENTOS_MAJOR" != "8" && "$CENTOS_MAJOR" != "9" ]]; then
echo "Unsupported OS version, only support CentOS/RHEL 8 and 9."
exit 1
fi
fi

if [ -f /etc/lsb-release ]; then
UBUNTU_YEAR="$(lsb_release -sr | cut -d '.' -f 1)";
UBUNTU_RELEASE="$(lsb_release -cs)"

if [[ "$UBUNTU_YEAR" != "20" && "$UBUNTU_YEAR" != "22" && "$UBUNTU_YEAR" != "24" ]]; then
echo "Unsupported OS version, only support Ubuntu 20 and 22 and 24."
exit 1
fi
fi

#check if authentication is required
isAuth=0
if grep -Eq '^\s*authorization\s*:\s*enabled' /etc/mongod.conf; then
isAuth=1
fi

#check if we have previous upgrade needed
FEATVER=$(mongosh admin --eval "printjson(db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } ).featureCompatibilityVersion)" --quiet);
VER=$(mongod -version | grep "db version" | cut -d ' ' -f 3 | cut -d 'v' -f 2)

if [ "$isAuth" -eq "1" ]; then
echo "Since authentication is enabled, we cannot verify if you need to run this upgrade script"
echo ""
echo "Please run this command with authentication parameters:"
echo ""
echo "mongosh admin --eval \"db.adminCommand({ getParameter: 1, featureCompatibilityVersion: 1 } )\""
echo ""
echo "and continue only if \"featureCompatibilityVersion\" is 7.0 "
echo ""
read -r -p "Is your \"featureCompatibilityVersion\" version is 7.0? [y/N] " response
if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]
then
echo "Continue upgrading"
else
echo "Stopping script"
exit 0;
fi

fi

if [ -x "$(command -v mongosh)" ]; then
if echo "$VER" | grep -q -i "8.0" ; then
if echo "$FEATVER" | grep -q -i "7.0" ; then
echo "run this command to upgrade to 8.0";
echo "mongosh admin --eval \"db.adminCommand( { setFeatureCompatibilityVersion: \\\"8.0\\\", confirm: true } )\"";
else
echo "We already have version 8.0";
fi
exit 0;
elif echo "$VER" | grep -q -i "7.0" ; then
if echo "$FEATVER" | grep -q -i "6.0" ; then
echo "run this command before upgrading to 8.0 and rerunning this script";
echo "mongosh admin --eval \"db.adminCommand( { setFeatureCompatibilityVersion: \\\"7.0\\\", confirm: true } )\"";
exit 0;
else
echo "Upgrading to MongoDB 8.0";
fi
else
echo "Unsupported MongodB version $VER";
echo "Upgrade to MongoDB 7.0 first and then run this script";
exit 1;
fi

if [ -f /etc/redhat-release ]; then
#backup of systemd unit file and mongod.conf file
\cp /usr/lib/systemd/system/mongod.service /usr/lib/systemd/system/mongod.service.bak
\cp -f /etc/mongod.conf /etc/mongod.conf.bak
#uninstall mognodb
yum erase -y mongodb-org mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools
fi

if [ -f /etc/lsb-release ]; then
#uninstall mognodb
apt-get remove -y mongodb-org mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools
fi
fi

if [ -f /etc/redhat-release ]; then
#install latest mongodb
#select source based on release
echo "[mongodb-org-8.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/${CENTOS_MAJOR}/mongodb-org/8.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://pgp.mongodb.com/server-8.0.asc" > /etc/yum.repos.d/mongodb-org-8.0.repo

yum install -y mongodb-org
\cp -f /etc/mongod.conf.bak /etc/mongod.conf
fi

if [ -f /etc/lsb-release ]; then
#install latest mongodb
curl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-8.0.gpg --dearmor

echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu ${UBUNTU_RELEASE}/mongodb-org/8.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list
apt-get update
#install mongodb
apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install -y mongodb-org --force-yes || (echo "Failed to install mongodb." ; exit)
fi

if [ -f /etc/redhat-release ]; then
#Restoring systemd unit file
\cp -f /usr/lib/systemd/system/mongod.service.bak /usr/lib/systemd/system/mongod.service
systemctl daemon-reload
fi

#mongodb might need to be started
systemctl restart mongod || echo "mongodb systemctl job does not exist"

#nc not available on latest centos
#until nc -z localhost 27017; do echo Waiting for MongoDB; sleep 1; done
mongosh --nodb --eval 'var conn; print("Waiting for MongoDB connection on port 27017. Exit if incorrect port"); var cnt = 0; while(!conn && cnt <= 300){try{conn = new Mongo("localhost:27017");}catch(Error){}sleep(1000);cnt++;}'

if [ "$isAuth" -eq "1" ]; then
echo "run this command with authentication to upgrade to 8.0"
# shellcheck disable=SC2028
echo "mongosh admin --eval \"db.adminCommand( { setFeatureCompatibilityVersion: \\\8.0\\\", confirm: true } )\""
elif ! mongosh admin --eval "printjson(db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } ))" ; then
echo "Could not connect to MongodB, run this command when Mongo is up and running"
echo "mongosh admin --eval \"db.adminCommand( { setFeatureCompatibilityVersion: \\\"8.0\\\", confirm: true } )\""
else
mongosh admin --eval "printjson(db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } ))"
mongosh admin --eval "db.adminCommand( { setFeatureCompatibilityVersion: \"8.0\", confirm: true } )"
echo "Finished upgrading script"
fi