京东如何进行网站建设,昆山做网站好的,哈尔滨有多少家网站建设公司,自己做的网站怎样链接数据库1.什么是fate-serving-server?
FATE-Serving 是一个高性能、工业化的联邦学习模型服务系统#xff0c;专为生产环境而设计,主要用于在线推理。
2.fate-serving-server源码编译
下载fate-serving-serving项目#xff08;GitHub - FederatedAI/FATE-Serving: A scalable, h…1.什么是fate-serving-server?
FATE-Serving 是一个高性能、工业化的联邦学习模型服务系统专为生产环境而设计,主要用于在线推理。
2.fate-serving-server源码编译
下载fate-serving-serving项目GitHub - FederatedAI/FATE-Serving: A scalable, high-performance serving system for federated learning models并执行下面的命令
mvn clean
mvn package
3.修改日志输出等级
修改AsyncRoot的level等级为debug
修改AppenderRef中的info和console的日志等级为debug
具体配置文件如下
?xml version1.0 encodingUTF-8?
!--~ Copyright 2019 The FATE Authors. All Rights Reserved.~~ Licensed under the Apache License, Version 2.0 (the License);~ you may not use this file except in compliance with the License.~ You may obtain a copy of the License at~~ http://www.apache.org/licenses/LICENSE-2.0~~ Unless required by applicable law or agreed to in writing, software~ distributed under the License is distributed on an AS IS BASIS,~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.~ See the License for the specific language governing permissions and~ limitations under the License.--
Configuration statusERROR monitorInterval60PropertiesProperty namelogdirlogs/PropertyProperty nameprojectfate/PropertyProperty namemoduleserving-server/Property/PropertiesAppendersConsole nameconsole targetSYSTEM_OUTPatternLayout charsetUTF-8pattern%d{yyyy-MM-dd HH:mm:ss,SSS} [%-5p] %c{1.}(%F:%L) - %m%n//ConsoleRollingFile nameinfo fileName${logdir}/${project}-${module}.logfilePattern${logdir}/%d{yyyy-MM-dd}/${project}-${module}.log.%d{yyyy-MM-dd}PatternLayout charsetUTF-8 pattern%d{yyyy-MM-dd HH:mm:ss,SSS} [%-5p] %c{1.}(%F:%L) - %m%n/PoliciesTimeBasedTriggeringPolicy//PoliciesDefaultRolloverStrategy max24//RollingFileRollingFile nameflow fileName${logdir}/flow.logfilePattern${logdir}/%d{yyyy-MM-dd}/flow.log.%d{yyyy-MM-dd}.logPatternLayout charsetUTF-8 pattern%d{yyyy-MM-dd HH:mm:ss,SSS}|%m%n/PoliciesTimeBasedTriggeringPolicy//PoliciesDefaultRolloverStrategy max24//RollingFileRollingFile nameerror fileName${logdir}/${project}-${module}-error.logfilePattern${logdir}/${project}-${module}-error.log.%d{yyyy-MM-dd}.logPatternLayout charsetUTF-8 pattern%d{yyyy-MM-dd HH:mm:ss,SSS} [%-5p] %c{1.}(%F:%L) - %m%n/PoliciesTimeBasedTriggeringPolicy//PoliciesDefaultRolloverStrategy max24//RollingFileRollingFile namedebug fileName${logdir}/${project}-${module}-debug.logfilePattern${logdir}/${project}-${module}-debug.log.%d{yyyy-MM-dd}.logPatternLayout charsetUTF-8 pattern%d{yyyy-MM-dd HH:mm:ss,SSS} [%-5p] %c{1.}(%F:%L) - %m%n/PoliciesTimeBasedTriggeringPolicy//PoliciesDefaultRolloverStrategy max24//RollingFile/AppendersLoggerslogger nameorg.apache.zookeeper levelWARN/loggerAsyncLogger nameflow levelinfo includeLocationtrue additivitytrueAppenderRef refflow//AsyncLogger!--AsyncLogger namedebug leveldebug includeLocationtrue additivityfalseAppenderRef refdebug//AsyncLogger--AsyncRoot leveldebug includeLocationtrueAppenderRef refconsole leveldebug/AppenderRef refinfo leveldebug/AppenderRef referror levelerror//AsyncRoot/Loggers
/Configuration
4.在mockAdater增加host自定义取数逻辑
1.找到MockAdapter.java中的getData方法取数逻辑
/** Copyright 2019 The FATE Authors. All Rights Reserved.** Licensed under the Apache License, Version 2.0 (the License);* you may not use this file except in compliance with the License.* You may obtain a copy of the License at** http://www.apache.org/licenses/LICENSE-2.0** Unless required by applicable law or agreed to in writing, software* distributed under the License is distributed on an AS IS BASIS,* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.*/package com.webank.ai.fate.serving.adaptor.dataaccess;import com.webank.ai.fate.serving.core.bean.Context;
import com.webank.ai.fate.serving.core.bean.ReturnResult;
import com.webank.ai.fate.serving.core.constant.StatusCode;
import com.webank.ai.fate.serving.core.utils.JsonUtil;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;import java.util.HashMap;
import java.util.Map;public class MockAdapter extends AbstractSingleFeatureDataAdaptor {private static final Logger logger LoggerFactory.getLogger(MockAdapter.class);Overridepublic void init() {environment.getProperty(port);}Overridepublic ReturnResult getData(Context context, MapString, Object featureIds) {logger.info(getData_featureIds:{}, featureIds);logger.info(Context:{}, context);logger.info(appId:{} callName:{} actionType:{} caseId:{},serviceId:{} servoceName:{},context.getApplyId(), context.getCallName(), context.getActionType(), context.getCaseId(),context.getServiceId(), context.getServiceName());ReturnResult returnResult new ReturnResult();MapString, Object data new HashMap();try {String mockData x0:1,x1:5,x2:13,x3:58,x4:95,x5:352,x6:418,x7:833,x8:888,x9:937,x10:32776;for (String kv : StringUtils.split(mockData, ,)) {String[] a StringUtils.split(kv, :);data.put(a[0], Double.valueOf(a[1]));}returnResult.setData(data);returnResult.setRetcode(StatusCode.SUCCESS);if (logger.isDebugEnabled()) {logger.debug(MockAdapter result, {}, JsonUtil.object2Json(returnResult));}} catch (Exception ex) {logger.error(ex.getMessage());returnResult.setRetcode(StatusCode.SYSTEM_ERROR);}return returnResult;}
}
默认的取数逻辑是一个x0-x10的一个默认值替换旧的取数逻辑重新打包fate-serving-extension服务并替换对应的jar包