app

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2019 License: Apache-2.0 Imports: 53 Imported by: 0

Documentation

Index

Constants

View Source
const CachedRegistries = "/opt/versioned_registries"

root dir of local cached VERSIONED REGISTRIES

View Source
const CloudShellFolder = "kf_util"
View Source
const CloudShellTemplatePath = "/opt/registries/kubeflow/deployment/gke/cloud_shell_templates"
View Source
const DefaultStorageAnnotation = "storageclass.beta.kubernetes.io/is-default-class"

DefaultStorageAnnotation is the Name of the default annotation used to indicate whether a storage class is the default.

View Source
const DmFolder = "gcp_config"
View Source
const GcloudPath = "gcloud"

Assume gcloud is on the path.

View Source
const IAM_ADMIN_ROLE = "roles/resourcemanager.projectIamAdmin"
View Source
const JupyterPrototype = "jupyterhub"

The name of the prototype for Jupyter.

View Source
const KubeflowFolder = "ks_app"
View Source
const KubeflowRegName = "kubeflow"
View Source
const OauthSecretName = "kubeflow-oauth"
View Source
const RecommendedConfigPathEnvVar = "KUBECONFIG"

RecommendedConfigPathEnvVar is a environment variable for path configuration

View Source
const RegistriesRoot = "/opt/registries"
View Source
const StartTime = "StartTime"

key used for storing start time of a request to deploy in the request contexts

Variables

This section is empty.

Functions

func CreateNamespace added in v0.4.0

func CreateNamespace(req *CreateRequest, k8sClientset *clientset.Clientset) error

func GetClearServiceAccountpolicy added in v0.4.0

func GetClearServiceAccountpolicy(currentPolicy *cloudresourcemanager.Policy, req ApplyIamRequest) cloudresourcemanager.Policy

Clear existing bindings for auto-generated service accounts of current deployment. Those bindings could be leftover from previous actions.

func GetRepoName added in v0.3.0

func GetRepoName(project string) string

func GetUpdatedPolicy added in v0.3.0

func GetUpdatedPolicy(currentPolicy *cloudresourcemanager.Policy, iamConf *IamConf, req ApplyIamRequest) cloudresourcemanager.Policy

func InsertOauthCredentails added in v0.4.0

func InsertOauthCredentails(req *CreateRequest, k8sClientset *clientset.Clientset) error

func LoadConfig added in v0.2.0

func LoadConfig(path string, o interface{}) error

Load yaml config

func NewServer added in v0.3.0

func NewServer(appsDir string, registries []RegistryConfig, gkeVersionOverride string) (*ksServer, error)

NewServer constructs a ksServer.

func PrepareAccount added in v0.4.0

func PrepareAccount(account string) string

func Run

func Run(opt *options.ServerOption) error

Run the application.

func UpdateCloudShellConfig added in v0.4.0

func UpdateCloudShellConfig(repoDir string, project string, appName string, kfVersion string, zone string) error

Save cloud shell config to project source repo.

func UpdateDmConfig added in v0.4.0

func UpdateDmConfig(repoDir string, project string, appName string, kfVersion string, dmDeploy *deploymentmanager.Deployment) error

Save ks app config local changes to project source repo. Not thread safe, be aware when call it.

Types

type AppConfig added in v0.2.0

type AppConfig struct {
	Registries []RegistryConfig
	Packages   []KsPackage
	Components []KsComponent
	Parameters []KsParameter
}

type AppConfigFile added in v0.3.0

type AppConfigFile struct {
	// App describes a ksonnet application.
	App AppConfig
}

AppConfigFile corresponds to a YAML file specifying information about the app to create.

type ApplyIamRequest added in v0.3.0

type ApplyIamRequest struct {
	Project string `json:"project"`
	Cluster string `json:"cluster"`
	Email   string `json:"email"`
	Token   string `json:"token"`
	Action  string `json:"action`
}

type ApplyRequest added in v0.3.0

type ApplyRequest struct {
	// Name of the app to apply
	Name string

	// kubeflow version
	KfVersion string

	// Environment is the environment to use.
	Environment string

	// Components is a list of the names of the components to apply.
	Components []string

	// target GKE cLuster info
	Cluster string
	Project string
	Zone    string

	// Token is an authorization token to use to authorize to the K8s API Server.
	// Leave blank to use the pods service account.
	Token string
	Email string

	// For test: GCP service account client id
	SAClientId string

	// pass *appInfo if ks app is already on disk.
	AppInfo *appInfo
}

