You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/08/31 10:35:27 UTC

[GitHub] lebeg commented on a change in pull request #12094: [WIP][MXNET-793] ★ Virtualized testing in CI with QEMU ★

lebeg commented on a change in pull request #12094: [WIP][MXNET-793] ★ Virtualized testing in CI with QEMU ★
URL: https://github.com/apache/incubator-mxnet/pull/12094#discussion_r214310576
 
 

 ##########
 File path: ci/docker/runtime_functions.py
 ##########
 @@ -0,0 +1,131 @@
+#!/usr/bin/env python3
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# -*- coding: utf-8 -*-
+"""Runtime functions to use in docker / testing"""
+
+__author__ = 'Pedro Larroy'
+__version__ = '0.1'
+
+import os
+import sys
+import subprocess
+import argparse
+import logging
+from subprocess import call, check_call, Popen, DEVNULL, PIPE
+import time
+import sys
+import types
+import glob
+
+
+
+def activate_this(base):
+    import site
+    import os
+    import sys
+    if sys.platform == 'win32':
+        site_packages = os.path.join(base, 'Lib', 'site-packages')
+    else:
+        site_packages = os.path.join(base, 'lib', 'python%s' % sys.version[:3], 'site-packages')
+    prev_sys_path = list(sys.path)
+    sys.real_prefix = sys.prefix
+    sys.prefix = base
+    # Move the added items to the front of the path:
+    new_sys_path = []
+    for item in list(sys.path):
+        if item not in prev_sys_path:
+            new_sys_path.append(item)
+            sys.path.remove(item)
+    sys.path[:0] = new_sys_path
+
+def pip_install(pkg):
 
 Review comment:
   I don't think installing something belongs to this script - maybe the dockerfile build is a better alternative

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services