Skip to content

Commit

Permalink
Merge branch 'master' of github.com:mongodb-labs/drivers-evergreen-to…
Browse files Browse the repository at this point in the history
…ols into eks-cleanup
  • Loading branch information
blink1073 committed Oct 25, 2024
2 parents ea85676 + e6a901d commit c990367
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 deletions.
8 changes: 4 additions & 4 deletions .evergreen/download-mongodb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ get_mongodb_download_url_for ()
MONGOSH_DOWNLOAD_URL=$($_python3 "${_script_dir}/mongosh-dl.py" --no-download | tr -d '\r')

# Get the download url for MongoDB for the given version.
MONGODB_DOWNLOAD_URL=$($_python3 "${_script_dir}/mongodl.py" --version $_VERSION --component $_component --no-download | tr -d '\r')
MONGODB_DOWNLOAD_URL="$($_python3 "${_script_dir}/mongodl.py" --version $_VERSION --component $_component --no-download | tr -d '\r')"

if [ -z "$MONGODB_DOWNLOAD_URL" ]; then
echo "Unknown version: $_VERSION for $_DISTRO"
Expand All @@ -116,7 +116,7 @@ get_mongodb_download_url_for ()
esac
MONGO_CRYPT_SHARED_DOWNLOAD_URL=$($_python3 "${_script_dir}/mongodl.py" --version $_crypt_shared_version --component crypt_shared --no-download | tr -d '\r')

echo $MONGODB_DOWNLOAD_URL
echo "$MONGODB_DOWNLOAD_URL"
}

# curl_retry emulates running curl with `--retry 5` and `--retry-all-errors`.
Expand All @@ -141,7 +141,7 @@ download_and_extract_package ()
fi

echo "Installing server binaries..."
curl_retry $MONGODB_DOWNLOAD_URL --output mongodb-binaries.tgz
curl_retry "$MONGODB_DOWNLOAD_URL" --output mongodb-binaries.tgz

$EXTRACT mongodb-binaries.tgz
echo "Installing server binaries... done."
Expand Down Expand Up @@ -211,7 +211,7 @@ download_and_extract ()
# Use a subshell to avoid overwriting MONGODB_DOWNLOAD_URL and MONGO_CRYPT_SHARED_DOWNLOAD_URL.
MONGODB50_DOWNLOAD_URL=$(
get_mongodb_download_url_for "$DISTRO" "5.0" > /dev/null
echo $MONGODB_DOWNLOAD_URL
echo "$MONGODB_DOWNLOAD_URL"
)

SAVED_DRIVERS_TOOLS=$DRIVERS_TOOLS
Expand Down
22 changes: 5 additions & 17 deletions .evergreen/mongodl.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@
from typing import (IO, TYPE_CHECKING, Any, Callable, Iterable, Iterator, Optional,
NamedTuple, Sequence, cast)

# The named supported minor and major versions.
SUPPORTED_VERSIONS = ["3.6", "4.0", "4.2", "4.4", "5.0", "6.0", "7.0", "8.0"]

# These versions are used for performance benchmarking. Do not update to a newer version.
PERF_VERSIONS = {
"v6.0-perf": "6.0.6",
Expand Down Expand Up @@ -387,16 +384,6 @@ def _import_json_data(self, data: 'Any') -> None:
UNIQUE(key, download_id)
)
''')
# Inject supported versions
versions = dict(zip(SUPPORTED_VERSIONS, [None for _ in SUPPORTED_VERSIONS]))
for ver in data['versions']:
version = ver['version']
key = version[:3]
if key in versions and versions[key] is None:
ver = ver.copy()
ver['version'] = key
versions[key] = ver
data['versions'].extend(versions.values())

for ver in data['versions']:
version = ver['version']
Expand Down Expand Up @@ -468,9 +455,9 @@ def _import_json_data(self, data: 'Any') -> None:
data=json.dumps(data),
)
if missing:
print("Missing targets in DISTRO_ID_TO_TARGET:")
print("Missing targets in DISTRO_ID_TO_TARGET:", file=sys.stderr)
for item in missing:
print(item)
print(f" - {item}", file=sys.stderr)
if os.environ.get("VALIDATE_DISTROS") == "1":
sys.exit(1)

Expand Down Expand Up @@ -507,11 +494,12 @@ def iter_available(
THEN mdb_version_rapid(version)
WHEN :version IS NULL
THEN 1
ELSE version=:version
ELSE version=:version OR version LIKE :version_pattern
END)
ORDER BY version COLLATE mdb_version DESC
''',
version=version,
version_pattern=f'{version}.%',
target=target,
arch=arch,
edition=edition,
Expand Down Expand Up @@ -951,7 +939,7 @@ def _maybe_extract_member(out: Path, relpath: PurePath, pattern: 'str | None',
return 0
if not _test_pattern(relpath, PurePath(pattern) if pattern else None):
# Doesn't match our pattern
print(' (excluded by pattern)')
print(' (excluded by pattern)', file=sys.stderr)
return 0
stripped = _pathjoin(relpath.parts[strip:])
dest = Path(out) / stripped
Expand Down

0 comments on commit c990367

Please sign in to comment.