def wait_for_bootstrap_completion(context, timeout): peers = context.interface.get_peers(context) brokers = [] try: with common_util.Timeout(timeout): common_util.wait_until_in_log( peers, "Starting profiling server with listenAddress = 0.0.0.0:6060") # Check Kafka logs if "kafka0" in context.composition.collectServiceNames(): kafkas = orderer_util.getKafkaBrokerList( context, "orderer0.example.com") # Remove the ports from the list for kafka in kafkas: broker = kafka.split(":") brokers.append(broker[0]) common_util.wait_until_in_log(brokers, " Startup complete. ") finally: assert common_util.is_in_log( peers, "Starting profiling server with listenAddress = 0.0.0.0:6060" ), "The peer containers are not ready in the allotted time ({} seconds)".format( timeout) assert common_util.is_in_log( brokers, " Startup complete. " ), "The kafka containers are not ready in the allotted time ({} seconds)".format( timeout) # A 5-second additional delay ensures ready state time.sleep(5)
def start_firstnetwork_impl(context): curpath = os.path.realpath('.') composeFiles = [ "%s/fabric-samples/first-network/docker-compose-cli.yaml" % (curpath) ] config_util.makeProjectConfigDir(context) shutil.copyfile( "{0}/fabric-samples/first-network/crypto-config.yaml".format(curpath), "{0}/configs/{1}/crypto-config.yaml".format(curpath, context.projectName)) shutil.copyfile( "{0}/fabric-samples/first-network/configtx.yaml".format(curpath), "{0}/configs/{1}/configtx.yaml".format(curpath, context.projectName)) os.mkdir("{0}/configs/{1}/channel-artifacts".format( curpath, context.projectName)) # config_util.buildCryptoFile(context, 2, 2, numOrderers, 2, ouEnable=ouEnabled) generateCryptoArtifacts(context, "mychannel") # config_util.generateCrypto(context, "./configs/{0}/crypto.yaml".format(context.projectName)) # config_util.generateConfig(context, "byfn-sys-channel", "TwoOrgsChannel", "TwoOrgsOrdererGenesis") # shutil.copyfile("{0}/configs/{1}/byfn-sys-channel.tx".format(curpath, context.projectName), "{0}/configs/{1}/channel.tx".format(curpath, context.projectName)) timeout = 120 with common_util.Timeout(timeout): if not hasattr(context, "composition"): context.composition = compose_util.Composition( context, composeFiles, projectName=context.projectName, startContainers=True) else: context.composition.composeFilesYaml = composeFiles context.composition.up() context.compose_containers = context.composition.collectServiceNames() common_util.wait_until_in_log( ["cli"], "Query successful on peer1.org2 on channel ")
def step_impl(context, component, data, timeout): with common_util.Timeout(timeout): common_util.wait_until_in_log([component], data)
def step_impl(context, component, data, timeout): with ic_timeout(timeout, exception=RuntimeError): common_util.wait_until_in_log([component], data)