[ARVADOS] updated: 1.3.0-2075-gecf1cbf6b

Git user git at public.arvados.org
Thu Jan 16 16:42:54 UTC 2020


Summary of changes:
 apps/workbench/Gemfile.lock                        |  2 +-
 build/package-test-dockerfiles/centos7/Dockerfile  |  3 +-
 build/package-test-dockerfiles/debian10/Dockerfile |  3 +-
 build/package-test-dockerfiles/debian9/Dockerfile  |  3 +-
 .../package-test-dockerfiles/ubuntu1604/Dockerfile |  3 +-
 .../package-test-dockerfiles/ubuntu1804/Dockerfile |  3 +-
 build/run-build-packages.sh                        |  2 ++
 build/run-library.sh                               |  4 ++-
 build/version-at-commit.sh                         |  3 +-
 sdk/cwl/arvados_version.py                         | 37 ++++++----------------
 sdk/pam/arvados_version.py                         | 24 ++++++--------
 sdk/python/arvados_version.py                      | 22 ++++++-------
 sdk/python/tests/arvados_testutil.py               |  2 +-
 services/api/Gemfile.lock                          |  2 +-
 services/dockercleaner/arvados_version.py          | 24 ++++++--------
 services/fuse/arvados_version.py                   | 24 ++++++--------
 services/nodemanager/arvados_version.py            | 24 ++++++--------
 tools/crunchstat-summary/arvados_version.py        | 24 ++++++--------
 18 files changed, 88 insertions(+), 121 deletions(-)

       via  ecf1cbf6b843ec566890b4bf944fb893ca9481de (commit)
       via  8e3b1abebc4256256e6e5f4f82e3e25618c0dfcd (commit)
       via  a344ad38e66d12b94aa7bc3a53f64c343e6fc0e6 (commit)
       via  522ef30c3432d6d0eb98a5415d91f1373a3c09ca (commit)
       via  c210114aa8c77ba0bb8e4d487fc1507b40f9560f (commit)
      from  81725af5d5d2e6cd18ba7099ba5fb1fc520f4f8c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit ecf1cbf6b843ec566890b4bf944fb893ca9481de
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Thu Jan 16 10:40:08 2020 -0500

    version-at-commit.sh uses '.dev' instead of '.pre'
    
    Makes Python happy -- setuptools allows '.dev' in the version, but
    normalizes '.pre' into '.rc' which actually changes the package
    filename.
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/build/version-at-commit.sh b/build/version-at-commit.sh
index 3a52c4b20..6ed34244a 100755
--- a/build/version-at-commit.sh
+++ b/build/version-at-commit.sh
@@ -3,6 +3,7 @@
 set -e -o pipefail
 commit="$1"
 versionglob="[0-9].[0-9]*.[0-9]*"
+devsuffix=".dev"
 
 if ! git describe --exact-match --match "$versionglob" "$commit" 2>/dev/null; then
     if git merge-base --is-ancestor "$commit" origin/master; then
@@ -14,5 +15,5 @@ if ! git describe --exact-match --match "$versionglob" "$commit" 2>/dev/null; th
     fi
     isodate=$(TZ=UTC git log -n1 --format=%cd --date=iso "$commit")
     ts=$(TZ=UTC date --date="$isodate" "+%Y%m%d%H%M%S")
-    echo "$v.pre$ts"
+    echo "${v}${devsuffix}${ts}"
 fi

commit 8e3b1abebc4256256e6e5f4f82e3e25618c0dfcd
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Wed Jan 15 21:53:05 2020 -0500

    Fix assertVersionOutput to handle 'pre' versions
    
    no issue #
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/sdk/python/tests/arvados_testutil.py b/sdk/python/tests/arvados_testutil.py
index 21b3f15dc..6010d8b94 100644
--- a/sdk/python/tests/arvados_testutil.py
+++ b/sdk/python/tests/arvados_testutil.py
@@ -93,7 +93,7 @@ class VersionChecker(object):
             # Python 2 writes version info on stderr.
             self.assertEqual(out.getvalue(), '')
             v = err.getvalue()
-        self.assertRegex(v, r"[0-9]+\.[0-9]+\.[0-9]+$\n")
+        self.assertRegex(v, r"[0-9]+\.[0-9]+\.[0-9]+(\.pre[0-9]+)?$\n")
 
 
 class FakeCurl(object):

