Skip to content

Commit

Permalink
update setup.py, install.bash, and build-db.yml to use mongoDb 6.2 fo…
Browse files Browse the repository at this point in the history
…r mac-arch64
  • Loading branch information
kaixi-wang committed Oct 14, 2022
1 parent c637689 commit 797ff66
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ jobs:
run: |
cd package/db
python setup.py bdist_wheel --plat-name ${{ matrix.platform }}
- name: Build wheel (macOS Arm64)
if: ${{ matrix.platform == 'mac-arm64' }}
run: |
cd package/db
python setup.py bdist_wheel --plat-name mac-arm64
- name: Build wheel (Ubuntu 20.04 x86_64)
if: ${{ matrix.platform == 'linux-x86_64' }}
env:
Expand Down
28 changes: 21 additions & 7 deletions install.bash
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ done
set -e
NODE_VERSION=17.9.0
OS=$(uname -s)
ARCH=$(uname -m)

if [ ${SCRATCH_MONGODB_INSTALL} = true ]; then
echo "***** INSTALLING MONGODB *****"
Expand All @@ -57,26 +58,39 @@ if [ ${SCRATCH_MONGODB_INSTALL} = true ]; then
if [ -x bin/mongod ]; then
VERSION_FULL=$(bin/mongod --version | grep 'db version')
VERSION="${VERSION_FULL:12}"
if [ ${VERSION} != "5.0.4" ]; then
echo "Upgrading MongoDB v${VERSION} to v5.0.4"
if [ "${OS}" == "Darwin" ] && [ "${ARCH}" == "arm64" ]; then
if [ ${VERSION} != "6.0.2" ]; then
echo "Upgrading MongoDB v${VERSION} to v6.0.2"
else
echo "MongoDB v6.0.2 already installed"
INSTALL_MONGODB=false
fi
else
echo "MongoDB v5.0.4 already installed"
INSTALL_MONGODB=false
if [ ${VERSION} != "5.0.4" ]; then
echo "Upgrading MongoDB v${VERSION} to v5.0.4"
else
echo "MongoDB v5.0.4 already installed"
INSTALL_MONGODB=false
fi
fi
else
echo "Installing MongoDB v5.0.4"
fi
if [ ${INSTALL_MONGODB} = true ]; then
if [ "${OS}" == "Darwin" ]; then
MONGODB_BUILD=mongodb-macos-x86_64-5.0.4
MONGODB_VERSION=5.0.4
if [ "${OS}" == "Darwin" ]; then
if ["${ARCH}" == "arm64"]; then
MONGODB_VERSION=6.0.2
fi
MONGODB_BUILD=mongodb-macos-x86_64-${MONGODB_VERSION}

curl https://fastdl.mongodb.org/osx/${MONGODB_BUILD}.tgz --output mongodb.tgz
tar -zxvf mongodb.tgz
mv ${MONGODB_BUILD}/bin/* ./bin/
rm mongodb.tgz
rm -rf ${MONGODB_BUILD}
elif [ "${OS}" == "Linux" ]; then
MONGODB_BUILD=mongodb-linux-x86_64-ubuntu2004-5.0.4
MONGODB_BUILD=mongodb-linux-x86_64-ubuntu2004-${MONGODB_VERSION}

curl https://fastdl.mongodb.org/linux/${MONGODB_BUILD}.tgz --output mongodb.tgz
tar -zxvf mongodb.tgz
Expand Down
2 changes: 1 addition & 1 deletion package/db/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"linux-aarch64": "https://fastdl.mongodb.org/linux/mongodb-linux-aarch64-ubuntu1804-5.0.4.tgz",
"linux-i686": None,
"linux-x86_64": "https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1804-5.0.4.tgz",
"mac-arm64": None,
"mac-arm64": "https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-6.0.2.tgz",
"mac-x86_64": "https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-5.0.4.tgz",
"win-32": None,
"win-amd64": "https://fastdl.mongodb.org/windows/mongodb-windows-x86_64-5.0.4.zip",
Expand Down

0 comments on commit 797ff66

Please sign in to comment.