Search in sources :

Example 1 with IRCController

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;
}
Also used : IRCController(com.qlangtech.tis.coredefine.module.action.IRCController)

Example 2 with IRCController

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);
}
Also used : TargetResName(com.qlangtech.tis.coredefine.module.action.TargetResName) IRCController(com.qlangtech.tis.coredefine.module.action.IRCController) IDeploymentDetail(com.qlangtech.tis.coredefine.module.action.IDeploymentDetail)

Example 3 with IRCController

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;
    }
}
Also used : TargetResName(com.qlangtech.tis.coredefine.module.action.TargetResName) RcDeployment(com.qlangtech.tis.coredefine.module.action.impl.RcDeployment) IRCController(com.qlangtech.tis.coredefine.module.action.IRCController)

Example 4 with IRCController

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);
}
Also used : TargetResName(com.qlangtech.tis.coredefine.module.action.TargetResName) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) IRCController(com.qlangtech.tis.coredefine.module.action.IRCController) ILogListener(com.qlangtech.tis.trigger.jst.ILogListener) IOException(java.io.IOException)

Example 5 with IRCController

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));
}
Also used : TargetResName(com.qlangtech.tis.coredefine.module.action.TargetResName) IRCController(com.qlangtech.tis.coredefine.module.action.IRCController)

Aggregations

IRCController (com.qlangtech.tis.coredefine.module.action.IRCController)6 TargetResName (com.qlangtech.tis.coredefine.module.action.TargetResName)5 IDeploymentDetail (com.qlangtech.tis.coredefine.module.action.IDeploymentDetail)1 RcDeployment (com.qlangtech.tis.coredefine.module.action.impl.RcDeployment)1 ILogListener (com.qlangtech.tis.trigger.jst.ILogListener)1 IOException (java.io.IOException)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1