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

DRIVERS-3030 Ensure mongosh download is properly working #540

Merged
merged 40 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
add3c03
DRIVERS-3030 Ensure mongosh runs sucessfully
blink1073 Nov 2, 2024
411c49a
fix path
blink1073 Nov 2, 2024
9eaffe2
fix path
blink1073 Nov 2, 2024
dc3a7cf
fix suffix handling
blink1073 Nov 2, 2024
377419e
fixups
blink1073 Nov 2, 2024
9cdd39c
syntax
blink1073 Nov 2, 2024
24cc9ce
fixups
blink1073 Nov 2, 2024
775a6a9
fix unbound
blink1073 Nov 2, 2024
cffad1f
fix make
blink1073 Nov 2, 2024
95a730a
cleanup
blink1073 Nov 2, 2024
e4a41b6
fix test
blink1073 Nov 2, 2024
255b743
debug
blink1073 Nov 2, 2024
040dc2c
debug
blink1073 Nov 2, 2024
7778075
new version
blink1073 Nov 2, 2024
b8c8e69
try with test
blink1073 Nov 2, 2024
62f35b6
more debug
blink1073 Nov 2, 2024
e82e100
speed it up
blink1073 Nov 2, 2024
48c2851
fix debug
blink1073 Nov 2, 2024
b76200a
debug
blink1073 Nov 2, 2024
990afca
try handling openssl11
blink1073 Nov 2, 2024
874e690
cleanup
blink1073 Nov 2, 2024
d7409af
try debian12 again
blink1073 Nov 2, 2024
ee5a740
try win fix
blink1073 Nov 2, 2024
758ddd1
debug windows
blink1073 Nov 2, 2024
75b90fd
debug rhel8
blink1073 Nov 2, 2024
14d9488
try win fix
blink1073 Nov 2, 2024
b6a49c7
debug
blink1073 Nov 2, 2024
0a6c37d
debug
blink1073 Nov 2, 2024
e86a389
try a newer amazonlinux
blink1073 Nov 2, 2024
3cb8648
try openssl11
blink1073 Nov 2, 2024
359c0e9
win debug
blink1073 Nov 2, 2024
4fce8bc
debug openssl
blink1073 Nov 2, 2024
28053d5
debug openssl
blink1073 Nov 2, 2024
6e95f19
win debug
blink1073 Nov 2, 2024
8baa82a
fix openssl
blink1073 Nov 2, 2024
d29585d
cleanup
blink1073 Nov 2, 2024
30fbf93
syntax
blink1073 Nov 2, 2024
1e6c978
cleanup
blink1073 Nov 2, 2024
9f88456
cleanup
blink1073 Nov 2, 2024
2a62e84
lint
blink1073 Nov 4, 2024
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
48 changes: 7 additions & 41 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -512,52 +512,18 @@ functions:
make test

"run mongodl test partial":
- command: shell.exec
- command: subprocess.exec
type: test
params:
shell: bash
script: |-
set -o errexit
cd ${DRIVERS_TOOLS}/.evergreen
. find-python3.sh
PYTHON=$(ensure_python3)
echo "Using PYTHON: $PYTHON"
$PYTHON mongodl.py --edition enterprise --version 7.0 --component archive-debug --no-download
$PYTHON mongodl.py --edition enterprise --version 7.0 --component cryptd --test
$PYTHON mongosh-dl.py --no-download
$PYTHON mongosh-dl.py --version 2.1.1 --no-download
$PYTHON mongosh-dl.py --version 2.1.1 --out $(pwd)
binary: bash
args: [src/.evergreen/tests/test-mongodl.sh, partial]

"run mongodl test full":
- command: shell.exec
- command: subprocess.exec
type: test
params:
shell: bash
script: |-
set -o errexit
cd ${DRIVERS_TOOLS}/.evergreen
. find-python3.sh
PYTHON=$(ensure_python3 2>/dev/null)
echo "Using PYTHON: $PYTHON"
# Ensure that all distros are accounted for in DISTRO_ID_TO_TARGET
export VALIDATE_DISTROS=1
$PYTHON mongodl.py --list
if [ "$OS" != "Windows_NT" ]; then
$PYTHON mongodl.py --edition enterprise --version 7.0.1 --component archive-debug --test
fi
$PYTHON mongodl.py --edition enterprise --version 3.6 --component archive --test
$PYTHON mongodl.py --edition enterprise --version 4.0 --component archive --test
$PYTHON mongodl.py --edition enterprise --version 4.2 --component archive --test
$PYTHON mongodl.py --edition enterprise --version 4.4 --component archive --test
$PYTHON mongodl.py --edition enterprise --version 5.0 --component archive --test
$PYTHON mongodl.py --edition enterprise --version 6.0 --component crypt_shared --test
$PYTHON mongodl.py --edition enterprise --version 8.0 --component archive --test
$PYTHON mongodl.py --edition enterprise --version rapid --component archive --test
$PYTHON mongodl.py --edition enterprise --version latest --component archive --out $(pwd)
$PYTHON mongodl.py --edition enterprise --version v6.0-perf --component cryptd --test
$PYTHON mongodl.py --edition enterprise --version v8.0-perf --component cryptd --test
$PYTHON mongosh-dl.py --no-download
$PYTHON mongosh-dl.py --version 2.1.1 --out $(pwd)
binary: bash
args: [src/.evergreen/tests/test-mongodl.sh]

