Giter VIP home page Giter VIP logo

common's Introduction

Kubeflow common for operators

Build Status Go Report Card

This repo contains the libraries for writing a custom job operators such as tf-operator and pytorch-operator. To write a custom operator, user need to do following steps

import (
    commonv1 "github.com/kubeflow/common/pkg/apis/common/v1"
)

// reuse commonv1 api in your type.go
RunPolicy *commonv1.RunPolicy                              `json:"runPolicy,omitempty"`
TestReplicaSpecs map[TestReplicaType]*commonv1.ReplicaSpec `json:"testReplicaSpecs"`
 testJobController := TestJobController {
    ...
 }
  • Instantiate a JobController struct object and pass in the custom controller written in step 1 as a parameter
import "github.com/kubeflow/common/pkg/controller.v1/common"

jobController := common.JobController {
    Controller: testJobController,
    Config:     v1.JobControllerConfiguration{EnableGangScheduling: false},
    Recorder:   recorder,
}
    reconcile(...) {
    	// Your main reconcile loop.
    	...
    	jobController.ReconcileJobs(...)
    	...
    }

Note that this repo is still under construction, API compatibility is not guaranteed at this point.

API Reference

Please refer to the API documentation.

The API files are located under pkg/apis/common/v1:

  • constants.go: the constants such as label keys.
  • interface.go: the interfaces to be implemented by custom controllers.
  • controller.go: the main JobController that contains the ReconcileJobs API method to be invoked by user. This is the entrypoint of the JobController logic. The rest of the code under job_controller/ folder contains the core logic for the JobController to work, such as creating and managing worker pods, services, etc.

common's People

Contributors

terrytangyuan avatar richardsliu avatar jeffwan avatar jian-he avatar gaocegege avatar sperlingxx avatar shinytang6 avatar merlintang avatar martinforreal avatar pugangxa avatar sumlare avatar alculquicondor avatar xieydd avatar jiangkaihua avatar hzxuzhonghu avatar hustcat avatar mkkb473 avatar thor-wl avatar zw0610 avatar shaowei-su avatar whalecold avatar jinchihe avatar hegaoyuan avatar eggiter avatar goyalankit avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.