Example #1
0
    def gen_workflow_job(self, phase):
        # All jobs require the setup job
        job_def = OrderedDict()
        job_def["name"] = self.gen_build_name(phase)
        job_def["requires"] = ["setup"]

        if phase == "test":

            # TODO When merging the caffe2 and pytorch jobs, it might be convenient for a while to make a
            #  caffe2 test job dependent on a pytorch build job. This way we could quickly dedup the repeated
            #  build of pytorch in the caffe2 build job, and just run the caffe2 tests off of a completed
            #  pytorch build job (from https://github.com/pytorch/pytorch/pull/17323#discussion_r259452641)

            dependency_build = self.parent_build or self
            job_def["requires"].append(
                dependency_build.gen_build_name("build"))
            job_name = "pytorch_linux_test"
        else:
            job_name = "pytorch_linux_build"

        if not self.is_important:
            job_def["filters"] = gen_branches_only_filter_dict()
        job_def.update(self.gen_workflow_params(phase))

        return {job_name: job_def}
    def gen_workflow_job(self, phase):
        job_def = OrderedDict()
        job_def["name"] = self.construct_phase_name(phase)

        if phase == "test":
            job_def["requires"] = [self.construct_phase_name("build")]
            job_name = "caffe2_" + self.get_platform() + "_test"
        else:
            job_name = "caffe2_" + self.get_platform() + "_build"

        if not self.is_important:
            job_def["filters"] = gen_branches_only_filter_dict()
        job_def.update(self.gen_workflow_params(phase))
        return {job_name: job_def}