Request to apply an app.

type CreateRequest added in v0.3.0

type CreateRequest struct {
	// Name for the app.
	Name string
	// AppConfig is the config for the app.
	AppConfig AppConfig

	// Namespace for the app.
	Namespace string

	// Whether to try to autoconfigure the app.
	AutoConfigure bool

	// target GKE cLuster info
	Cluster       string
	Project       string
	ProjectNumber string
	Zone          string

	// Access token, need to access target cluster in order for AutoConfigure
	Token string
	Apply bool
	Email string
	// temporary
	ClientId     string
	ClientSecret string
	IpName       string

	// For test: GCP service account client id
	SAClientId string
}

CreateRequest represents a request to create a ksonnet application.

func (*CreateRequest) Validate added in v0.4.0

func (s *CreateRequest) Validate() error

type DmConf added in v0.3.0

type DmConf struct {
	Imports   interface{} `json:"imports"`
	Resources []Resource  `json:"resources"`
}

type HealthzRequest added in v0.3.0

type HealthzRequest struct {
	Msg string
}

type HealthzResponse added in v0.3.0

type HealthzResponse struct {
	Reply string
}

type IamBinding added in v0.3.0

type IamBinding struct {
	Members []string `type:"members`
	Roles   []string `type:"roles"`
}

type IamConf added in v0.3.0

type IamConf struct {
	IamBindings []IamBinding `json:"bindings"`
}

type InitProjectRequest added in v0.3.0

type InitProjectRequest struct {
	Project       string
	ProjectNumber string
	Token         string
}

type KsComponent added in v0.2.0

type KsComponent struct {
	Name      string
	Prototype string
}

type KsPackage added in v0.2.0

type KsPackage struct {
	Name string
	// Registry should be the name of the registry containing the package.
	Registry string
}

type KsParameter added in v0.2.0

type KsParameter struct {
	Component string
	Name      string
	Value     string
}

type KsRegistry added in v0.2.0

type KsRegistry struct {
	ApiVersion string
	Kind       string
	Libraries  map[string]LibrarySpec
}

KsRegistry corresponds to ksonnet.io/registry which is the registry.yaml file found in every registry.

type KsService added in v0.3.0

type KsService interface {
	// CreateApp creates a ksonnet application.
	CreateApp(context.Context, CreateRequest, *deploymentmanager.Deployment) error
	// Apply ksonnet app to target GKE cluster
	Apply(ctx context.Context, req ApplyRequest) error
	ConfigCluster(context.Context, CreateRequest) error
	BindRole(context.Context, string, string, string) error
	InsertDeployment(context.Context, CreateRequest) (*deploymentmanager.Deployment, error)
	GetDeploymentStatus(context.Context, CreateRequest) (string, error)
	ApplyIamPolicy(context.Context, ApplyIamRequest) error
	GetProjectLock(string) *sync.Mutex
}

KsService defines an interface for working with ksonnet.

type LibrarySpec added in v0.2.0

type LibrarySpec struct {
	Version string
	Path    string
}

type MultiError added in v0.4.0

type MultiError struct {
	Errors []error
}

func (*MultiError) Collect added in v0.4.0

func (m *MultiError) Collect(err error)

func (MultiError) ToError added in v0.4.0

func (m MultiError) ToError() error

type RegistriesConfigFile added in v0.3.0

type RegistriesConfigFile struct {
	// Registries provides information about known registries.
	Registries []RegistryConfig
}

RegistriesConfigFile corresponds to a YAML file specifying information about known registries.

type RegistryConfig added in v0.2.0

type RegistryConfig struct {
	Name    string
	Repo    string
	Version string
	Path    string
	RegUri  string
}

RegistryConfig is used for two purposes:

  1. used during image build, to configure registries that should be baked into the bootstrapper docker image. (See: https://github.com/kubeflow/kubeflow/blob/master/bootstrap/image_registries.yaml)
  2. used during app create rpc call, specifies a registry to be added to an app. required info for registry: Name, Repo, Version, Path Additionally if any of required fields is blank we will try to map with one of the registries baked into the Docker image using the name.

type Resource added in v0.3.0

type Resource struct {
	Name       string                 `json:"name"`
	Type       string                 `json:"type"`
	Properties map[string]interface{} `json:"properties"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL