Creates the "build image", with Impala compiled and data loaded.
(self)
| 640 | container.removed = True |
| 641 | |
| 642 | def _create_build_image(self): |
| 643 | """Creates the "build image", with Impala compiled and data loaded.""" |
| 644 | container = self._create_container( |
| 645 | image=self.base_image, name=self.name + "-build", |
| 646 | logdir="build", |
| 647 | logname="log-build.txt", |
| 648 | # entrypoint.sh will create a user with our uid; this |
| 649 | # allows the shared file systems to work seamlessly |
| 650 | entrypoint=["/mnt/base/entrypoint.sh", "build", str(os.getuid())]) |
| 651 | self.containers.append(container) |
| 652 | self.monitor.add(container) |
| 653 | try: |
| 654 | logging.info("Docker container for build: %s", container) |
| 655 | _check_output(["docker", "start", container.id]) |
| 656 | if not self._run_container(container): |
| 657 | raise Exception("Build container failed.") |
| 658 | logging.info("Committing docker container.") |
| 659 | self.image = _check_output( |
| 660 | ["docker", "commit", |
| 661 | "-c", "LABEL pwd=" + self.git_root, |
| 662 | "-c", "USER impdev", |
| 663 | "-c", "WORKDIR /home/impdev/Impala", |
| 664 | "-c", 'CMD ["/home/impdev/Impala/docker/entrypoint.sh", "shell"]', |
| 665 | container.id, "impala:built-" + self.name]).strip() |
| 666 | logging.info("Committed docker image: %s", self.image) |
| 667 | finally: |
| 668 | if self.cleanup_containers: |
| 669 | self._stop_container(container) |
| 670 | self._rm_container(container) |
| 671 | |
| 672 | def _run_tests(self): |
| 673 | pool = multiprocessing.pool.ThreadPool(processes=self.suite_concurrency) |
no test coverage detected