Skip to content

Commit 69630e0

Browse files
GODRIVER-2643 update virtual environment source (#1132)
1 parent 4c4c61b commit 69630e0

File tree

1 file changed

+42
-50
lines changed

1 file changed

+42
-50
lines changed

.evergreen/config.yml

Lines changed: 42 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,22 @@ functions:
170170
# initialize submodules
171171
git submodule init
172172
git submodule update
173+
- command: shell.exec
174+
params:
175+
working_dir: src/go.mongodb.org/mongo-driver
176+
shell: "bash"
177+
script: |
178+
. ${DRIVERS_TOOLS}/.evergreen/venv-utils.sh
179+
. ${DRIVERS_TOOLS}/.evergreen/find-python3.sh
180+
181+
export PYTHON3_BINARY="$(find_python3)"
182+
venvcreate "$PYTHON3_BINARY" venv
183+
184+
echo "PYTHON3_BINARY: $PYTHON3_BINARY" >>expansion.yml
185+
# Load the expansion file to make an evergreen variable with the current unique version
186+
- command: expansions.update
187+
params:
188+
file: src/go.mongodb.org/mongo-driver/expansion.yml
173189

174190
install-linters:
175191
- command: shell.exec
@@ -603,38 +619,30 @@ functions:
603619
make evg-test-atlas-data-lake
604620
605621
run-valid-ocsp-server:
606-
- command: shell.exec
607-
params:
608-
script: |
609-
cd ${DRIVERS_TOOLS}/.evergreen/ocsp
610-
${PYTHON3_BINARY} -m venv ./venv
611-
./venv/${VENV_BIN_DIR|bin}/pip3 install -r mock-ocsp-responder-requirements.txt
612622
- command: shell.exec
613623
params:
614624
background: true
625+
shell: "bash"
615626
script: |
616627
cd ${DRIVERS_TOOLS}/.evergreen/ocsp
628+
. ./activate-ocspvenv.sh
617629
618-
./venv/${VENV_BIN_DIR|bin}/python ocsp_mock.py \
630+
python ocsp_mock.py \
619631
--ca_file ${OCSP_ALGORITHM}/ca.pem \
620632
--ocsp_responder_cert ${OCSP_ALGORITHM}/ca.crt \
621633
--ocsp_responder_key ${OCSP_ALGORITHM}/ca.key \
622634
-p 8100 -v
623635
624636
run-revoked-ocsp-server:
625-
- command: shell.exec
626-
params:
627-
script: |
628-
cd ${DRIVERS_TOOLS}/.evergreen/ocsp
629-
${PYTHON3_BINARY} -m venv ./venv
630-
./venv/${VENV_BIN_DIR|bin}/pip3 install -r mock-ocsp-responder-requirements.txt
631637
- command: shell.exec
632638
params:
633639
background: true
640+
shell: "bash"
634641
script: |
635642
cd ${DRIVERS_TOOLS}/.evergreen/ocsp
643+
. ./activate-ocspvenv.sh
636644
637-
./venv/${VENV_BIN_DIR|bin}/python ocsp_mock.py \
645+
python ocsp_mock.py \
638646
--ca_file ${OCSP_ALGORITHM}/ca.pem \
639647
--ocsp_responder_cert ${OCSP_ALGORITHM}/ca.crt \
640648
--ocsp_responder_key ${OCSP_ALGORITHM}/ca.key \
@@ -643,38 +651,30 @@ functions:
643651
--fault revoked
644652
645653
run-valid-delegate-ocsp-server:
646-
- command: shell.exec
647-
params:
648-
script: |
649-
cd ${DRIVERS_TOOLS}/.evergreen/ocsp
650-
${PYTHON3_BINARY} -m venv ./venv
651-
./venv/${VENV_BIN_DIR|bin}/pip3 install -r mock-ocsp-responder-requirements.txt
652654
- command: shell.exec
653655
params:
654656
background: true
657+
shell: "bash"
655658
script: |
656659
cd ${DRIVERS_TOOLS}/.evergreen/ocsp
660+
. ./activate-ocspvenv.sh
657661
658-
./venv/${VENV_BIN_DIR|bin}/python ocsp_mock.py \
662+
python ocsp_mock.py \
659663
--ca_file ${OCSP_ALGORITHM}/ca.pem \
660664
--ocsp_responder_cert ${OCSP_ALGORITHM}/ocsp-responder.crt \
661665
--ocsp_responder_key ${OCSP_ALGORITHM}/ocsp-responder.key \
662666
-p 8100 -v
663667
664668
run-revoked-delegate-ocsp-server:
665-
- command: shell.exec
666-
params:
667-
script: |
668-
cd ${DRIVERS_TOOLS}/.evergreen/ocsp
669-
${PYTHON3_BINARY} -m venv ./venv
670-
./venv/${VENV_BIN_DIR|bin}/pip3 install -r mock-ocsp-responder-requirements.txt
671669
- command: shell.exec
672670
params:
673671
background: true
672+
shell: "bash"
674673
script: |
675674
cd ${DRIVERS_TOOLS}/.evergreen/ocsp
675+
. ./activate-ocspvenv.sh
676676
677-
./venv/${VENV_BIN_DIR|bin}/python ocsp_mock.py \
677+
python ocsp_mock.py \
678678
--ca_file ${OCSP_ALGORITHM}/ca.pem \
679679
--ocsp_responder_cert ${OCSP_ALGORITHM}/ocsp-responder.crt \
680680
--ocsp_responder_key ${OCSP_ALGORITHM}/ocsp-responder.key \
@@ -730,10 +730,11 @@ functions:
730730
type: test
731731
params:
732732
working_dir: "src"
733+
shell: "bash"
733734
script: |
734735
${PREPARE_SHELL}
735736
cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
736-
. ./activate_venv.sh
737+
. ./activate-authawsvenv.sh
737738
mongo aws_e2e_regular_aws.js
738739
- command: shell.exec
739740
type: test
@@ -760,10 +761,11 @@ functions:
760761
type: test
761762
params:
762763
working_dir: "src"
764+
shell: "bash"
763765
script: |
764766
${PREPARE_SHELL}
765767
cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
766-
. ./activate_venv.sh
768+
. ./activate-authawsvenv.sh
767769
mongo aws_e2e_assume_role.js
768770
- command: shell.exec
769771
type: test
@@ -796,14 +798,15 @@ functions:
796798
type: test
797799
params:
798800
working_dir: "src"
801+
shell: "bash"
799802
script: |
800803
${PREPARE_SHELL}
801804
if [ "${SKIP_EC2_AUTH_TEST}" = "true" ]; then
802805
echo "This platform does not support the EC2 auth test, skipping..."
803806
exit 0
804807
fi
805808
cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
806-
. ./activate_venv.sh
809+
. ./activate-authawsvenv.sh
807810
mongo aws_e2e_ec2.js
808811
- command: shell.exec
809812
type: test
@@ -878,6 +881,7 @@ functions:
878881
type: test
879882
params:
880883
working_dir: "src"
884+
shell: "bash"
881885
script: |
882886
${PREPARE_SHELL}
883887
if [ "${SKIP_ECS_AUTH_TEST}" = "true" ]; then
@@ -891,7 +895,7 @@ functions:
891895
cp ${PROJECT_DIRECTORY}/.evergreen/run-mongodb-aws-ecs-test.sh $ECS_SRC_DIR/.evergreen
892896
tar -czf $ECS_SRC_DIR/src.tgz -C $PROJECT_DIRECTORY .
893897
cd $AUTH_AWS_DIR
894-
. ./activate_venv.sh
898+
. ./activate-authawsvenv.sh
895899
cat <<EOF > setup.js
896900
const mongo_binaries = "$MONGODB_BINARIES";
897901
const project_dir = "$ECS_SRC_DIR";
@@ -902,11 +906,12 @@ functions:
902906
start-kms-mock-server:
903907
- command: shell.exec
904908
params:
909+
shell: "bash"
905910
script: |
906911
${PREPARE_SHELL}
907912
908913
cd ${DRIVERS_TOOLS}/.evergreen/csfle
909-
. ./activate_venv.sh
914+
. ./activate-kmstlsvenv.sh
910915
- command: shell.exec
911916
params:
912917
background: true
@@ -917,11 +922,12 @@ functions:
917922
start-kms-mock-server-require-client-cert:
918923
- command: shell.exec
919924
params:
925+
shell: "bash"
920926
script: |
921927
${PREPARE_SHELL}
922928
923929
cd ${DRIVERS_TOOLS}/.evergreen/csfle
924-
. ./activate_venv.sh
930+
. ./activate-kmstlsvenv.sh
925931
- command: shell.exec
926932
params:
927933
background: true
@@ -932,17 +938,13 @@ functions:
932938
start-cse-servers:
933939
- command: shell.exec
934940
params:
941+
shell: "bash"
935942
script: |
936943
${PREPARE_SHELL}
937944
938945
cd ${DRIVERS_TOOLS}/.evergreen/csfle
946+
. ./activate-kmstlsvenv.sh
939947
940-
# only run this if virtualenv is installed
941-
if ${PYTHON3_BINARY} -m venv ./venv; then
942-
. ./activate_venv.sh
943-
else
944-
echo "Python module venv not found, skipping virtual environment setup..."
945-
fi
946948
- command: shell.exec
947949
params:
948950
background: true
@@ -2074,21 +2076,18 @@ axes:
20742076
variables:
20752077
GCC_PATH: "/cygdrive/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin"
20762078
GO_DIST: "C:\\golang\\go1.18"
2077-
PYTHON3_BINARY: "C:/python/Python38/python.exe"
20782079
VENV_BIN_DIR: "Scripts"
20792080
- id: "ubuntu1604-64-go-1-18"
20802081
display_name: "Ubuntu 16.04"
20812082
run_on: ubuntu1604-build
20822083
variables:
20832084
GO_DIST: "/opt/golang/go1.18"
2084-
PYTHON3_BINARY: "/opt/python/3.8/bin/python3"
20852085
- id: "osx-go-1-18"
20862086
display_name: "MacOS 11.0"
20872087
run_on: macos-1100
20882088
batchtime: 1440 # Run at most once per 24 hours.
20892089
variables:
20902090
GO_DIST: "/opt/golang/go1.18"
2091-
PYTHON3_BINARY: python3
20922091

20932092
# OSes that require >= 4.0 for SSL
20942093
- id: os-ssl-40
@@ -2101,21 +2100,18 @@ axes:
21012100
variables:
21022101
GCC_PATH: "/cygdrive/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin"
21032102
GO_DIST: "C:\\golang\\go1.18"
2104-
PYTHON3_BINARY: "C:/python/Python38/python.exe"
21052103
VENV_BIN_DIR: "Scripts"
21062104
- id: "ubuntu1804-64-go-1-18"
21072105
display_name: "Ubuntu 18.04"
21082106
run_on: ubuntu1804-build
21092107
variables:
21102108
GO_DIST: "/opt/golang/go1.18"
2111-
PYTHON3_BINARY: "/opt/python/3.8/bin/python3"
21122109
- id: "osx-go-1-18"
21132110
display_name: "MacOS 11.0"
21142111
run_on: macos-1100
21152112
batchtime: 1440 # Run at most once per 24 hours.
21162113
variables:
21172114
GO_DIST: "/opt/golang/go1.18"
2118-
PYTHON3_BINARY: python3
21192115

21202116
# OCSP linux tasks need to run against this OS since stapling is disabled on Ubuntu 18.04 (SERVER-51364)
21212117
- id: ocsp-rhel-70
@@ -2126,7 +2122,6 @@ axes:
21262122
run_on: rhel70-build
21272123
variables:
21282124
GO_DIST: "/opt/golang/go1.18"
2129-
PYTHON3_BINARY: "/opt/python/3.6/bin/python3"
21302125

21312126
- id: os-aws-auth
21322127
display_name: OS
@@ -2139,13 +2134,11 @@ axes:
21392134
GCC_PATH: "/cygdrive/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin"
21402135
GO_DIST: "C:\\golang\\go1.18"
21412136
SKIP_ECS_AUTH_TEST: true
2142-
PYTHON3_BINARY: "C:/python/Python38/python.exe"
21432137
- id: "ubuntu1804-64-go-1-18"
21442138
display_name: "Ubuntu 18.04"
21452139
run_on: ubuntu1804-test
21462140
variables:
21472141
GO_DIST: "/opt/golang/go1.18"
2148-
PYTHON3_BINARY: "/opt/python/3.8/bin/python3"
21492142
- id: "osx-go-1-18"
21502143
display_name: "MacOS 11.0"
21512144
run_on: macos-1100
@@ -2154,7 +2147,6 @@ axes:
21542147
GO_DIST: "/opt/golang/go1.18"
21552148
SKIP_ECS_AUTH_TEST: true
21562149
SKIP_EC2_AUTH_TEST: true
2157-
PYTHON3_BINARY: python3
21582150

21592151
task_groups:
21602152
- name: serverless_task_group

0 commit comments

Comments
 (0)