コード例 #1
0
ファイル: application.py プロジェクト: zilliztech/phantoscope
def delete_milvus_collections_by_fields(app):
    for _, field in app['fields'].items():
        if field["type"] == "pipeline":
            pipe = MongoIns.search_by_name(PIPELINE_COLLECTION_NAME,
                                           field.get("value"))[0]
            name = f"{app.get('name')}_{pipe.get('encoder').get('instance').get('name').replace('phantoscope_', '')}"
            MilvusIns.del_milvus_collection(name)
コード例 #2
0
def delete_milvus_collections_by_fields(app):
    for _, field in app.fields.items():
        if field["type"] == "pipeline":
            pipe = pipeline_detail(field["value"])
            name = pipe.encoder.get("name")
            instance_name = pipe.encoder.get("instance")
            MilvusIns.del_milvus_collection(
                f"{app.name}_{name}_{instance_name}")
コード例 #3
0
ファイル: pipeline.py プロジェクト: shanghaikid/phantoscope
def delete_pipeline(name):
    try:
        p = del_pipeline(name)
        if not p:
            raise NotExistError("pipeline %s is not exist" % name, "")
        p = p[0]
        milvus_collection_name = f"{name}_{p.encoder}"
        MilvusIns.del_milvus_collection(milvus_collection_name)
        pipe = Pipeline(name=p.name,
                        input=p.input,
                        output=p.output,
                        dimension=p.dimension,
                        index_file_size=p.index_file_size,
                        metric_type=p.metric_type,
                        description=p.description,
                        processors=p.processors.split(","),
                        encoder=p.encoder)
        return pipe
    except Exception as e:
        logger.error(e)
        return e
コード例 #4
0
 def test_del_milvus_collection(self):
     """drop collection"""
     rv = MilvusIns.del_milvus_collection(self.name)
     assert rv == None