Repository: jina-ai/jina
File: jina/orchestrate/deployments/__init__.py (Python)

Code before:
                    )  # the first index is for the head
                    _args.port_monitoring = (
                        helper.random_port()
                        if port_monitoring_index >= len(args.all_port_monitoring)
                        else args.all_port_monitoring[
                            port_monitoring_index
                        ]  # we skip the head port here
                    )
                    _args.port = helper.random_port()
                else:
                    _args.port = helper.random_port()
                    _args.port_monitoring = helper.random_port()

                # pod workspace if not set then derive from workspace
                if not _args.workspace:
                    _args.workspace = args.workspace
                replica_args.append(_args)
            result[shard_id] = replica_args
        return result

    @staticmethod
    def _set_uses_before_after_args(args: Namespace, entity_type: str) -> Namespace:

        _args = copy.deepcopy(args)
        _args.pod_role = PodRoleType.WORKER
        if not _args.host:
            _args.host = __default_host__
        _args.port = helper.random_port()

        if _args.name:
            _args.name += f'/{entity_type}-0'
        else:
            _args.name = f'{entity_type}-0'

        if 'uses_before' == entity_type:
            _args.uses_requests = None
            _args.uses = args.uses_before or __default_executor__
        elif 'uses_after' == entity_type:
            _args.uses_requests = None
            _args.uses = args.uses_after or __default_executor__
        else:
            raise ValueError(
                f'uses_before/uses_after pod does not support type {entity_type}'
            )

        # pod workspace if not set then derive from workspace
        if not _args.workspace:
            _args.workspace = args.workspace
        return _args

    def _parse_base_deployment_args(self, args):

Review comment (suggestion):
```suggestion
_args.host = _args.host or __default_host__
```

Code after:
                        helper.random_port()
                        if replica_id >= len(args.all_port_monitoring)
                        else args.all_port_monitoring[replica_id]
                    )
                    # if there are no shards/replicas, we dont need to distribute ports randomly
                    # we should rather use the pre assigned one
                    _args.port = helper.random_port()
                elif shards > 1:
                    port_monitoring_index = (
                        replica_id + replicas * shard_id + 1
                    )  # the first index is for the head
                    _args.port_monitoring = (
                        helper.random_port()
                        if port_monitoring_index >= len(args.all_port_monitoring)
                        else args.all_port_monitoring[
                            port_monitoring_index
                        ]  # we skip the head port here
                    )
                    _args.port = helper.random_port()
                else:
                    _args.port = helper.random_port()
                    _args.port_monitoring = helper.random_port()

                # pod workspace if not set then derive from workspace
                if not _args.workspace:
                    _args.workspace = args.workspace
                replica_args.append(_args)
            result[shard_id] = replica_args
        return result

    @staticmethod
    def _set_uses_before_after_args(args: Namespace, entity_type: str) -> Namespace:

        _args = copy.deepcopy(args)
        _args.pod_role = PodRoleType.WORKER
        _args.host = _args.host or __default_host__
        _args.port = helper.random_port()

        if _args.name:
            _args.name += f'/{entity_type}-0'
        else:
            _args.name = f'{entity_type}-0'

        if 'uses_before' == entity_type:
            _args.uses_requests = None
            _args.uses = args.uses_before or __default_executor__
        elif 'uses_after' == entity_type:
            _args.uses_requests = None
            _args.uses = args.uses_after or __default_executor__
        else:
            raise ValueError(