[ARVADOS] updated: 603bccd66ac868c2accf9dff9c3ca6b7feeed962

git at public.curoverse.com git at public.curoverse.com
Fri May 2 17:06:04 EDT 2014


Summary of changes:
 apps/workbench/test/test_helper.rb                 |   20 +++----
 doc/api/methods.html.textile.liquid                |   10 ++-
 sdk/python/arvados/{fuse.py => fuse/__init__.py}   |    0
 sdk/python/build.sh                                |    2 +-
 sdk/python/run_test_server.py                      |   54 +++++++++++++++++
 sdk/python/setup.py.src                            |    8 ++-
 sdk/python/{setup.py.src => setup_fuse.py.src}     |   24 ++++----
 sdk/python/test_mount.py                           |   12 ++++
 .../api/app/controllers/application_controller.rb  |    6 +-
 .../app/controllers/arvados/v1/jobs_controller.rb  |    2 +-
 .../controllers/arvados/v1/schema_controller.rb    |    4 +-
 services/api/lib/load_param.rb                     |   24 ++++++--
 services/api/test/integration/select_test.rb       |   61 ++++++++++++++++++--
 services/api/test/test_helper.rb                   |    2 +-
 14 files changed, 181 insertions(+), 48 deletions(-)
 rename sdk/python/arvados/{fuse.py => fuse/__init__.py} (100%)
 create mode 100644 sdk/python/run_test_server.py
 copy sdk/python/{setup.py.src => setup_fuse.py.src} (52%)

       via  603bccd66ac868c2accf9dff9c3ca6b7feeed962 (commit)
       via  1f763a5b1ad5c65a3265b4284958ecc0fe336f50 (commit)
       via  307cf5007269a069b8c80dc14da134ec145cd292 (commit)
       via  1d5a33d2af1e39041177681c8d66007b40b20df4 (commit)
       via  dca6cfe9750d8d1be4f3b63895b8cb73cc6c4cfe (commit)
       via  9143c3ec039d6c89512055f70c2fcc6e1065f1d7 (commit)
      from  a8918e636507200148758302dc6b9a081dc2f206 (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 603bccd66ac868c2accf9dff9c3ca6b7feeed962
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Fri May 2 17:05:59 2014 -0400

    Created a seperate arvados-fuse-driver package.

diff --git a/sdk/python/arvados/fuse.py b/sdk/python/arvados/fuse/__init__.py
similarity index 100%
rename from sdk/python/arvados/fuse.py
rename to sdk/python/arvados/fuse/__init__.py
diff --git a/sdk/python/build.sh b/sdk/python/build.sh
index 4808954..ac8ec47 100755
--- a/sdk/python/build.sh
+++ b/sdk/python/build.sh
@@ -13,4 +13,4 @@
 minor_version=`git log --format=format:%ct.%h -n1 .`
 
 sed "s|%%MINOR_VERSION%%|$minor_version|" < setup.py.src > setup.py
-
+sed "s|%%MINOR_VERSION%%|$minor_version|" < setup_fuse.py.src > setup_fuse.py
diff --git a/sdk/python/setup.py.src b/sdk/python/setup.py.src
index 9b82f4e..9468525 100644
--- a/sdk/python/setup.py.src
+++ b/sdk/python/setup.py.src
@@ -1,8 +1,12 @@
 from setuptools import setup
-import subprocess
+import shutil
 
 minor_version = '%%MINOR_VERSION%%'
 
+# setup.py and setup_fuse.py both share the build/ directory (argh!) so
+# make sure to delete it to avoid scooping up the wrong files.
+shutil.rmtree('build')
+
 setup(name='arvados-python-client',
       version='0.1.' + minor_version,
       description='Arvados client library',
@@ -15,7 +19,6 @@ setup(name='arvados-python-client',
       scripts=[
         'bin/arv-get',
         'bin/arv-put',
-        'bin/arv-mount',
         'bin/arv-ls',
         'bin/arv-normalize',
         ],
@@ -24,6 +27,5 @@ setup(name='arvados-python-client',
         'google-api-python-client',
         'httplib2',
         'urllib3',
-	'llfuse'
         ],
       zip_safe=False)
diff --git a/sdk/python/setup.py.src b/sdk/python/setup_fuse.py.src
similarity index 52%
copy from sdk/python/setup.py.src
copy to sdk/python/setup_fuse.py.src
index 9b82f4e..9e191fb 100644
--- a/sdk/python/setup.py.src
+++ b/sdk/python/setup_fuse.py.src
@@ -1,29 +1,27 @@
 from setuptools import setup
-import subprocess
+import distutils
+import shutil
 
 minor_version = '%%MINOR_VERSION%%'
 
-setup(name='arvados-python-client',
+# setup.py and setup_fuse.py both share the build/ directory (argh!) so
+# make sure to delete it to avoid scooping up the wrong files.
+shutil.rmtree('build')
+
+setup(name='arvados-fuse-driver',
       version='0.1.' + minor_version,
-      description='Arvados client library',
+      description='Arvados FUSE driver',
       author='Arvados',
       author_email='info at arvados.org',
       url="https://arvados.org",
       download_url="https://github.com/curoverse/arvados.git",
       license='Apache 2.0',
-      packages=['arvados'],
+      packages=['arvados.fuse'],
       scripts=[
-        'bin/arv-get',
-        'bin/arv-put',
-        'bin/arv-mount',
-        'bin/arv-ls',
-        'bin/arv-normalize',
+        'bin/arv-mount'
         ],
       install_requires=[
-        'python-gflags',
-        'google-api-python-client',
-        'httplib2',
-        'urllib3',
+        'arvados-python-client',
 	'llfuse'
         ],
       zip_safe=False)

commit 1f763a5b1ad5c65a3265b4284958ecc0fe336f50
Merge: 9143c3e 307cf50
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Fri May 2 16:17:07 2014 -0400

    Merge branch 'master' into 2035-arv-mount-tags-folders


commit 9143c3ec039d6c89512055f70c2fcc6e1065f1d7
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Fri May 2 14:03:46 2014 -0400

    Added run_test_server helper module for Python SDK that runs API server in test
    mode and provides access to fixtures and API tokens.

diff --git a/apps/workbench/test/test_helper.rb b/apps/workbench/test/test_helper.rb
index cbbf562..cd90d72 100644
--- a/apps/workbench/test/test_helper.rb
+++ b/apps/workbench/test/test_helper.rb
@@ -54,16 +54,11 @@ class ActiveSupport::TestCase
 end
 
 class ApiServerBackedTestRunner < MiniTest::Unit
-  # Make a hash that unsets Bundle's environment variables.
-  # We'll use this environment when we launch Bundle commands in the API
-  # server.  Otherwise, those commands will try to use Workbench's gems, etc.
-  @@APIENV = Hash[ENV.map { |key, val|
-                    (key =~ /^BUNDLE_/) ? [key, nil] : nil
-                  }.compact]
-
   def _system(*cmd)
-    if not system(@@APIENV, *cmd)
-      raise RuntimeError, "#{cmd[0]} returned exit code #{$?.exitstatus}"
+    Bundler.with_clean_env do
+      if not system({'RAILS_ENV' => 'test'}, *cmd)
+        raise RuntimeError, "#{cmd[0]} returned exit code #{$?.exitstatus}"
+      end
     end
   end
 
@@ -74,15 +69,16 @@ class ApiServerBackedTestRunner < MiniTest::Unit
       _system('bundle', 'exec', 'rake', 'db:fixtures:load')
       _system('bundle', 'exec', 'rails', 'server', '-d')
       timeout = Time.now.tv_sec + 10
-      begin
+      good_pid = false
+      while (not good_pid) and (Time.now.tv_sec < timeout)
         sleep 0.2
         begin
           server_pid = IO.read(SERVER_PID_PATH).to_i
-          good_pid = (server_pid > 0) and (Process.kill(0, pid) rescue false)
+          good_pid = (server_pid > 0) and (Process.kill(0, server_pid) rescue false)
         rescue Errno::ENOENT
           good_pid = false
         end
-      end while (not good_pid) and (Time.now.tv_sec < timeout)
+      end
       if not good_pid
         raise RuntimeError, "could not find API server Rails pid"
       end
diff --git a/sdk/python/run_test_server.py b/sdk/python/run_test_server.py
new file mode 100644
index 0000000..78ad061
--- /dev/null
+++ b/sdk/python/run_test_server.py
@@ -0,0 +1,54 @@
+import subprocess
+import time
+import os
+import signal
+import yaml
+
+ARV_API_SERVER_DIR = '../../services/api'
+SERVER_PID_PATH = 'tmp/pids/server.pid'
+
+def find_server_pid():
+    timeout = time.time() + 10
+    good_pid = False
+    while (not good_pid) and (time.time() < timeout):
+        time.sleep(0.2)
+        try:
+            with open(SERVER_PID_PATH, 'r') as f:
+                server_pid = int(f.read())
+            good_pid = (server_pid > 0) and (os.kill(server_pid, 0) == None)
+        except:
+            good_pid = False
+
+    if not good_pid:
+        raise Exception("could not find API server Rails pid")
+
+    os.environ["ARVADOS_API_HOST"] = "localhost:3001"
+    os.environ["ARVADOS_API_HOST_INSECURE"] = "true"
+
+    return server_pid
+
+def run():
+    cwd = os.getcwd()
+    os.chdir(ARV_API_SERVER_DIR)
+    os.environ["RAILS_ENV"] = "test"
+    subprocess.call(['bundle', 'exec', 'rake', 'db:test:load'])
+    subprocess.call(['bundle', 'exec', 'rake', 'db:fixtures:load'])
+    subprocess.call(['bundle', 'exec', 'rails', 'server', '-d'])
+    find_server_pid()
+    os.chdir(cwd)
+
+def stop():
+    cwd = os.getcwd()
+    os.chdir(ARV_API_SERVER_DIR)
+    os.kill(find_server_pid(), signal.SIGTERM)
+    os.chdir(cwd)
+
+def fixture(fix):
+    '''load a fixture yaml file'''
+    with open(os.path.join(ARV_API_SERVER_DIR, "test", "fixtures",
+                           fix + ".yml")) as f:
+        return yaml.load(f.read())
+
+def authorize_with(token):
+    '''token is the symbolic name of the token from the api_client_authorizations fixture'''
+    os.environ["ARVADOS_API_TOKEN"] = fixture("api_client_authorizations")[token]["api_token"]
diff --git a/sdk/python/test_mount.py b/sdk/python/test_mount.py
index e8ab08c..253dc7b 100644
--- a/sdk/python/test_mount.py
+++ b/sdk/python/test_mount.py
@@ -9,6 +9,8 @@ import tempfile
 import shutil
 import subprocess
 import glob
+import run_test_server
+
 
 class FuseMountTest(unittest.TestCase):
     def setUp(self):
@@ -152,3 +154,13 @@ class FuseMagicTest(unittest.TestCase):
 
         os.rmdir(self.mounttmp)
         shutil.rmtree(self.keeptmp)
+
+class FuseTagsTest(unittest.TestCase):
+    def setUp(self):
+        run_test_server.run()
+
+    def runTest(self):
+        run_test_server.authorize_with("admin")
+
+    def tearDown(self):
+        run_test_server.stop()

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list