comparison toolfactory/rgToolFactory2.py @ 107:18e616939a91 draft

Uploaded
author fubar
date Sat, 28 Nov 2020 02:52:24 +0000
parents 6de08f44e551
children e878bfc6b80c
comparison
equal deleted inserted replaced
106:6de08f44e551 107:18e616939a91
723 def prun(container, tout, cl, user="biodocker"): 723 def prun(container, tout, cl, user="biodocker"):
724 rlog = container.exec_run(cl, user=user) 724 rlog = container.exec_run(cl, user=user)
725 slogl = str(rlog).split("\\n") 725 slogl = str(rlog).split("\\n")
726 slog = "\n".join(slogl) 726 slog = "\n".join(slogl)
727 tout.write(f"## got rlog {slog} from {cl}\n") 727 tout.write(f"## got rlog {slog} from {cl}\n")
728
729 dgroup = grp.getgrnam("docker")[2]
730 if os.path.exists(self.tlog): 728 if os.path.exists(self.tlog):
731 tout = open(self.tlog, "a") 729 tout = open(self.tlog, "a")
732 else: 730 else:
733 tout = open(self.tlog, "w") 731 tout = open(self.tlog, "w")
734 planemoimage = "quay.io/fubar2/planemo-biocontainer" 732 planemoimage = "quay.io/fubar2/planemo-biocontainer"
747 "sleep 30m", 745 "sleep 30m",
748 detach=True, 746 detach=True,
749 user="biodocker", 747 user="biodocker",
750 volumes={f"{tvolname}": {"bind": "/toolfactory", "mode": "rw"}}, 748 volumes={f"{tvolname}": {"bind": "/toolfactory", "mode": "rw"}},
751 ) 749 )
752 cl = f"groupmod -g {dgroup} docker"
753 prun(container, tout, cl, user="root")
754 cl = f"mkdir -p {destdir}" 750 cl = f"mkdir -p {destdir}"
755 prun(container, tout, cl, user="root") 751 prun(container, tout, cl, user="root")
756 cl = f"rm -rf {destdir}/*" 752 cl = f"rm -rf {destdir}/*"
757 prun(container, tout, cl, user="root") 753 prun(container, tout, cl, user="root")
758 ptestpath = os.path.join(destdir, "tfout", xreal) 754 ptestpath = os.path.join(destdir, "tfout", xreal)
759 self.copy_to_container(self.tooloutdir, destdir, container) 755 self.copy_to_container(self.tooloutdir, destdir, container)
760 cl = "chmod -R a+rwx /toolfactory" 756 cl = "chown -R biodocker /toolfactory"
761 prun(container, tout, cl, user="root") 757 prun(container, tout, cl, user="root")
762 rlog = container.exec_run(f"ls -la {destdir}") 758 rlog = container.exec_run(f"ls -la {destdir}")
763 ptestcl = f"planemo test --update_test_data --no_cleanup --test_data {destdir}/tfout/test-data --galaxy_root /home/biodocker/galaxy-central {ptestpath}" 759 ptestcl = f"planemo test --update_test_data --no_cleanup --test_data {destdir}/tfout/test-data --galaxy_root /home/biodocker/galaxy-central {ptestpath}"
764 try: 760 try:
765 rlog = container.exec_run(ptestcl) 761 rlog = container.exec_run(ptestcl)