fbpcs/private_computation/service/compute_metrics_stage_service.py [129:182]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        pc_instance.instances.append(PCSMPCInstance.from_mpc_instance(mpc_instance))
        return pc_instance

    def get_status(
        self,
        pc_instance: PrivateComputationInstance,
    ) -> PrivateComputationInstanceStatus:
        """Updates the MPCInstances and gets latest PrivateComputationInstance status

        Arguments:
            private_computation_instance: The PC instance that is being updated

        Returns:
            The latest status for private_computation_instance
        """
        return get_updated_pc_status_mpc_game(pc_instance, self._mpc_service)

    # TODO: Make an entity representation for game args that can dump a dict to pass
    # to mpc service. The entity will give us type checking and ensure that all args are
    # specified.
    def _get_compute_metrics_game_args(
        self,
        private_computation_instance: PrivateComputationInstance,
    ) -> List[Dict[str, Any]]:
        """Gets the game args passed to game binaries by onedocker

        When onedocker spins up containers to run games, it unpacks a dictionary containing the
        arguments required by the game binary being ran. This function prepares that dictionary.

        Args:
            pc_instance: the private computation instance to generate game args for

        Returns:
            MPC game args to be used by onedocker
        """
        game_args = []

        # If this is to recover from a previous MPC compute failure
        if (
            ready_for_partial_container_retry(private_computation_instance)
            and not self._skip_partial_container_retry
        ):
            game_args_to_retry = gen_mpc_game_args_to_retry(
                private_computation_instance
            )
            if game_args_to_retry:
                game_args = game_args_to_retry

        # If this is a normal run, dry_run, or unable to get the game args to retry from mpc service
        if not game_args:
            num_containers = private_computation_instance.num_mpc_containers
            # update num_containers if is_vaildating = true
            if self._is_validating:
                num_containers += 1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



fbpcs/private_computation/service/decoupled_attribution_stage_service.py [123:174]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        pc_instance.instances.append(PCSMPCInstance.from_mpc_instance(mpc_instance))
        return pc_instance

    def get_status(
        self,
        pc_instance: PrivateComputationInstance,
    ) -> PrivateComputationInstanceStatus:
        """Updates the MPCInstances and gets latest PrivateComputationInstance status

        Arguments:
            private_computation_instance: The PC instance that is being updated

        Returns:
            The latest status for private_computation_instance
        """
        return get_updated_pc_status_mpc_game(pc_instance, self._mpc_service)

    # For now, only passing the attribution game arguments, as this game is currently only used for PA.
    def _get_compute_metrics_game_args(
        self,
        private_computation_instance: PrivateComputationInstance,
    ) -> List[Dict[str, Any]]:
        """Gets the game args passed to game binaries by onedocker

        When onedocker spins up containers to run games, it unpacks a dictionary containing the
        arguments required by the game binary being ran. This function prepares that dictionary.

        Args:
            pc_instance: the private computation instance to generate game args for

        Returns:
            MPC game args to be used by onedocker
        """
        game_args = []

        # If this is to recover from a previous MPC compute failure
        if (
            ready_for_partial_container_retry(private_computation_instance)
            and not self._skip_partial_container_retry
        ):
            game_args_to_retry = gen_mpc_game_args_to_retry(
                private_computation_instance
            )
            if game_args_to_retry:
                game_args = game_args_to_retry

        # If this is a normal run, dry_run, or unable to get the game args to retry from mpc service
        if not game_args:
            num_containers = private_computation_instance.num_mpc_containers
            # update num_containers if is_vaildating = true
            if self._is_validating:
                num_containers += 1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



