Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/test' into prod
Browse files Browse the repository at this point in the history
  • Loading branch information
azat-badretdin committed Apr 19, 2022
2 parents b6eaf96 + 8fb4ac7 commit f8c8990
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions scripts/pgap.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
import contextlib
import glob
import json
import multiprocessing as mp
import os
import platform
import queue
import re
import shutil
import subprocess
import tarfile
import threading
import time
import tempfile
import xml
Expand Down Expand Up @@ -655,17 +655,22 @@ def str2sec(s):
def update(self):
self.update_self()
threads = list()
docker_thread = threading.Thread(target = self.install_docker)
docker_thread = mp.Process(target = self.install_docker, name='docker image pull')
docker_thread.start()
threads.append(docker_thread)
# precreate the directory where the tarfile will be unloaded.
os.makedirs(f"{self.install_dir}/input-{self.use_version}/uniColl_path", exist_ok=True)
self.install_data(threads)
genomes_thread = threading.Thread(target = self.install_test_genomes)
genomes_thread = mp.Process(target = self.install_test_genomes, name='test genomes installation')
genomes_thread.start()
threads.append(genomes_thread)
global_exit_value = 0
for thread in threads:
thread.join()
if thread.exitcode != 0:
global_exit_value = thread.exitcode
if global_exit_value != 0:
raise Exception(f'installation of some or all of components failed. Please remove {self.data_path}, {self.install_dir}/test_genomes, {self.test_genomes_path} directories and try again.')
self.write_version()

def install_docker(self):
Expand Down Expand Up @@ -723,7 +728,7 @@ def install_data(self, threads):
else:
remote_path = f"https://s3.amazonaws.com/pgap/input-{self.use_version}.{suffix}{package}.tgz"
if not os.path.isfile(guard_file):
url_thread = threading.Thread(target = install_url, args=(remote_path, self.install_dir, self.args.quiet, self.args.teamcity, guard_file, ))
url_thread = mp.Process(target = install_url, name='{package} installation',args=(remote_path, self.install_dir, self.args.quiet, self.args.teamcity, guard_file, ))
url_thread.start()
threads.append(url_thread)
else:
Expand Down

0 comments on commit f8c8990

Please sign in to comment.