use of com.qlangtech.tis.coredefine.module.action.IRCController in project plugins by qlangtech.
the class TestDefaultIncrK8sConfig method getIncrSync.
public static IRCController getIncrSync() {
IPluginStore<IncrStreamFactory> store = TIS.getPluginStore(totalpay, IncrStreamFactory.class);
assertNotNull(store);
IncrStreamFactory incrStream = store.getPlugin();
assertNotNull(incrStream);
IRCController incrSync = incrStream.getIncrSync();
assertNotNull(incrSync);
return incrSync;
}
use of com.qlangtech.tis.coredefine.module.action.IRCController in project plugins by qlangtech.
the class TestK8sIncrSync method testGetRCDeployment.
public void testGetRCDeployment() {
IRCController incrSync = TestDefaultIncrK8sConfig.getIncrSync();
IDeploymentDetail rcDeployment = incrSync.getRCDeployment(new TargetResName(TestDefaultIncrK8sConfig.totalpay));
assertNotNull(rcDeployment);
}
use of com.qlangtech.tis.coredefine.module.action.IRCController in project plugins by qlangtech.
the class TestDefaultIncrK8sConfig method testCreateIncrDeployment.
public void testCreateIncrDeployment() throws Exception {
IRCController incr = incrFactory.getIncrSync();
assertNotNull(incr);
assertFalse(s4totalpay + " shall have not deploy incr instance in k8s", incr.getRCDeployment(new TargetResName(s4totalpay)) != null);
RcDeployment incrSpec = new RcDeployment();
incrSpec.setCpuLimit(Specification.parse("1"));
incrSpec.setCpuRequest(Specification.parse("500m"));
incrSpec.setMemoryLimit(Specification.parse("1G"));
incrSpec.setMemoryRequest(Specification.parse("500M"));
incrSpec.setReplicaCount(1);
long timestamp = 20190820171040l;
try {
incr.deploy(new TargetResName(s4totalpay), incrSpec, timestamp);
} catch (Exception e) {
throw e;
}
}
use of com.qlangtech.tis.coredefine.module.action.IRCController in project plugins by qlangtech.
the class TestDefaultIncrK8sConfig method testlistPodsAndWatchLog.
// public void testDefaultIncrK8sConfig() throws Exception {
// DefaultIncrK8sConfig incrK8sCfg = new DefaultIncrK8sConfig();
// incrK8sCfg.namespace = "tis";
// incrK8sCfg.k8sName = "minikube";
// incrK8sCfg.imagePath = "registry.cn-hangzhou.aliyuncs.com/tis/tis-incr:latest";
//
// incrK8sCfg.getIncrSync().removeInstance("search4totalpay");
// }
public void testlistPodsAndWatchLog() throws Exception {
IRCController incrSync = getIncrSync();
String podName = "podname";
assertNotNull(incrSync);
final AtomicInteger msgReceiveCount = new AtomicInteger();
incrSync.listPodAndWatchLog(new TargetResName(totalpay), podName, new ILogListener() {
@Override
public void sendMsg2Client(Object biz) throws IOException {
System.out.println("flushCount:" + msgReceiveCount.incrementAndGet());
}
@Override
public void read(Object event) {
}
@Override
public boolean isClosed() {
return false;
}
});
Thread.sleep(5000);
assertTrue(msgReceiveCount.get() > 0);
}
use of com.qlangtech.tis.coredefine.module.action.IRCController in project plugins by qlangtech.
the class TestK8sIncrSync method testLaunchIncrProcess.
public void testLaunchIncrProcess() throws Exception {
IRCController incrSync = TestDefaultIncrK8sConfig.getIncrSync();
incrSync.relaunch(new TargetResName(Config.S4TOTALPAY));
}
Aggregations