Skip to content

Commit

Permalink
Fixes required to run on helios
Browse files Browse the repository at this point in the history
  • Loading branch information
artpol84 committed Sep 16, 2020
1 parent 85c750a commit 1f93502
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 2 deletions.
5 changes: 5 additions & 0 deletions docker/fc31/support-llvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ License: Apache-2.0
From ClangBuiltLinux/tc-build.git
%install
cat /opt/src/build-llvm.py | sed -e 's/git:\/\/github/https:\/\/github/' | less > /opt/src/build-llvm.py.new
mv /opt/src/build-llvm.py /opt/src/build-llvm.py.old
ln -s /opt/src/build-llvm.py.new /opt/src/build-llvm.py
chmod +x /opt/src/build-llvm.py
cat /opt/src/build-llvm.py | grep github
./build-llvm.py --pgo -t X86 --build-stage1-only --install-stage1-only -I %{buildroot}/opt/llvm
rm -rf %{buildroot}/opt/llvm/share \
%{buildroot}/opt/llvm/lib/*.a* \
Expand Down
4 changes: 4 additions & 0 deletions plugins/cmd_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,11 +406,13 @@ def cmd_run(args):
mapdirs.add(os.path.dirname(args.kernel_rpm))
args.kernel = None
else:
print (args.kernel)
args.kernel = os.path.realpath(args.kernel)
if not os.path.isdir(args.kernel):
raise ValueError("Kernel path %r is not a directory/does not exist"
% (args.kernel))
mapdirs.add(args.kernel)
print (mapdirs)

if args.image:
try:
Expand Down Expand Up @@ -482,6 +484,8 @@ def cmd_run(args):
subprocess.call(["ssh", "root@%s" % (get_host_name(cname))])
else:
cname = get_container_name(vm_addr)
print (mapdirs.as_docker_bind())
# sys.exit(0)
docker_exec(["run"] + mapdirs.as_docker_bind() + [
"-v",
"%s:/plugins:ro" % (src_dir),
Expand Down
1 change: 1 addition & 0 deletions plugins/cmd_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def cmd_setup(args):
'ubuntu' : '16',
'rhel' : '8',
'redhat' : '8',
'centos' : '8',
}

# Python API stability is dissaster
Expand Down
7 changes: 6 additions & 1 deletion plugins/do-build.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,14 @@ def setup_from_pickle(args, pickle_params):
subprocess.check_output(['make', 'headers_install',
'INSTALL_HDR_PATH=/usr'], cwd=args.kernel)

if not os.path.isdir('/ccache/artemp'):
subprocess.check_output(['mkdir', '/ccache/artemp'])

subprocess.check_output(['chmod', '0777', '/ccache/artemp'])

switch_to_user(args)
if os.path.isdir('/ccache'):
os.environ['CCACHE_DIR'] = '/ccache'
os.environ['CCACHE_DIR'] = '/ccache/artemp/'

if args.shell:
os.execvp('/bin/bash', ['/bin/bash'])
Expand Down
5 changes: 5 additions & 0 deletions plugins/do-kvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ def remove_mounts():
def is_passable_mount(v):
if v[2] == "nfs" or v[2] == "nfs4":
return True
if v[1].startswith("/images"):
return True
if not v[0].startswith("/"):
print ("NOT START WITH")
return False
if v[1] == "/lab_tools":
return False
Expand Down Expand Up @@ -106,7 +109,9 @@ def setup_fs():
# Copy over local bind mounts, eg from docker -v
cnt = 0
for dfn, v in get_mtab().items():
print (v)
if not is_passable_mount(v):
print ("NOT PASSABLE")
continue

qemu_args["-fsdev"].add(
Expand Down
2 changes: 1 addition & 1 deletion utils/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def get_cache_fn(fn):
an impact on the operation of mkt - at worst it will run slower."""
global cache_dir
if cache_dir is None:
cache_dir = os.path.expanduser("~/.cache/mellanox/mkt/")
cache_dir = os.path.expanduser("/global/home/users/artemp/scratch/.cache/mellanox/mkt/")
# In MTL network, user home directories are located on /labhome
# and doesn't have enough space to build cache efficiently.
# Do nasty hack and replace labhome with swgwork
Expand Down

0 comments on commit 1f93502

Please sign in to comment.