async invoke(config, event, debugInfo = {}) {
    const runtime = config.runtime;
    if (!SUPPORTED_RUNTIMES.includes(runtime)) {
      throw new Error(`Unsupported function runtime ${runtime}.`);
    }

    const debugPort = debugInfo.debugPort;
    const identifier = config.identifier;
    const functionId = this._buildIdString(config.region, config.accountId,
      config.serviceName, config.functionName);
    debug(`Build function id ${functionId}`);
    const codeDir = await this._getCodeDir(config.codeAbsPath);
    const archive = await LocalRuntime._getCodeArchive(codeDir);
    debug(`Code archive tarred at ${archive}.`);
    // Constructing a path matches the target OS.
    const workingDir =
      `${WORKING_DIR_PREFIX}/${identifier.serviceName}/${identifier.functionName}`;
    debug(`Installing code tar archive into ${workingDir} on edge...`);
    await this.container.copy(archive, workingDir);

    const checksum = await this._buildChecksum(archive);
    debug(`Code checksum is ${checksum}.`);

    await this.client.deploy({
      debugPort,
      runtime,
      functionId,
      region: config.region,
      accountId: config.accountId,
      serviceName: identifier.serviceName,
      functionName: identifier.functionName,
      handler: config.handler,
      timeout: config.timeout,
      memory: config.memory,
      envVars: config.envVars,
      codeDir: workingDir,
      codeChecksum: checksum,
      pinned: false
    });

    if (debugPort && debugInfo.outputDebuggerConfigs) {
      const configs = this._getDebuggerConfigs(config.runtime, codeDir, workingDir, debugPort);
      console.log(configs);
    }

    let timer;
    try {
      debug(`Invoking function ${functionId} with ${event}.`);
      const invocation = this.client.invoke({
        functionId,
        event
      });
      const timeout = config.timeout;
      timer = this._configureInterrupt(identifier, timeout, !!debugPort);
      const result = await invocation;
      console.log(result.toString());
    } finally {
      if (timer) {
        clearTimeout(timer);
      }
    }
  }
Invoke the function with specified event.

@param config the config of the function that's invoked.
@param event the event that triggers the function.
@param debugInfo the info about debugging mode.
@returns {Promise.<void>}