commit a344ad38e66d12b94aa7bc3a53f64c343e6fc0e6
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Wed Jan 15 15:26:54 2020 -0500

    Update python packages to use version_at_commit script
    
    Update test images to use Bundler 2.0.2
    
    no issue #
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/build/package-test-dockerfiles/centos7/Dockerfile b/build/package-test-dockerfiles/centos7/Dockerfile
index 49d04aa74..6508c86be 100644
--- a/build/package-test-dockerfiles/centos7/Dockerfile
+++ b/build/package-test-dockerfiles/centos7/Dockerfile
@@ -16,7 +16,8 @@ RUN touch /var/lib/rpm/* && \
     gpg --import --no-tty /tmp/pkuczynski.asc && \
     curl -L https://get.rvm.io | bash -s stable && \
     /usr/local/rvm/bin/rvm install 2.3 && \
-    /usr/local/rvm/bin/rvm alias create default ruby-2.3
+    /usr/local/rvm/bin/rvm alias create default ruby-2.3 && \
+    /usr/local/rvm/bin/rvm-exec default gem install bundler --version 2.0.2
 
 # Install Bash 4.4.12  // see https://dev.arvados.org/issues/15612
 RUN cd /usr/local/src \
diff --git a/build/package-test-dockerfiles/debian10/Dockerfile b/build/package-test-dockerfiles/debian10/Dockerfile
index 3aa6fdcce..48e4984d5 100644
--- a/build/package-test-dockerfiles/debian10/Dockerfile
+++ b/build/package-test-dockerfiles/debian10/Dockerfile
@@ -18,7 +18,8 @@ RUN gpg --import --no-tty /tmp/mpapis.asc && \
     gpg --import --no-tty /tmp/pkuczynski.asc && \
     curl -L https://get.rvm.io | bash -s stable && \
     /usr/local/rvm/bin/rvm install 2.5 && \
-    /usr/local/rvm/bin/rvm alias create default ruby-2.5
+    /usr/local/rvm/bin/rvm alias create default ruby-2.5 && \
+    /usr/local/rvm/bin/rvm-exec default gem install bundler --version 2.0.2
 
 # udev daemon can't start in a container, so don't try.
 RUN mkdir -p /etc/udev/disabled
diff --git a/build/package-test-dockerfiles/debian9/Dockerfile b/build/package-test-dockerfiles/debian9/Dockerfile
index e759c9ce1..470845ae9 100644
--- a/build/package-test-dockerfiles/debian9/Dockerfile
+++ b/build/package-test-dockerfiles/debian9/Dockerfile
@@ -18,7 +18,8 @@ RUN gpg --import --no-tty /tmp/mpapis.asc && \
     gpg --import --no-tty /tmp/pkuczynski.asc && \
     curl -L https://get.rvm.io | bash -s stable && \
     /usr/local/rvm/bin/rvm install 2.5 && \
-    /usr/local/rvm/bin/rvm alias create default ruby-2.5
+    /usr/local/rvm/bin/rvm alias create default ruby-2.5 && \
+    /usr/local/rvm/bin/rvm-exec default gem install bundler --version 2.0.2
 
 # udev daemon can't start in a container, so don't try.
 RUN mkdir -p /etc/udev/disabled
diff --git a/build/package-test-dockerfiles/ubuntu1604/Dockerfile b/build/package-test-dockerfiles/ubuntu1604/Dockerfile
index 422ee43e0..c35deebf1 100644
--- a/build/package-test-dockerfiles/ubuntu1604/Dockerfile
+++ b/build/package-test-dockerfiles/ubuntu1604/Dockerfile
@@ -18,7 +18,8 @@ RUN gpg --import --no-tty /tmp/mpapis.asc && \
     gpg --import --no-tty /tmp/pkuczynski.asc && \
     curl -L https://get.rvm.io | bash -s stable && \
     /usr/local/rvm/bin/rvm install 2.5 && \
-    /usr/local/rvm/bin/rvm alias create default ruby-2.5
+    /usr/local/rvm/bin/rvm alias create default ruby-2.5 && \
+    /usr/local/rvm/bin/rvm-exec default gem install bundler --version 2.0.2
 
 # udev daemon can't start in a container, so don't try.
 RUN mkdir -p /etc/udev/disabled
diff --git a/build/package-test-dockerfiles/ubuntu1804/Dockerfile b/build/package-test-dockerfiles/ubuntu1804/Dockerfile
index 68babe3fd..60296e6be 100644
--- a/build/package-test-dockerfiles/ubuntu1804/Dockerfile
+++ b/build/package-test-dockerfiles/ubuntu1804/Dockerfile
@@ -18,7 +18,8 @@ RUN gpg --import --no-tty /tmp/mpapis.asc && \
     gpg --import --no-tty /tmp/pkuczynski.asc && \
     curl -L https://get.rvm.io | bash -s stable && \
     /usr/local/rvm/bin/rvm install 2.5 && \
-    /usr/local/rvm/bin/rvm alias create default ruby-2.5
+    /usr/local/rvm/bin/rvm alias create default ruby-2.5 && \
+    /usr/local/rvm/bin/rvm-exec default gem install bundler --version 2.0.2
 
 # udev daemon can't start in a container, so don't try.
 RUN mkdir -p /etc/udev/disabled
diff --git a/build/run-build-packages.sh b/build/run-build-packages.sh
index 3173aa705..f00d0c031 100755
--- a/build/run-build-packages.sh
+++ b/build/run-build-packages.sh
@@ -349,6 +349,8 @@ if [[ -e "$WORKSPACE/cwltest" ]]; then
 	rm -rf "$WORKSPACE/cwltest"
 fi
 git clone https://github.com/common-workflow-language/cwltest.git
+# last release to support python 2.7
+(cd cwltest && git checkout 1.0.20190906212748)
 # signal to our build script that we want a cwltest executable installed in /usr/bin/
 mkdir cwltest/bin && touch cwltest/bin/cwltest
 fpm_build_virtualenv "cwltest" "cwltest"
diff --git a/build/run-library.sh b/build/run-library.sh
index 46b4dc604..f09071cee 100755
--- a/build/run-library.sh
+++ b/build/run-library.sh
@@ -10,6 +10,8 @@
 # older packages.
 LICENSE_PACKAGE_TS=20151208015500
 
+librarydir=`dirname "$(readlink -f "$0")"`
+
 if [[ -z "$ARVADOS_BUILDING_VERSION" ]]; then
     RAILS_PACKAGE_ITERATION=1
 else
@@ -57,7 +59,7 @@ version_from_git() {
 
     local git_ts git_hash
     declare $(format_last_commit_here "git_ts=%ct git_hash=%h" "$subdir")
-    ARVADOS_BUILDING_VERSION="$(git tag -l |sort -V -r |head -n1).$(date -ud "@$git_ts" +%Y%m%d%H%M%S)"
+    ARVADOS_BUILDING_VERSION="$($librarydir/version-at-commit.sh $git_hash)"
     echo "$ARVADOS_BUILDING_VERSION"
 }
 
diff --git a/sdk/cwl/arvados_version.py b/sdk/cwl/arvados_version.py
index d13dd5ec5..9aabff429 100644
--- a/sdk/cwl/arvados_version.py
+++ b/sdk/cwl/arvados_version.py
@@ -7,38 +7,19 @@ import time
 import os
 import re
 
-SETUP_DIR = os.path.dirname(__file__) or '.'
-
-def git_latest_tag():
-    gittags = subprocess.check_output(['git', 'tag', '-l']).split()
-    gittags.sort(key=lambda s: [int(u) for u in s.split(b'.')],reverse=True)
-    return str(next(iter(gittags)).decode('utf-8'))
-
-def choose_version_from():
-    sdk_ts = subprocess.check_output(
-        ['git', 'log', '--first-parent', '--max-count=1',
-         '--format=format:%ct', os.path.join(SETUP_DIR, "../python")]).strip()
-    cwl_ts = subprocess.check_output(
-        ['git', 'log', '--first-parent', '--max-count=1',
-         '--format=format:%ct', SETUP_DIR]).strip()
-    if int(sdk_ts) > int(cwl_ts):
-        getver = os.path.join(SETUP_DIR, "../python")
-    else:
-        getver = SETUP_DIR
-    return getver
-
-def git_timestamp_tag():
-    gitinfo = subprocess.check_output(
-        ['git', 'log', '--first-parent', '--max-count=1',
-         '--format=format:%ct', choose_version_from()]).strip()
-    return str(time.strftime('.%Y%m%d%H%M%S', time.gmtime(int(gitinfo))))
+def git_version_at_commit():
+    curdir = os.path.dirname(os.path.abspath(__file__))
+    myhash = subprocess.check_output(['git', 'log', '-n1', '--first-parent',
+                                       '--format=%H', curdir]).strip()
+    myversion = subprocess.check_output([curdir+'/../../build/version-at-commit.sh', myhash]).strip().decode()
+    return myversion
 
 def save_version(setup_dir, module, v):
-  with open(os.path.join(setup_dir, module, "_version.py"), 'w') as fp:
+  with open(os.path.join(setup_dir, module, "_version.py"), 'wt') as fp:
       return fp.write("__version__ = '%s'\n" % v)
 
 def read_version(setup_dir, module):
-  with open(os.path.join(setup_dir, module, "_version.py"), 'r') as fp:
+  with open(os.path.join(setup_dir, module, "_version.py"), 'rt') as fp:
       return re.match("__version__ = '(.*)'$", fp.read()).groups()[0]
 
 def get_version(setup_dir, module):
@@ -48,7 +29,7 @@ def get_version(setup_dir, module):
         save_version(setup_dir, module, env_version)
     else:
         try:
-            save_version(setup_dir, module, git_latest_tag() + git_timestamp_tag())
+            save_version(setup_dir, module, git_version_at_commit())
         except (subprocess.CalledProcessError, OSError):
             pass
 
diff --git a/sdk/pam/arvados_version.py b/sdk/pam/arvados_version.py
index 2e6484cab..9aabff429 100644
--- a/sdk/pam/arvados_version.py
+++ b/sdk/pam/arvados_version.py
@@ -7,23 +7,19 @@ import time
 import os
 import re
 
-def git_latest_tag():
-    gittags = subprocess.check_output(['git', 'tag', '-l']).split()
-    gittags.sort(key=lambda s: [int(u) for u in s.split(b'.')],reverse=True)
-    return str(next(iter(gittags)).decode('utf-8'))
-
-def git_timestamp_tag():
-    gitinfo = subprocess.check_output(
-        ['git', 'log', '--first-parent', '--max-count=1',
-         '--format=format:%ct', '.']).strip()
-    return str(time.strftime('.%Y%m%d%H%M%S', time.gmtime(int(gitinfo))))
+def git_version_at_commit():
+    curdir = os.path.dirname(os.path.abspath(__file__))
+    myhash = subprocess.check_output(['git', 'log', '-n1', '--first-parent',
+                                       '--format=%H', curdir]).strip()
+    myversion = subprocess.check_output([curdir+'/../../build/version-at-commit.sh', myhash]).strip().decode()
+    return myversion
 
 def save_version(setup_dir, module, v):
-  with open(os.path.join(setup_dir, module, "_version.py"), 'w') as fp:
+  with open(os.path.join(setup_dir, module, "_version.py"), 'wt') as fp:
       return fp.write("__version__ = '%s'\n" % v)
 
 def read_version(setup_dir, module):
-  with open(os.path.join(setup_dir, module, "_version.py"), 'r') as fp:
+  with open(os.path.join(setup_dir, module, "_version.py"), 'rt') as fp:
       return re.match("__version__ = '(.*)'$", fp.read()).groups()[0]
 
 def get_version(setup_dir, module):
@@ -33,8 +29,8 @@ def get_version(setup_dir, module):
         save_version(setup_dir, module, env_version)
     else:
         try:
-            save_version(setup_dir, module, git_latest_tag() + git_timestamp_tag())
-        except subprocess.CalledProcessError:
+            save_version(setup_dir, module, git_version_at_commit())
+        except (subprocess.CalledProcessError, OSError):
             pass
 
     return read_version(setup_dir, module)
diff --git a/sdk/python/arvados_version.py b/sdk/python/arvados_version.py
index 692146465..9aabff429 100644
--- a/sdk/python/arvados_version.py
+++ b/sdk/python/arvados_version.py
@@ -7,23 +7,19 @@ import time
 import os
 import re
 
-def git_latest_tag():
-    gittags = subprocess.check_output(['git', 'tag', '-l']).split()
-    gittags.sort(key=lambda s: [int(u) for u in s.split(b'.')],reverse=True)
-    return str(next(iter(gittags)).decode('utf-8'))
-
-def git_timestamp_tag():
-    gitinfo = subprocess.check_output(
-        ['git', 'log', '--first-parent', '--max-count=1',
-         '--format=format:%ct', '.']).strip()
-    return str(time.strftime('.%Y%m%d%H%M%S', time.gmtime(int(gitinfo))))
+def git_version_at_commit():
+    curdir = os.path.dirname(os.path.abspath(__file__))
+    myhash = subprocess.check_output(['git', 'log', '-n1', '--first-parent',
+                                       '--format=%H', curdir]).strip()
+    myversion = subprocess.check_output([curdir+'/../../build/version-at-commit.sh', myhash]).strip().decode()
+    return myversion
 
 def save_version(setup_dir, module, v):
-  with open(os.path.join(setup_dir, module, "_version.py"), 'w') as fp:
+  with open(os.path.join(setup_dir, module, "_version.py"), 'wt') as fp:
       return fp.write("__version__ = '%s'\n" % v)
 
 def read_version(setup_dir, module):
-  with open(os.path.join(setup_dir, module, "_version.py"), 'r') as fp:
+  with open(os.path.join(setup_dir, module, "_version.py"), 'rt') as fp:
       return re.match("__version__ = '(.*)'$", fp.read()).groups()[0]
 
 def get_version(setup_dir, module):
@@ -33,7 +29,7 @@ def get_version(setup_dir, module):
         save_version(setup_dir, module, env_version)
     else:
         try:
-            save_version(setup_dir, module, git_latest_tag() + git_timestamp_tag())
+            save_version(setup_dir, module, git_version_at_commit())
         except (subprocess.CalledProcessError, OSError):
             pass
 
diff --git a/services/dockercleaner/arvados_version.py b/services/dockercleaner/arvados_version.py
index 2e6484cab..9aabff429 100644
--- a/services/dockercleaner/arvados_version.py
+++ b/services/dockercleaner/arvados_version.py
@@ -7,23 +7,19 @@ import time
 import os
 import re
 
-def git_latest_tag():
-    gittags = subprocess.check_output(['git', 'tag', '-l']).split()
-    gittags.sort(key=lambda s: [int(u) for u in s.split(b'.')],reverse=True)
-    return str(next(iter(gittags)).decode('utf-8'))
-
-def git_timestamp_tag():
-    gitinfo = subprocess.check_output(
-        ['git', 'log', '--first-parent', '--max-count=1',
-         '--format=format:%ct', '.']).strip()
-    return str(time.strftime('.%Y%m%d%H%M%S', time.gmtime(int(gitinfo))))
+def git_version_at_commit():
+    curdir = os.path.dirname(os.path.abspath(__file__))
+    myhash = subprocess.check_output(['git', 'log', '-n1', '--first-parent',
+                                       '--format=%H', curdir]).strip()
+    myversion = subprocess.check_output([curdir+'/../../build/version-at-commit.sh', myhash]).strip().decode()
+    return myversion
 
 def save_version(setup_dir, module, v):
-  with open(os.path.join(setup_dir, module, "_version.py"), 'w') as fp:
+  with open(os.path.join(setup_dir, module, "_version.py"), 'wt') as fp:
       return fp.write("__version__ = '%s'\n" % v)
 
 def read_version(setup_dir, module):
-  with open(os.path.join(setup_dir, module, "_version.py"), 'r') as fp:
+  with open(os.path.join(setup_dir, module, "_version.py"), 'rt') as fp:
       return re.match("__version__ = '(.*)'$", fp.read()).groups()[0]
 
 def get_version(setup_dir, module):
@@ -33,8 +29,8 @@ def get_version(setup_dir, module):
         save_version(setup_dir, module, env_version)
     else:
         try:
-            save_version(setup_dir, module, git_latest_tag() + git_timestamp_tag())
-        except subprocess.CalledProcessError:
+            save_version(setup_dir, module, git_version_at_commit())
+        except (subprocess.CalledProcessError, OSError):
             pass
 
     return read_version(setup_dir, module)
diff --git a/services/fuse/arvados_version.py b/services/fuse/arvados_version.py
index 2e6484cab..9aabff429 100644
--- a/services/fuse/arvados_version.py
+++ b/services/fuse/arvados_version.py
@@ -7,23 +7,19 @@ import time
 import os
 import re
 
-def git_latest_tag():
-    gittags = subprocess.check_output(['git', 'tag', '-l']).split()
-    gittags.sort(key=lambda s: [int(u) for u in s.split(b'.')],reverse=True)
-    return str(next(iter(gittags)).decode('utf-8'))
-
-def git_timestamp_tag():
-    gitinfo = subprocess.check_output(
-        ['git', 'log', '--first-parent', '--max-count=1',
-         '--format=format:%ct', '.']).strip()
-    return str(time.strftime('.%Y%m%d%H%M%S', time.gmtime(int(gitinfo))))
+def git_version_at_commit():
+    curdir = os.path.dirname(os.path.abspath(__file__))
+    myhash = subprocess.check_output(['git', 'log', '-n1', '--first-parent',
+                                       '--format=%H', curdir]).strip()
+    myversion = subprocess.check_output([curdir+'/../../build/version-at-commit.sh', myhash]).strip().decode()
+    return myversion
 
 def save_version(setup_dir, module, v):
-  with open(os.path.join(setup_dir, module, "_version.py"), 'w') as fp:
+  with open(os.path.join(setup_dir, module, "_version.py"), 'wt') as fp:
       return fp.write("__version__ = '%s'\n" % v)
 
 def read_version(setup_dir, module):
-  with open(os.path.join(setup_dir, module, "_version.py"), 'r') as fp:
+  with open(os.path.join(setup_dir, module, "_version.py"), 'rt') as fp:
       return re.match("__version__ = '(.*)'$", fp.read()).groups()[0]
 
 def get_version(setup_dir, module):
@@ -33,8 +29,8 @@ def get_version(setup_dir, module):
         save_version(setup_dir, module, env_version)
     else:
         try:
-            save_version(setup_dir, module, git_latest_tag() + git_timestamp_tag())
-        except subprocess.CalledProcessError:
+            save_version(setup_dir, module, git_version_at_commit())
+        except (subprocess.CalledProcessError, OSError):
             pass
 
     return read_version(setup_dir, module)
diff --git a/services/nodemanager/arvados_version.py b/services/nodemanager/arvados_version.py
index 2e6484cab..9aabff429 100644
--- a/services/nodemanager/arvados_version.py
+++ b/services/nodemanager/arvados_version.py
@@ -7,23 +7,19 @@ import time
 import os
 import re
 
-def git_latest_tag():
-    gittags = subprocess.check_output(['git', 'tag', '-l']).split()
-    gittags.sort(key=lambda s: [int(u) for u in s.split(b'.')],reverse=True)
-    return str(next(iter(gittags)).decode('utf-8'))
-
-def git_timestamp_tag():
-    gitinfo = subprocess.check_output(
-        ['git', 'log', '--first-parent', '--max-count=1',
-         '--format=format:%ct', '.']).strip()
-    return str(time.strftime('.%Y%m%d%H%M%S', time.gmtime(int(gitinfo))))
+def git_version_at_commit():
+    curdir = os.path.dirname(os.path.abspath(__file__))
+    myhash = subprocess.check_output(['git', 'log', '-n1', '--first-parent',
+                                       '--format=%H', curdir]).strip()
+    myversion = subprocess.check_output([curdir+'/../../build/version-at-commit.sh', myhash]).strip().decode()
+    return myversion
 
 def save_version(setup_dir, module, v):
-  with open(os.path.join(setup_dir, module, "_version.py"), 'w') as fp:
+  with open(os.path.join(setup_dir, module, "_version.py"), 'wt') as fp:
       return fp.write("__version__ = '%s'\n" % v)
 
 def read_version(setup_dir, module):
-  with open(os.path.join(setup_dir, module, "_version.py"), 'r') as fp:
+  with open(os.path.join(setup_dir, module, "_version.py"), 'rt') as fp:
       return re.match("__version__ = '(.*)'$", fp.read()).groups()[0]
 
 def get_version(setup_dir, module):
@@ -33,8 +29,8 @@ def get_version(setup_dir, module):
         save_version(setup_dir, module, env_version)
     else:
         try:
-            save_version(setup_dir, module, git_latest_tag() + git_timestamp_tag())
-        except subprocess.CalledProcessError:
+            save_version(setup_dir, module, git_version_at_commit())
+        except (subprocess.CalledProcessError, OSError):
             pass
 
     return read_version(setup_dir, module)
diff --git a/tools/crunchstat-summary/arvados_version.py b/tools/crunchstat-summary/arvados_version.py
index 2e6484cab..9aabff429 100644
--- a/tools/crunchstat-summary/arvados_version.py
+++ b/tools/crunchstat-summary/arvados_version.py
@@ -7,23 +7,19 @@ import time
 import os
 import re
 
-def git_latest_tag():
-    gittags = subprocess.check_output(['git', 'tag', '-l']).split()
-    gittags.sort(key=lambda s: [int(u) for u in s.split(b'.')],reverse=True)
-    return str(next(iter(gittags)).decode('utf-8'))
-
-def git_timestamp_tag():
-    gitinfo = subprocess.check_output(
-        ['git', 'log', '--first-parent', '--max-count=1',
-         '--format=format:%ct', '.']).strip()
-    return str(time.strftime('.%Y%m%d%H%M%S', time.gmtime(int(gitinfo))))
+def git_version_at_commit():
+    curdir = os.path.dirname(os.path.abspath(__file__))
+    myhash = subprocess.check_output(['git', 'log', '-n1', '--first-parent',
+                                       '--format=%H', curdir]).strip()
+    myversion = subprocess.check_output([curdir+'/../../build/version-at-commit.sh', myhash]).strip().decode()
+    return myversion
 
 def save_version(setup_dir, module, v):
-  with open(os.path.join(setup_dir, module, "_version.py"), 'w') as fp:
+  with open(os.path.join(setup_dir, module, "_version.py"), 'wt') as fp:
       return fp.write("__version__ = '%s'\n" % v)
 
 def read_version(setup_dir, module):
-  with open(os.path.join(setup_dir, module, "_version.py"), 'r') as fp:
+  with open(os.path.join(setup_dir, module, "_version.py"), 'rt') as fp:
       return re.match("__version__ = '(.*)'$", fp.read()).groups()[0]
 
 def get_version(setup_dir, module):
@@ -33,8 +29,8 @@ def get_version(setup_dir, module):
         save_version(setup_dir, module, env_version)
     else:
         try:
-            save_version(setup_dir, module, git_latest_tag() + git_timestamp_tag())
-        except subprocess.CalledProcessError:
+            save_version(setup_dir, module, git_version_at_commit())
+        except (subprocess.CalledProcessError, OSError):
             pass
 
     return read_version(setup_dir, module)

commit 522ef30c3432d6d0eb98a5415d91f1373a3c09ca
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Wed Jan 15 13:24:02 2020 -0500

    Update git commit pin for arvados gem (workbench this time)
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/apps/workbench/Gemfile.lock b/apps/workbench/Gemfile.lock
index c20d2d622..2ed784145 100644
--- a/apps/workbench/Gemfile.lock
+++ b/apps/workbench/Gemfile.lock
@@ -1,6 +1,6 @@
 GIT
   remote: https://github.com/arvados/arvados.git
-  revision: 14d53b3386296eb9b4d25c91cd9d40a5dfb52b75
+  revision: c210114aa8c77ba0bb8e4d487fc1507b40f9560f
   glob: sdk/ruby/arvados.gemspec
   specs:
     arvados (1.5.0.pre20200114202620)

commit c210114aa8c77ba0bb8e4d487fc1507b40f9560f
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Wed Jan 15 13:19:58 2020 -0500

    Update git commit pin for arvados gem
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/services/api/Gemfile.lock b/services/api/Gemfile.lock
index 41bbc1041..aa497e057 100644
--- a/services/api/Gemfile.lock
+++ b/services/api/Gemfile.lock
@@ -1,6 +1,6 @@
 GIT
   remote: https://github.com/arvados/arvados.git
-  revision: 6c033bdbc06d0929cec24ea16d4dfb7977e72f78
+  revision: 81725af5d5d2e6cd18ba7099ba5fb1fc520f4f8c
   glob: sdk/ruby/arvados.gemspec
   specs:
     arvados (1.5.0.pre20200114202620)

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list