class_docstr: test pipeline to triton model
code: def test_onnx(self):
      node_config = AutoConfig.TritonGPUConfig(
          device_ids=[0, 1],
          num_instances_per_device=3,
          max_batch_size=128,
          batch_latency_micros=100000,
          preferred_batch_size=[8, 16],
      )
      p = (
          pipe.input("path")
          .map("path", "img", ops.image_decode.cv2())
          .map(
              "img",
              "embedding",
              ops.towhee.test_resnet18(),
              config=node_config,
          )
          .output("embedding")
      )
      server_config = {"format_priority": ["onnx"]}
  
      dag_repr = copy.deepcopy(p.dag_repr)
      model_name = "towhee.test-resnet18-1"
      with TemporaryDirectory(dir=".") as root:
          self.assertTrue(
              Builder(dag_repr, root, server_config).build()
          )
  
          pipe_dag_file = root + "/" + PIPELINE_NAME + "/1/pipe.pickle"
          pipe_model_file = root + "/" + PIPELINE_NAME + "/1/model.py"
          self.assertTrue(Path(pipe_dag_file).exists())
          self.assertTrue(Path(pipe_model_file).exists())
          self.assertTrue(
              (Path(root) / model_name / "1/model.onnx").exists()
          )
          self.assertTrue(
              (Path(root) / model_name / "config.pbtxt").exists()
          )
  
          with open(str(pipe_dag_file), "rb") as f_dag:
              dag_repr = pickle.load(f_dag)
              for _, node in dag_repr.nodes.items():
                  if node.config.acc_info is not None:
                      self.assertEqual(
                          node.config.acc_info.triton.model_name,
                          model_name,
                      )
                      self.assertEqual(
                          node.config.server.device_ids, [0, 1]
                      )
                      self.assertEqual(
                          node.config.server.num_instances_per_device, 3
                      )
                      self.assertEqual(
                          node.config.server.max_batch_size, 128
                      )
                      self.assertEqual(
                          node.config.server.batch_latency_micros,
                          100000,
                      )
                      self.assertEqual(
                          node.config.server.triton.preferred_batch_size,
                          [8, 16],
                      )
  
file_path: towhee/tests/unittests/serve/triton/test_pipeline_builder.py
imports: import copy
  import unittest
  from pathlib import Path
  from tempfile import TemporaryDirectory
  from towhee.runtime import pipe, ops, AutoConfig
  from towhee.runtime.dag_repr import DAGRepr
  from towhee.serve.triton.constant import PIPELINE_NAME
  from towhee.serve.triton.pipeline_builder import Builder
  from towhee.utils.thirdparty.dill_util import dill
label_desc: Use image node_id 1 for calling the TestPipelineBuilder obj's underlying member method code with example usage: obj.test_onnx() without return types