Skip to content

Commit

Permalink
Docker update
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanming-hu committed Nov 15, 2017
1 parent 924569f commit 356db27
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM ubuntu:16.04

RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test
RUN mkdir -p /home/travis/
RUN apt-get update
RUN apt-get install -y python3
RUN python3 install.py
14 changes: 9 additions & 5 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ def execute_command(line):
return os.system(line)

if __name__ == '__main__':
usename = pwd.getpwuid(os.getuid())[0]


if len(sys.argv) > 1:
build_type = sys.argv[1]
print('Build type: ', build_type)
Expand All @@ -17,6 +16,11 @@ def execute_command(line):
if os.environ.get('TC_CI', '') == '1':
build_type = 'ci'

if build_type == 'ci':
username = pwd.getpwuid(os.getuid())[0]
else:
username = 'travis'

try:
import pip
except Exception as e:
Expand All @@ -25,8 +29,8 @@ def execute_command(line):
execute_command('python3 get-pip.py --user')
execute_command('rm get-pip.py')
execute_command('sudo apt-get update')
execute_command('sudo apt-get install -y python3-dev git build-essential cmake make g++ python3-tk')
os.chdir('/home/{}/'.format(usename))
execute_command('sudo apt-get install -y python3-dev git build-essential cmake make g++ python3-tk ffmpeg')
os.chdir('/home/{}/'.format(username))
execute_command('mkdir -p repos')
os.chdir('repos')
if os.path.exists('taichi'):
Expand All @@ -38,7 +42,7 @@ def execute_command(line):
execute_command('git clone https://github.com/yuanming-hu/taichi_runtime external/lib')

# Make sure there is no existing Taichi ENV
taichi_root_dir = "/home/{}/repos/".format(usename)
taichi_root_dir = "/home/{}/repos/".format(username)
execute_command('echo "export TAICHI_NUM_THREADS=8" >> ~/.bashrc')
execute_command('echo "export TAICHI_ROOT_DIR={}" >> ~/.bashrc'.format(taichi_root_dir))
execute_command('echo "export PYTHONPATH=\$TAICHI_ROOT_DIR/taichi/python/:\$PYTHONPATH" >> ~/.bashrc')
Expand Down

0 comments on commit 356db27

Please sign in to comment.