mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-21 12:39:08 +01:00
SERVER-96279 Make resmoke easier to run on spawnhosts (#28592)
GitOrigin-RevId: 3fb08e4fb138eb0c9155f599777701463597cb02
This commit is contained in:
parent
d688710338
commit
0f59df3e9e
@ -1,5 +1,6 @@
|
||||
"""FCV and Server binary version constants used for multiversion testing."""
|
||||
|
||||
import glob
|
||||
import http
|
||||
import os
|
||||
import shutil
|
||||
@ -96,7 +97,14 @@ def in_git_root_dir():
|
||||
return git_root_dir == curr_dir
|
||||
|
||||
|
||||
if in_git_root_dir():
|
||||
# Check for the source dir that exists on spawnhosts
|
||||
def in_spawn_host():
|
||||
if glob.glob("/data/mci/source*"):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
if in_git_root_dir() and not in_spawn_host():
|
||||
generate_mongo_version_file()
|
||||
else:
|
||||
LOGGER.info("Skipping generating mongo version file since we're not in the root of a git repo")
|
||||
|
@ -15,6 +15,10 @@ TOOLCHAIN_ROOT=/opt/mongodbtoolchain/v4
|
||||
SRC_DIR=$(ls -d /data/mci/source-* 2>/dev/null)
|
||||
ln -s $SRC_DIR src
|
||||
|
||||
pushd src
|
||||
git remote set-url origin git@github.com:10gen/mongo.git
|
||||
popd
|
||||
|
||||
echo "# This is a fake expansions file to allow our setup scripts to function correctly." > "/data/mci/expansions.yml"
|
||||
echo "spawn_host: \"true\"" >> "/data/mci/expansions.yml"
|
||||
|
||||
@ -40,10 +44,15 @@ activate_venv
|
||||
# download archive_dist_test_debug if evergreen did not do so automatically.
|
||||
# Evergreen will not automatically download artifacts if it is not in the dep chain
|
||||
DOWNLOAD_SCRIPT="${SRC_DIR}/evergreen/spawnhost/download_archive_dist_test_debug.py"
|
||||
if [ -f $FILE ]; then
|
||||
if [ -f $DOWNLOAD_SCRIPT ]; then
|
||||
$python $DOWNLOAD_SCRIPT
|
||||
fi
|
||||
|
||||
ARTIFACTS_SCRIPT="${SRC_DIR}/evergreen/spawnhost/extract_artifacts.py"
|
||||
if [ -f $ARTIFACTS_SCRIPT ]; then
|
||||
$python $ARTIFACTS_SCRIPT
|
||||
fi
|
||||
|
||||
archive_fail() {
|
||||
echo "Error: archive [${1}] not found." >&2
|
||||
}
|
||||
|
@ -605,13 +605,13 @@ functions:
|
||||
- key: mongo_jstestshell_debugsymbols
|
||||
value: ${project}/${compile_variant}/${version_id}/binaries/mongo-jstestshell-debugsymbols-${revision_order_id}.tgz
|
||||
- key: mongo_artifacts
|
||||
value: ${project}/${compile_variant}/${version_id}/artifacts/${revision_order_id}.tgz
|
||||
value: ${project}/${compile_variant}/${version_id}/artifacts/artifacts-${revision_order_id}.tgz
|
||||
- key: mongo_benchmarks
|
||||
value: ${project}/${compile_variant}/${version_id}/binaries/benchmarks-${revision_order_id}.${ext|tgz}
|
||||
- key: mongo_benchmarks_debugsymbols
|
||||
value: ${project}/${compile_variant}/${version_id}/binaries/benchmarksdebugsymbols-${revision_order_id}.${ext|tgz}
|
||||
- key: mongo_venv
|
||||
value: ${project}/${compile_variant}/${version_id}/venv/${revision_order_id}.tgz
|
||||
value: ${project}/${compile_variant}/${version_id}/venv/venv-${revision_order_id}.tgz
|
||||
- key: mongo_fuzzer_corpus_mciuploads
|
||||
value: ${project}/${build_variant}/${version_id}/libfuzzer-corpora/corpora-${revision_order_id}.${ext|tgz}
|
||||
- key: mongo_fuzzer_corpus
|
||||
|
29
evergreen/spawnhost/extract_artifacts.py
Normal file
29
evergreen/spawnhost/extract_artifacts.py
Normal file
@ -0,0 +1,29 @@
|
||||
import glob
|
||||
import os
|
||||
import sys
|
||||
import tarfile
|
||||
|
||||
|
||||
def main():
|
||||
data_dir = "/data/mci"
|
||||
artifact_files = glob.glob("artifacts*archive_dist_test/artifacts*.tgz", root_dir=data_dir)
|
||||
if len(artifact_files) > 1:
|
||||
raise RuntimeError("More than one artifacts file found")
|
||||
|
||||
if len(artifact_files) == 0:
|
||||
print("No artifacts file found, this was probably not generated from a resmoke task.")
|
||||
return 0
|
||||
|
||||
home_dir = os.environ.get("HOME", None)
|
||||
if not home_dir:
|
||||
raise RuntimeError("HOME env var could not be found")
|
||||
|
||||
artifact_path = os.path.join(data_dir, artifact_files[0])
|
||||
with tarfile.open(artifact_path, "r") as tar:
|
||||
tar.extractall(home_dir)
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
Loading…
Reference in New Issue
Block a user