"teardown assets":
- command: subprocess.exec
Expand Down Expand Up @@ -1287,7 +1253,7 @@ axes:

- id: amazon-2023-x64
display_name: "Amazon Linux 2023 x64"
run_on: amazon2023.0-small
run_on: amazon2023.3-small

- id: macos-14-arm64
display_name: "macOS 14 arm64"
Expand Down
11 changes: 9 additions & 2 deletions .evergreen/mongosh-dl.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,21 @@ def _download(out_dir: Path, version: str, target: str,
elif arch == "aarch64":
arch = "arm64"
if target == "linux":
suffix = ".tgz"
suffix = '.tgz'
if sys.platform == 'linux' and arch in ["x64", "arm64"]:
openssl = subprocess.check_output(["openssl", "version"])
if "3.0" in openssl.decode('utf-8'):
suffix = "-openssl3.tgz"
elif "1.1" in openssl.decode('utf-8'):
suffix = "-openssl11.tgz"
else:
suffix = ".zip"
dl_url = f"https://downloads.mongodb.com/compass/mongosh-{version}-{target}-{arch}{suffix}"
print(dl_url)

if no_download:
print(dl_url)
return ExpandResult.Okay

req = urllib.request.Request(dl_url)
resp = urllib.request.urlopen(req)

Expand Down
59 changes: 59 additions & 0 deletions .evergreen/tests/test-mongodl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/usr/bin/env bash

# Test mongodl and mongosh-dl.
set -eux

SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]})
. $SCRIPT_DIR/../handle-paths.sh

pushd $SCRIPT_DIR/..

. find-python3.sh
PYTHON=$(ensure_python3)
echo "Using PYTHON: $PYTHON"
DOWNLOAD_DIR=mongodl_test

if [ "${OS:-}" != "Windows_NT" ]; then
$PYTHON mongodl.py --edition enterprise --version 7.0 --component archive-debug --no-download
else
DOWNLOAD_DIR=$(cygpath -m $DOWNLOAD_DIR)
fi

$PYTHON mongodl.py --edition enterprise --version 7.0 --component archive --test
$PYTHON mongodl.py --edition enterprise --version 7.0 --component cryptd --out ${DOWNLOAD_DIR} --strip-path-components 1
$PYTHON mongosh-dl.py --no-download
$PYTHON mongosh-dl.py --version 2.1.1 --no-download

export PATH="${DOWNLOAD_DIR}/bin:$PATH"
if [ "${OS:-}" != "Windows_NT" ]; then
$PYTHON mongosh-dl.py --version 2.1.1 --out ${DOWNLOAD_DIR} --strip-path-components 1
chmod +x ./mongodl_test/bin/mongosh
./mongodl_test/bin/mongosh --version
else
$PYTHON mongosh-dl.py --version 2.1.1 --out ${DOWNLOAD_DIR} --strip-path-components 1
fi

if [ ${1:-} == "partial" ]; then
popd
make -C ${DRIVERS_TOOLS} test
exit 0
fi

# Ensure that all distros are accounted for in DISTRO_ID_TO_TARGET
export VALIDATE_DISTROS=1
$PYTHON mongodl.py --list
$PYTHON mongodl.py --edition enterprise --version 7.0.6 --component archive --no-download
$PYTHON mongodl.py --edition enterprise --version 3.6 --component archive --test
$PYTHON mongodl.py --edition enterprise --version 4.0 --component archive --test
$PYTHON mongodl.py --edition enterprise --version 4.2 --component archive --test
$PYTHON mongodl.py --edition enterprise --version 4.4 --component archive --test
$PYTHON mongodl.py --edition enterprise --version 5.0 --component archive --test
$PYTHON mongodl.py --edition enterprise --version 6.0 --component crypt_shared --test
$PYTHON mongodl.py --edition enterprise --version 8.0 --component archive --test
$PYTHON mongodl.py --edition enterprise --version rapid --component archive --test
$PYTHON mongodl.py --edition enterprise --version latest --component archive --out ${DOWNLOAD_DIR}
$PYTHON mongodl.py --edition enterprise --version v6.0-perf --component cryptd --test
$PYTHON mongodl.py --edition enterprise --version v8.0-perf --component cryptd --test

popd
make -C ${DRIVERS_TOOLS} test
Loading