class_docstr: Builds a docker image for a project using Kaniko.
class_docstr_tok: ["Builds","a","docker","image","for","a","project","using","Kaniko","."]
docstr: Create a KanikoBuilder from a config dict.
  
  Arguments:
      config: A dict containing the builder config. Must contain a "type" key
          with value "kaniko".
      environment: The environment to use for the build.
      registry: The registry to use for the build.
      verify: Whether to verify the builder config.
  
  Returns:
      A KanikoBuilder instance.
docstr_tok: ["Create","a","KanikoBuilder","from","a","config","dict",".","Arguments",":","config",":","A","dict","containing","the","builder","config",".","Must","contain","a","``","type","''","key","with","value","``","kaniko","''",".","environment",":","The","environment","to","use","for","the","build",".","registry",":","The","registry","to","use","for","the","build",".","verify",":","Whether","to","verify","the","builder","config",".","Returns",":","A","KanikoBuilder","instance","."]
code: def from_config(
      cls,
      config: dict,
      environment: AbstractEnvironment,
      registry: AbstractRegistry,
      verify: bool = True,
      login: bool = True,
  ) -> "AbstractBuilder":
      """Create a KanikoBuilder from a config dict.
  
      Arguments:
          config: A dict containing the builder config. Must contain a "type" key
              with value "kaniko".
          environment: The environment to use for the build.
          registry: The registry to use for the build.
          verify: Whether to verify the builder config.
  
      Returns:
          A KanikoBuilder instance.
      """
      if config.get("type") != "kaniko":
          raise LaunchError(
              "Builder config must include 'type':'kaniko' to create a KanikoBuilder."
          )
      build_context_store = config.get("build-context-store")
      if build_context_store is None:
          raise LaunchError(
              "You are required to specify an external build "
              "context store for Kaniko builds. Please specify a  "
              "storage url in the 'build_context_store' field of your builder config."
          )
      build_job_name = config.get(
          "build-job-name", "wandb-launch-container-build"
      )
      secret_name = config.get("secret-name", "")
      secret_key = config.get("secret-key", "")
      kaniko_image = config.get(
          "kaniko-image", "gcr.io/kaniko-project/executor:v1.11.0"
      )
      image_uri = config.get("destination")
      if image_uri is not None:
          registry = registry_from_uri(image_uri)
      return cls(
          environment,
          registry,
          build_context_store=build_context_store,
          build_job_name=build_job_name,
          secret_name=secret_name,
          secret_key=secret_key,
          image=kaniko_image,
      )
  
imports: import asyncio
  import base64
  import json
  import logging
  import os
  import tarfile
  import tempfile
  import time
  import traceback
  from typing import Optional
  import wandb
  from wandb.sdk.launch.agent.job_status_tracker import JobAndRunStatusTracker
  from wandb.sdk.launch.builder.abstract import AbstractBuilder
  from wandb.sdk.launch.builder.build import registry_from_uri
  from wandb.sdk.launch.environment.abstract import AbstractEnvironment
  from wandb.sdk.launch.environment.azure_environment import AzureEnvironment
  from wandb.sdk.launch.registry.abstract import AbstractRegistry
  from wandb.sdk.launch.registry.azure_container_registry import AzureContainerRegistry
  from wandb.sdk.launch.registry.elastic_container_registry import ElasticContainerRegistry
  from wandb.sdk.launch.registry.google_artifact_registry import GoogleArtifactRegistry
  from wandb.util import get_module
  from .._project_spec import EntryPoint, LaunchProject, create_metadata_file, get_entry_point_command
  from ..errors import LaunchError
  from ..utils import LOG_PREFIX, get_kube_context_and_api_client, sanitize_wandb_api_key, warn_failed_packages_from_build_logs
  from .build import _create_docker_build_ctx, generate_dockerfile, image_tag_from_dockerfile_and_source
  import kubernetes_asyncio
  from kubernetes_asyncio import client
label_desc: Use image node_id 2 for calling the KanikoBuilder obj's underlying member method code with example usage: obj.from_config(cls, config, environment, registry, verify, login) and returns: cls