Commit Graph
62 Commits
Author SHA1 Message Date
Rob BellandGitHub 78b4a00929 feat: add support for tracking TrainJob progress and training metrics (#3227)
* feat(api): add progress types to api

Signed-off-by: Rob Bell <[email protected]>

* feat: progress server stub

Signed-off-by: Rob Bell <[email protected]>

* feat: setup tls for server

Signed-off-by: Rob Bell <[email protected]>

* refactor: pull out middleware

Signed-off-by: Rob Bell <[email protected]>

* refactor: remove logger message noise from tests

Signed-off-by: Rob Bell <[email protected]>

* fix: send server error logs to main logger

Signed-off-by: Rob Bell <[email protected]>

* feat: update the trainer status

Signed-off-by: Rob Bell <[email protected]>

* feat: use separate client to avoid impacting main reconciler client-side rate limits

Signed-off-by: Rob Bell <[email protected]>

* feat: configure progress server in helm chart and configmap

Signed-off-by: Rob Bell <[email protected]>

* fix: prevent race condition

Signed-off-by: Rob Bell <[email protected]>

* feat: inject progress runtime config

Signed-off-by: Rob Bell <[email protected]>

* fix: progress client config

Signed-off-by: Rob Bell <[email protected]>

* fix: update generated config

Signed-off-by: Rob Bell <[email protected]>

* feat: validate auth tokens in endpoint

Signed-off-by: Rob Bell <[email protected]>

* test: validate auth tokens in endpoint

Signed-off-by: Rob Bell <[email protected]>

* refactor: tidy tests to use same format as other tests

Signed-off-by: Rob Bell <[email protected]>

* fix: look up the cluster issuer from the service account token

Different clusters can use different issuers so look up the issuer from the trusted in-cluster service account token.

Signed-off-by: Rob Bell <[email protected]>

* refactor: rename authn middleware

Signed-off-by: Rob Bell <[email protected]>

* feat: add authn to status update endpoint

Signed-off-by: Rob Bell <[email protected]>

* refactor: tidy up reading in-cluster service account token

Signed-off-by: Rob Bell <[email protected]>

* fix: rbac permissions

Signed-off-by: Rob Bell <[email protected]>

* fix: better error response

Signed-off-by: Rob Bell <[email protected]>

* refactor: move kubebuilder annotation higher up

Signed-off-by: Rob Bell <[email protected]>

* fix: make lastUpdateTime required

Signed-off-by: Rob Bell <[email protected]>

* chore: fix config tests after rebase

Signed-off-by: Rob Bell <[email protected]>

* test: update config test with new progress server config

Signed-off-by: Rob Bell <[email protected]>

* test: add progress tracking e2e test

Signed-off-by: Rob Bell <[email protected]>

* fix: allow feature gates to be configurable from command line argument

So they can be overridden in e2e tests

Signed-off-by: Rob Bell <[email protected]>

* refactor: reuse shared progress StatusUrl

Signed-off-by: Rob Bell <[email protected]>

* test: tidy up tests

Signed-off-by: Rob Bell <[email protected]>

* refactor: allow plugins to use config

Signed-off-by: Rob Bell <[email protected]>

* refactor: centralise shared constants

Signed-off-by: Rob Bell <[email protected]>

* fix: disable http2 in progress server tls opts if disabled by config

Signed-off-by: Rob Bell <[email protected]>

* fix: minor improvements suggested by copilot

Signed-off-by: Rob Bell <[email protected]>

* chore: rename progress server => status server

Signed-off-by: Rob Bell <[email protected]>

* chore: update type doc

Signed-off-by: Rob Bell <[email protected]>

* chore: update name of feature gate

Signed-off-by: Rob Bell <[email protected]>

* fix: after rebase

Signed-off-by: Rob Bell <[email protected]>

* chore: fix typo

Signed-off-by: Rob Bell <[email protected]>

* chore: rename handler

Signed-off-by: Rob Bell <[email protected]>

* fix: run status server on all replicas

Signed-off-by: Rob Bell <[email protected]>

* fix: deep copy the rest config

Signed-off-by: Rob Bell <[email protected]>

* refactor: use ssa

Signed-off-by: Rob Bell <[email protected]>

* refactor: separate token audience per train job

Signed-off-by: Rob Bell <[email protected]>

* chore: rename status server

Signed-off-by: Rob Bell <[email protected]>

* fix: revert adding status pkg to manifest gen paths

Signed-off-by: Rob Bell <[email protected]>

* chore: update log messages

Signed-off-by: Rob Bell <[email protected]>

* chore: update api docs

Signed-off-by: Rob Bell <[email protected]>

* chore: update format

Signed-off-by: Rob Bell <[email protected]>

* fix: revert inadvertent change

Signed-off-by: Rob Bell <[email protected]>

* chore: update api name and type docs

Signed-off-by: Rob Bell <[email protected]>

* refactor: initialise oidc provider in manager startup

Signed-off-by: Rob Bell <[email protected]>

* fix: allow empty update request

Signed-off-by: Rob Bell <[email protected]>

* fix: wait for server shut down

Signed-off-by: Rob Bell <[email protected]>

* fix: handle missing train job

Signed-off-by: Rob Bell <[email protected]>

* refactor: update env var names

Signed-off-by: Rob Bell <[email protected]>

* chore: rename packages, plugins, feature gate

Signed-off-by: Rob Bell <[email protected]>

* refactor: update env var names

Signed-off-by: Rob Bell <[email protected]>

* chore: regenerate after rebase

Signed-off-by: Rob Bell <[email protected]>

* chore: fixes after rebase

Signed-off-by: Rob Bell <[email protected]>

* chore: minor doc updates

Signed-off-by: Rob Bell <[email protected]>

* chore: rename status server config

Signed-off-by: Rob Bell <[email protected]>

* chore: replace placeholder config with nil

Signed-off-by: Rob Bell <[email protected]>

* chore: revert separate runtime utils package

Signed-off-by: Rob Bell <[email protected]>

* chore: remove unused config from tests

Signed-off-by: Rob Bell <[email protected]>

---------

Signed-off-by: Rob Bell <[email protected]>
2026-03-13 20:01:08 +00:00
Yash AgarwalandGitHub 587010f54d feat: add activeDeadlineSeconds (#3258)
* feat(api): add ActiveDeadlineSeconds and TTLSecondsAfterFinished to Trainer APIs

- Add ActiveDeadlineSeconds *int64 to TrainJobSpec (immutable, min=1)
  with reason constant TrainJobDeadlineExceededReason="DeadlineExceeded"
- Add TTLSecondsAfterFinished *int32 to TrainingRuntimeSpec (min=0)
  with cross-field CEL rules blocking conflicting lifecycle fields
  in the JobSet/Job template
- Add TrainJobDeadlineExceededMessage to constants
- Regenerate zz_generated.deepcopy.go

Part of KEP-2899

Signed-off-by: XploY04 <[email protected]>

* feat(controller): add TTL-based auto-deletion for finished TrainJobs

- Add early-exit guard in Reconcile before prevTrainJob DeepCopy and
  removeFailedCondition, mirroring the Kubernetes Job controller pattern.
  Once a TrainJob is terminal (Complete or Failed), only TTL cleanup runs.
- Add fetchTTLFromRuntime helper to retrieve TTLSecondsAfterFinished from
  the referenced TrainingRuntime or ClusterTrainingRuntime.
- Add reconcileTTL helper to delete finished TrainJobs after their TTL
  expires, or requeue at the exact expiry time.

Part of KEP-2899

Signed-off-by: XploY04 <[email protected]>

* feat(controller): enforce ActiveDeadlineSeconds on TrainJobs

- Add reconcileDeadline helper to terminate running TrainJobs that
  exceed their ActiveDeadlineSeconds.
- Handle job suspension: StartTime is determined by the LastTransitionTime
  of the Suspended=False condition (if it exists) to ensure the deadline
  timer resets correctly upon resume.
- Jobs exceeding the deadline are moved to a Failed state with
  reason DeadlineExceeded.

Part of KEP-2899

Signed-off-by: XploY04 <[email protected]>

* feat(webhooks): warn on short ttlSecondsAfterFinished

- Add an admission warning to both TrainingRuntime and
  ClusterTrainingRuntime webhooks if the TTLSecondsAfterFinished
  is configured to less than 60 seconds, as this may cause
  unexpected data/log loss for data scientists due to overly
  aggressive cleanup.

Part of KEP-2899

Signed-off-by: XploY04 <[email protected]>

* test: add integration tests for TrainJob TTL and deadline lifecycle

- Add integration tests for DeadlineExceeded behavior in TrainJob controller
- Add integration tests for TTL validation and warnings in webhooks

Part of KEP-2899

Signed-off-by: XploY04 <[email protected]>

* cleanup

Signed-off-by: XploY04 <[email protected]>

* fix: ensure JobSet is suspended on expiration and fix webhook test regress

Signed-off-by: XploY04 <[email protected]>

* fix(controller): return errors from fetchTTLFromRuntime for proper requeue

Signed-off-by: XploY04 <[email protected]>

* test: remove unused wantWarning from webhook tests

Signed-off-by: XploY04 <[email protected]>

* fix

Signed-off-by: XploY04 <[email protected]>

* feat: Remove  from TrainingRuntime and ClusterTrainingRuntime specifications and associated validation.

Signed-off-by: XploY04 <[email protected]>

* fix(api): restore `activeDeadlineSeconds` validation rule on TrainingRuntime

Signed-off-by: XploY04 <[email protected]>

* refactor: remove unnecessary blank lines and improve logging in ClusterTrainingRuntime validation

Signed-off-by: XploY04 <[email protected]>

* feat: add activeDeadlineSeconds field to TrainJobSpec and update related tests

Signed-off-by: XploY04 <[email protected]>

* Remove unnecessary newline in test file

Signed-off-by: Yash Agarwal <[email protected]>

* Remove unnecessary newline in trainingruntime_webhook_test.go

Signed-off-by: Yash Agarwal <[email protected]>

* refactor: remove unnecessary blank lines in TrainJob reconciliation and deadline tests

Signed-off-by: XploY04 <[email protected]>

* feat: change ActiveDeadlineSeconds from pointer to value type and update related code

Signed-off-by: XploY04 <[email protected]>

* feat: add condition check for TrainJob deadline exceeded before suspending

Signed-off-by: XploY04 <[email protected]>

* feat: enhance TrainJob deadline handling and suspend logic

Signed-off-by: XploY04 <[email protected]>

* feat: enhance TrainJob deadline handling and suspend logic

Signed-off-by: XploY04 <[email protected]>

* fix

Signed-off-by: XploY04 <[email protected]>

* feat: change ActiveDeadlineSeconds to pointer type and update related logic

Signed-off-by: XploY04 <[email protected]>

* feat: ensure requeueAfter is at least 1 second when deadline is exceeded

Signed-off-by: XploY04 <[email protected]>

* feat: change ActiveDeadlineSeconds from pointer to value type and update related logic

Signed-off-by: XploY04 <[email protected]>

* fix: remove early return for finished TrainJobs to prevent status sync issues

The early return was preventing the controller from syncing JobSet
status updates for finished TrainJobs, causing e2e tests to timeout
waiting for conditions that never got updated.

This fix restores the upstream behavior where finished TrainJobs still
go through status reconciliation (though reconcileObjects is skipped).

Signed-off-by: XploY04 <[email protected]>

* fix

Signed-off-by: XploY04 <[email protected]>

* fix: remove x-kubernetes-validations for activeDeadlineSeconds in TrainingRuntime CRDs

Signed-off-by: XploY04 <[email protected]>

* fix: update validation message for ActiveDeadlineSeconds to be more generic

Signed-off-by: XploY04 <[email protected]>

* replacing suspend with delete

Signed-off-by: XploY04 <[email protected]>

* fix: remove SpecLabel and SpecAnnotation methods from TrainJobWrapper

Signed-off-by: XploY04 <[email protected]>

* fix: remove annotations field from TrainJobSpec and CRD definitions

Signed-off-by: XploY04 <[email protected]>

* ensure JobSet deletion in e2e tests

Signed-off-by: XploY04 <[email protected]>

* fix: add JobSet APIs to the scheme in e2e tests

Signed-off-by: XploY04 <[email protected]>

* fix: simplify error handling in Reconcile method of TrainJobReconciler

Signed-off-by: XploY04 <[email protected]>

---------

Signed-off-by: XploY04 <[email protected]>
Signed-off-by: Yash Agarwal <[email protected]>
2026-03-13 18:37:31 +00:00
37c8a07a8a feat(api): Replace PodTemplateOverrides with RuntimePatches API (#3309)
* feat(api): Replace PodTemplateOverrides with RuntimePatches API

Signed-off-by: Andrey Velichkevich <[email protected]>

* Update goal with RuntimePatches API

Signed-off-by: Andrey Velichkevich <[email protected]>

* Add diagram for RuntimePatches

Signed-off-by: Andrey Velichkevich <[email protected]>

* feat(api): Replace PodTemplateOverrides with RuntimePatches API

Signed-off-by: Antonin Stefanutti <[email protected]>

* Fix kube lint errors

Signed-off-by: Antonin Stefanutti <[email protected]>

* Update Python models

Signed-off-by: Antonin Stefanutti <[email protected]>

* Enable maxlength Kube-API-Linter rule

Signed-off-by: Antonin Stefanutti <[email protected]>

* Restore manger field IsDomainPrefixedPath validation

Signed-off-by: Antonin Stefanutti <[email protected]>

* Fix integration tests

Signed-off-by: Antonin Stefanutti <[email protected]>

* Apply StrategicMergePatch to batchv1.JobTemplateSpec

Signed-off-by: Antonin Stefanutti <[email protected]>

---------

Signed-off-by: Andrey Velichkevich <[email protected]>
Signed-off-by: Antonin Stefanutti <[email protected]>
Co-authored-by: Andrey Velichkevich <[email protected]>
2026-03-12 16:29:44 +00:00
Andrey VelichkevichandGitHub 2612533a5d feat(runtimes): Use JobSet VolumeClaimPolicies APIs for LLM Runtimes (#3150)
* feat(runtimes): Use JobSet VolumeClaimPolicies APIs for LLM Runtimes

Signed-off-by: Andrey Velichkevich <[email protected]>

* Remove cell

Signed-off-by: Andrey Velichkevich <[email protected]>

---------

Signed-off-by: Andrey Velichkevich <[email protected]>
2026-02-09 14:57:13 +00:00
Andrey VelichkevichandGitHub 7cdf7ce5a2 chore(deps): Bump Go 1.25, k8s v1.35, and controller-runtime v0.23.1 (#3127)
* chore(deps): Bump Go 1.25, k8s to v1.35, and controller-runtime v0.23.1

Signed-off-by: Andrey Velichkevich <[email protected]>

* Migrate to new events API with EventRecorder

Signed-off-by: Andrey Velichkevich <[email protected]>

* Fix RBAC for events

Signed-off-by: Andrey Velichkevich <[email protected]>

* Bump k8s version in tests

Signed-off-by: Andrey Velichkevich <[email protected]>

* Add type compliance check

Signed-off-by: Andrey Velichkevich <[email protected]>

* Use Reconciling action for event

Signed-off-by: Andrey Velichkevich <[email protected]>

---------

Signed-off-by: Andrey Velichkevich <[email protected]>
2026-01-27 19:50:34 +00:00
Antonin StefanuttiandGitHub 4c5fb81f42 fix(operator): Prevent JobSet recreation when its TTL has expired (#3013)
Signed-off-by: Antonin Stefanutti <[email protected]>
2026-01-13 17:52:52 +00:00
Antonin StefanuttiandGitHub 6eb3a2a352 fix(operator): Use Patch to update TrainJob status (#3009)
Signed-off-by: Antonin Stefanutti <[email protected]>
2025-11-27 15:52:29 +00:00
Antonin StefanuttiandGitHub 0f9825e89e chore(operator): Use SSA throughout runtime framework (#2877)
* chore(operator): Use SSA throughout runtime framework

Signed-off-by: Antonin Stefanutti <[email protected]>

* Fix lint error

Signed-off-by: Antonin Stefanutti <[email protected]>

* Update go.mod file

Signed-off-by: Antonin Stefanutti <[email protected]>

---------

Signed-off-by: Antonin Stefanutti <[email protected]>
2025-10-31 11:43:12 +00:00
Kapil NemaandGitHub a213c82152 feat(operator): add config api implementation (#2879)
* config api implementation

Signed-off-by: kapil27 <[email protected]>

* updated dependencies

Signed-off-by: kapil27 <[email protected]>

* fix: add RBAC permissions for leader election leases

Signed-off-by: kapil27 <[email protected]>

* fix: add leader election RBAC permissions and config API generation¯

Signed-off-by: kapil27 <[email protected]>

* fix: resolved suggested comments¯

Signed-off-by: kapil27 <[email protected]>

* minor-fix: updated boilerplate text¯

Signed-off-by: kapil27 <[email protected]>

* Update controller_manager_config.yaml

Signed-off-by: kapil27 <[email protected]>

* chore: trigger CI

Signed-off-by: kapil27 <[email protected]>

* chore: trigger CI

Signed-off-by: kapil27 <[email protected]>

---------

Signed-off-by: kapil27 <[email protected]>
2025-10-14 17:25:08 +00:00
Antonin StefanuttiandGitHub e9586f9c78 feat(api): Sync TrainJob JobsStatus from JobSet ReplicatedJobsStatus (#2802)
* feat(api): Sync TrainJob JobsStatus from JobSet ReplicatedJobsStatus

Signed-off-by: Antonin Stefanutti <[email protected]>

* Add integration tests

Signed-off-by: Antonin Stefanutti <[email protected]>

* Update e2e tests

Signed-off-by: Antonin Stefanutti <[email protected]>

* Remove extra check

Signed-off-by: Antonin Stefanutti <[email protected]>

* Sort JobsStatus in e2e tests

Signed-off-by: Antonin Stefanutti <[email protected]>

* Fix e2e test for MPI job

Signed-off-by: Antonin Stefanutti <[email protected]>

* Fail-fast when multiple terminal condition and JobsStatus plugins exist

Signed-off-by: Antonin Stefanutti <[email protected]>

* Fold TerminalCondition and JobsStatus plugins

Signed-off-by: Antonin Stefanutti <[email protected]>

---------

Signed-off-by: Antonin Stefanutti <[email protected]>
2025-10-07 13:19:12 +00:00
Antonin StefanuttiandGitHub b0bde2f602 chore(operator): Upgrade Kubernetes to v1.34 (#2804)
Signed-off-by: Antonin Stefanutti <[email protected]>
2025-08-28 17:02:21 +00:00
Yuchen ChengandGitHub 3b500e1607 fix(manifests): add rbac config of events for event recorders (#2731)
Signed-off-by: rudeigerc <[email protected]>
2025-07-14 07:09:21 +00:00
Andrey VelichkevichandGitHub 8655798f02 fix(module): Change Go module name to v2 (#2707)
* fix(module): Change Go module name to v2

Signed-off-by: Andrey Velichkevich <[email protected]>

* Bump x/net to v0.38.0

Signed-off-by: Andrey Velichkevich <[email protected]>

---------

Signed-off-by: Andrey Velichkevich <[email protected]>
2025-07-03 17:46:20 +00:00
Antonin StefanuttiandGitHub bdc01d0411 fix(rbac): Add required RBAC to update ClusterTrainingRuntimes on OpenShift (#2682)
Signed-off-by: Antonin Stefanutti <[email protected]>
2025-06-27 12:54:18 +00:00
Antonin StefanuttiandGitHub 2af1136113 Remove TrainJobCreated condition (#2621)
* Remove TrainJobCreated condition

Signed-off-by: Antonin Stefanutti <[email protected]>

* Update KEP-2170 proposal

Signed-off-by: Antonin Stefanutti <[email protected]>

* Remove Created condition from SDK

Signed-off-by: Antonin Stefanutti <[email protected]>

* Default TrainJob status to Created unconditionally

Signed-off-by: Antonin Stefanutti <[email protected]>

* Set Failed condition on TrainJob runtime creation errors

Signed-off-by: Antonin Stefanutti <[email protected]>

* Emit a warning event upon TrainJob resources reconcile error

Signed-off-by: Antonin Stefanutti <[email protected]>

* Update TrainJob resources creation failed event

Signed-off-by: Antonin Stefanutti <[email protected]>

* Truncate event message to the maximum length limit

Signed-off-by: Antonin Stefanutti <[email protected]>

* Update state diagram in KEP-2170

Signed-off-by: Antonin Stefanutti <[email protected]>

* Append ellipsis to event message if it's truncated

Signed-off-by: Antonin Stefanutti <[email protected]>

---------

Signed-off-by: Antonin Stefanutti <[email protected]>
2025-05-02 17:59:05 +00:00
Yuki IwaiandGitHub cfc44b807b Implement trainer.kubeflow.org/resource-in-use finalizer mechanism to ClusterTrainingRuntime (#2625)
Implement trainer.kubeflow.org/resource-in-use finalizer mechanism to ClusterTrainingRuntime

Signed-off-by: Yuki Iwai <[email protected]>
2025-05-02 01:27:04 +00:00
Yuki IwaiandGitHub f5a2d0f250 Implement trainer.kubeflow.org/resource-in-use finalizer mechanism to TrainingRuntime (#2608)
* Implement trainer.kubeflow.org/resource-in-use finalizer mechanism to TrainingRuntime

Signed-off-by: Yuki Iwai <[email protected]>

# Conflicts:
#	pkg/constants/constants.go

* Reduce permissions

Signed-off-by: Yuki Iwai <[email protected]>

* Dispatch reconciliations even when TrainJob is updated

Signed-off-by: Yuki Iwai <[email protected]>

---------

Signed-off-by: Yuki Iwai <[email protected]>
2025-05-01 20:17:04 +00:00
Andrey VelichkevichandGitHub a0cc8057f6 fix(controller): Fix RBAC permissions for TrainJob controller (#2626)
Signed-off-by: Andrey Velichkevich <[email protected]>
2025-04-30 14:49:03 +00:00
Yuki IwaiandGitHub ed1b434f99 chore: Enable GCI for golangci-lint (#2540)
Signed-off-by: Yuki Iwai <[email protected]>
2025-03-18 14:47:21 +00:00
a589903c24 KEP-2170: Adding validation webhook for v2 trainjob (#2307)
Signed-off-by: Akshay Chitneni <[email protected]>
Co-authored-by: Akshay Chitneni <[email protected]>
2025-03-16 03:41:51 +00:00
Andrey VelichkevichandGitHub 5401e5fec5 Bump JobSet to v0.8.0 (#2463)
Signed-off-by: Andrey Velichkevich <[email protected]>
2025-03-01 02:46:38 +00:00
Antonin StefanuttiandGitHub 4ad02aca05 KEP-2170: Use SSA to reconcile TrainJob components (#2431)
* KEP-2170: Use SSA to reconcile TrainJob components

Signed-off-by: Antonin Stefanutti <[email protected]>

* Enable Unstructured caching in controller manager config

Signed-off-by: Antonin Stefanutti <[email protected]>

* Fix PodGroup apply configuration

Signed-off-by: Antonin Stefanutti <[email protected]>

* API to apply config conversion util functions

Signed-off-by: Antonin Stefanutti <[email protected]>

* Only add namespace to TrainingRuntime object key

Signed-off-by: Antonin Stefanutti <[email protected]>

* Fix EnvVar upsert

Signed-off-by: Antonin Stefanutti <[email protected]>

* Update unit tests

Signed-off-by: Antonin Stefanutti <[email protected]>

* Fix JobSet resource requirements

Signed-off-by: Antonin Stefanutti <[email protected]>

* Resolve build issues with launcher job

Signed-off-by: Antonin Stefanutti <[email protected]>

* Use apply config for MPI ConfigMap and Secret

Signed-off-by: Antonin Stefanutti <[email protected]>

* ComponentBuilderPlugin now returns an array

Signed-off-by: Antonin Stefanutti <[email protected]>

* Use plain apply configurations instead of unstructured

Signed-off-by: Antonin Stefanutti <[email protected]>

* Use apply config in EnforceMLPolicy plugins

Signed-off-by: Antonin Stefanutti <[email protected]>

* Do not update JobSets that are not suspended

Signed-off-by: Antonin Stefanutti <[email protected]>

* Address review feedback

Signed-off-by: Antonin Stefanutti <[email protected]>

* Do not update PodGroup if TrainJob is not suspended

Signed-off-by: Antonin Stefanutti <[email protected]>

* Remove obsolete TODO

Signed-off-by: Antonin Stefanutti <[email protected]>

---------

Signed-off-by: Antonin Stefanutti <[email protected]>
2025-02-26 08:39:09 +00:00
Andrey VelichkevichandGitHub 1ff1d8ad28 Update the naming conventions for Kubeflow Trainer (#2415)
* Update the naming conventions for Kubeflow Trainer

Signed-off-by: Andrey Velichkevich <[email protected]>

* Fix webhooks

Signed-off-by: Andrey Velichkevich <[email protected]>

* Fix paths for webhooks

Signed-off-by: Andrey Velichkevich <[email protected]>

* Update go test cmd

Signed-off-by: Andrey Velichkevich <[email protected]>

* Rename kubeflowv1 to trainer pkg

Signed-off-by: Andrey Velichkevich <[email protected]>

---------

Signed-off-by: Andrey Velichkevich <[email protected]>
2025-02-06 13:48:30 +00:00
Richard Liu 74b52a5ee1 Delete v1alpha1 2018-11-08 12:01:38 -08:00
Ce Gaoandk8s-ci-robot 753bcb6027 vendor: Update to 1.10 (#856)
* vendor: Update

Signed-off-by: Ce Gao <[email protected]>

* gopkg: Update

Signed-off-by: Ce Gao <[email protected]>

* codegen: Update

Signed-off-by: Ce Gao <[email protected]>

* controller: Fix ratelimiter

Signed-off-by: Ce Gao <[email protected]>

* job: Add check for errors

Signed-off-by: Ce Gao <[email protected]>
2018-10-29 20:31:28 -07:00
Penghao Cenandk8s-ci-robot 560f923331 Fix typos (#828) 2018-09-19 02:39:29 -07:00
Jeremy Lewiandk8s-ci-robot e31018ac83 Fix bug with jobs not being marked as completed. (#501)
* Fix bug with jobs not being marked as completed.

* A bug was introduced with getting the replica status in #344 which
switched to creating pods directly.

* Our presubmits/postsubmits were failing but this went unnoticed because
the git status check was improperly reported as succeeded.

* The bug is because we try to get the pod status by name but the name
doesn't include the random salt in the pod name.

* The code in question is a legacy of when we were using job controllers and
we first got the status of the job controller. We incorrectly changed that
code to get the pod. The correct thing is to just list pods by label; we
already do that in the code below so we just need to delete some code.

* Don't create any resources if the DeletionTimestamp is set.
  Creating resources at this point would end blocking deletion of the object
  because the controller would create resources while we are trying to delete
  them.

* Use logrus in controller.go, trainer.go, and replicas.go to log
  with fields providing information about the job and repliac.
  This makes it easy to filter logs for a particular job.

* Use logrus to log the name of the job in a field.

* Checking the deletiontime stamp doesn't appear to be sufficient.

Use the Phase to determine whether we should create resources.

* Run gofmt.

* * Reset the rate limiter after every successful sync.
* Otherwise the ratelimiter will end up delaying processing subsequent
  events which isn't what we want.

* Run goimports to fix lint issues.

* * Reconcile needs to update the TFJob stored in TrainingJob. This ensures
  TrainingJob has an up to date representation of the job.

* Otherwise changes made to the spec won't be available to TrainingJob. For
  example, if the job is deleted by the user, the deletion timestamp will
  be set. But if we don't update the TFJob stored in TrainingJob this
  change won't be propogated.

* * TrainingJob.update should log the value of the job not the pointer.

* Add more comments to the code.
2018-03-25 18:11:00 -07:00
Ayush Kumarandk8s-ci-robot cdee6b9a48 fixed some golint warning (#486)
* fixed some golint warning

* fixed some golint warning

* updated linter_config.json
2018-03-22 21:52:02 -07:00
Hitoshi Mitakeandk8s-ci-robot 169013fcb0 Create PDB of TFReplicaSet for gang scheduling by kube-arbitrator (#452)
* Create PDB of TFReplicaSet for gang scheduling by kube-arbitrator

kube-arbitrator (technically its component kube-batchd) requires PDB
for its gang scheduling feature. The feature is useful for creating
every pod of TFJob at the same time. This commit lets tf-operator
create the PDB for the purpose.

* Add a new UT TestPDBForGangScheduling for checking PDB creation
2018-03-19 20:06:00 -07:00
Ce Gaoandk8s-ci-robot 2175696d5b *: Remove APIExtension clientset (#454)
* *: Remove APIExtension clientset

Signed-off-by: Ce Gao <[email protected]>

* k8sutil: Remove apiextension client

Signed-off-by: Ce Gao <[email protected]>
2018-03-12 03:05:11 -07:00
Ankush AgarwalandCe Gao e992dfc3aa Use logrus for structured logging (#416)
* Move from glog to sirupsen/logrus for logging
* Add a new flag json_log_format
* Refactor all log statements to use logrus
* Use Info level for log level V(1) and below
* Use Debug level for log level V(2) and above
* Tested locally

Addresses https://github.com/kubeflow/tf-operator/issues/24

Sample logs
```
{"filename":"app/server.go:54","level":"info","msg":"EnvKubeflowNamespace not set, use default namespace","time":"2018-02-27T18:25:18-08:00"}
{"filename":"app/server.go:59","level":"info","msg":"[Version: 0.3.0+git Git SHA: Not provided. Go Version: go1.9.3 Go OS/Arch: darwin/amd64]","time":"2018-02-27T18:25:18-08:00"}
{"filename":"app/server.go:145","level":"info","msg":"No controller_config_file provided; using empty config.","time":"2018-02-27T18:25:18-08:00"}
{"filename":"controller/controller.go:110","level":"info","msg":"Setting up event handlers","time":"2018-02-27T18:25:18-08:00"}
```
2018-03-01 11:53:34 +08:00
Jeremy LewiandGitHub 0a7ad021c8 Fix bug with jobs not working if you recreate a job with same name as previous job (#399)
This appears to be a bug with the informer forgetting about active jobs.

I think the root cause is that delete events are processed directly
as opposed to using the work queue. This causes race conditions because
the work queue is what ensures only on thread is processing a given job
at a time.

Since we no longer explicitly handle delete events we rely on garbage
collection and owner references to delete the pods.

We add testing to our test runner to verify pods are garbage collected.

We update test_runner.py to try recreating jobs with the same name.
In general this doesn't reproduce the original bug.

Related to #322 (to need to push a new image to fix).
Fix #310

Related to #373
2018-02-22 19:58:08 -08:00
Ce GaoandJeremy Lewi 413098aaad *: Replace the repo name (#386)
We have migrated the repo and we should replace the repo name with the new one.

* Related to #350
Signed-off-by: Ce Gao [email protected]
2018-02-12 10:22:05 -08:00
Ce GaoandJeremy Lewi 14df0d4bda controller.go: Fix a glog typo (#368)
Signed-off-by: Ce Gao <[email protected]>
2018-02-05 05:10:07 -08:00
Ce GaoandJeremy Lewi 0a395abcfe *: Add copyright owner in go files (#364)
* *: Add copyright owner in go files

Close https://github.com/tensorflow/k8s/issues/266

Signed-off-by: Ce Gao <[email protected]>
2018-02-02 10:54:10 -08:00
Ce GaoandJeremy Lewi 02908827ab feat(group): Update to kubeflow.org (#354)
* Fix #337 

* Per the discussion we've decided to use kubeflow.org as the group and not tensorflow.org. This PR makes all the relevant changes.
2018-01-30 06:09:33 -08:00
Ce GaoandJeremy Lewi f0eea27719 WIP (#345)
Close #281

Separate CRD and controller
Add CRD support in helm charts

Signed-off-by: Ce Gao <[email protected]>
2018-01-29 05:52:09 -08:00
Penghao Cen 915e7b0168 Rename Tf to TF 2018-01-23 10:15:40 +08:00
Ce GaoandJeremy Lewi 4179e7a299 Add recorder to publish event (#312)
Add a recorder which can be used to publish Kubernetes events related to TFJob.

Signed-off-by: Ce Gao <[email protected]>
2018-01-22 04:46:45 -08:00
Jeremy LewiandGitHub a751ab33fe Fix a bunch of problems in TfJob CRD that crept in while tests were broken (#308)
* In syncTfJob when checking whether a work queue item corresponds to a TrainingJob already in the map we need to check the UID. Otherwise we will not properly handle the case where a training job is deleted and then a new job is recreated with the same name.

* We need to make sure that the Replicas field in TrainingJob is always properly set;

* We were only initializing replicas in setup which was problematic in the case where the TfJob controller gets restarted because on restarted setup won't be invoked because the job is past that phase and as a result the replicas won't be reinitialized.

* test_runner needs to ignore case when checking whether the job succeeded otherwise we conclude
that successful jobs failed

* The controller should only forget about job after the job has been cleaned up; not when it is marked as succeeded or failed.

* Add back code to support termination policies use the worker and not the master as the chief
    *This was added in #221 and accidentally removed in the refactor in #234.
2018-01-16 04:51:13 -08:00
Liang MingqiangandJeremy Lewi 5cc78c9461 add UpdateFunc to handle update events (#313)
* Add an Update function to the controller.

* The informer periodically generates an Update event but we aren't processing these because we don't have an update function.

* As a result, TrainingJob.reconcile doesn't get called periodically and we aren't properly updating the status of the job.

ref #309
ref #293
2018-01-15 09:55:29 -08:00
XsWackandJeremy Lewi 3072f980fc refactor controller logic (#234)
This PR is mainly about refactoring the structure of controller keep style with kubernetes controller. And the main logic of package trainer is not modified. We can continue do refactor next step to make the controller stateless.
2018-01-08 06:05:40 -08:00
Jiayu LiuandJeremy Lewi 048d160d02 add gometaliner into travis build (#254)
and gradually tighten the linting rules. for now unused and golint are left out.

some fixes are included in this PR.

using gometaliner instead of just golint because:

it covers more cases, e.g. the typo checkings.
it also allows for disabling rules w.r.t regex, e.g. when you don't want to enforce all the comment rules enforced by golint

* Part of #53
2017-12-29 08:41:47 -08:00
Ce GaoandJeremy Lewi 68ac6d4c24 controller.go: Fix a print error (#226)
Signed-off-by: Ce Gao <[email protected]>
2017-12-14 11:21:26 -08:00
huangyueandJeremy Lewi 0a066d1f37 rename clus to tfjob in controller.go, which is a bad name from etcd-operator (#138) 2017-11-14 12:29:59 -08:00
Penghao CenandJeremy Lewi 7b47ef5fb3 Minor fix typo and redundancy (#131) 2017-11-09 08:34:03 -08:00
Jeremy LewiandGitHub 97face2d05 More verbose logging of resource deletion (#124)
Increase logging to try to track down issues with TensorBoard not being deleted #107.

Set the default image in the helm chart to the latest image
   * We add the latest tag with every release
   * Furthermore, when we generate releases we actually override values.yaml to pin values for certain images.

Update e2e.go so that we can potentially run multiple jobs to try to stress the operator.
2017-11-05 15:53:30 -08:00
Jeremy LewiandGitHub bcf2f086f8 Update test infrastructure to use repo tensorflow/k8s (#87)
* Update test infrastructure to use repo tensorflow/k8s

* Update README to refer to new repo.

* Rename go packages from jlewi/mlkube.io > tensorflow/k8s.

* Update repo location in the helm e2e test.

* Update links.

* Update the readme.md
2017-10-25 16:22:42 -07:00
William BuchwalterandJeremy Lewi ca33d3d8c5 Parameter Server: Run TF server by default (#36)
Add an option to automatically run a standard gRPC server for parameter servers so users don't have to supply it themselves.

* Use a ConfigMap to inject a python script that can start the standard TF gRPC server
* There is one ConfigMap per TfJob; this avoids problems created by a TfJob operator upgrade making changes to the python script.
2017-10-19 11:38:10 -07:00
Jeremy LewiandGitHub 71c12671e8 Always check for existing TfJobs and instantiate controllers for them. (#43)
* Always check for existing TfJobs and instantiate controllers for them.

* Whenever we start the controller, we should check if there are existing
  TfJobs and instantiate controllers for them so they aren't orphaned.

* Previously we only did this if the CRD already existed. IMO it seems
  more robust to always do it and not rely on the CRD already existing.

* Added a log message for the watch version obtained.
2017-09-27 06:39:12 -07:00