File tree Expand file tree Collapse file tree 5 files changed +17
-12
lines changed
mongodb_consistent_backup/Backup/Mongodump Expand file tree Collapse file tree 5 files changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -27,18 +27,12 @@ jobs:
2727
2828 environment :
2929 PYTHON_BIN : /usr/local/bin/python2.7
30+
3031 working_directory : ~/repo
3132
3233 steps :
3334 - checkout
34-
35- # Download and cache dependencies
36- - restore_cache :
37- keys :
38- - v1-dependencies-{{ checksum "requirements.txt" }}
39- # fallback to using the latest cache if no exact match is found
40- - v1-dependencies-
41-
35+
4236 - run :
4337 name : set version and build the rpm
4438 command : |
Original file line number Diff line number Diff line change 44* .pyc
55.idea
66* .iml
7+ .history *
8+ venv *
9+ .local *
Original file line number Diff line number Diff line change 1- 1.4.1
1+ 1.4.2
Original file line number Diff line number Diff line change 22import os
33import logging
44import sys
5+ from distutils .version import LooseVersion
56
67from multiprocessing import Process
78from select import select
@@ -73,7 +74,7 @@ def do_ssl_insecure(self):
7374
7475 def is_version_gte (self , compare ):
7576 if os .path .isfile (self .binary ) and os .access (self .binary , os .X_OK ):
76- if tuple (compare . split ( "." )) <= tuple (self .version . split ( "." ) ):
77+ if LooseVersion (compare ) <= LooseVersion (self .version ):
7778 return True
7879 return False
7980
@@ -168,6 +169,12 @@ def mongodump_cmd(self):
168169 mongodump_flags .extend ([
169170 "--out=%s/dump" % self .backup_dir
170171 ])
172+ if self .is_version_gte ("4.2.0" ):
173+ logging .info ("MongoDump Version higher that 4.2.0 found extending mongodump with snppy compressor flag" )
174+ ## https://www.mongodb.com/docs/drivers/node/v4.4/fundamentals/connection/network-compression/
175+ mongodump_flags .extend ([
176+ "--compressors=%s" % "snappy,zlib,zstd"
177+ ])
171178
172179 # --numParallelCollections
173180 if self .threads > 0 :
@@ -222,6 +229,7 @@ def mongodump_cmd(self):
222229 sys .exit (1 )
223230
224231 mongodump_cmd .extend (mongodump_flags )
232+ logging .info ("-----mongodump_cmd: %s" % mongodump_cmd )
225233 return mongodump_cmd
226234
227235 def run (self ):
Original file line number Diff line number Diff line change @@ -109,8 +109,8 @@ if [ -d ${srcdir} ]; then
109109 exit 1
110110 fi
111111
112- # build fails on Pex 1.5+
113- ${venvdir} /bin/python2.7 ${venvdir} /bin/pip install ${pip_flags} " pex<=1.4 "
112+ # build work with pex<=2.1.120 as of 23 feb 2023
113+ ${venvdir} /bin/python2.7 ${venvdir} /bin/pip install ${pip_flags} " pex<=2.1.120 "
114114 if [ $? -gt 0 ]; then
115115 echo " Failed to install pex utility for building!"
116116 exit 1
You can’t perform that action at this time.
0 commit comments