Skip to content

Commit

Permalink
[YUNIKORN-2159] Clean up AppManager implementation (#728)
Browse files Browse the repository at this point in the history
Refactoring of AppManager implementations to consolidate into AppManagementService.

- Merged general app manager into AppManagementService
- Migrated pkg/appmgmt -> pkg/cache
- Migrated pkg/callback -> pkg/cache
- Migrated various utils -> pkg/cache to avoid circular dependencies
- Removed Recoverable interface (functionality merged into
  AppManagementService)
- Removed AppManager interface (functionality merged into
  AppManagementService)
- Removed ManagedApp and ManagedTask interfaces
- Skipped (currently) broken recovery tests due to interfaces not being usable.
  These tests will be rewritten in a future PR once the recovery code is integrated
  into the context.

Closes: #728
  • Loading branch information
craigcondit committed Nov 20, 2023
1 parent 8a0d449 commit afbb4a8
Show file tree
Hide file tree
Showing 47 changed files with 938 additions and 1,294 deletions.
122 changes: 0 additions & 122 deletions pkg/appmgmt/appmgmt.go

This file was deleted.

57 changes: 0 additions & 57 deletions pkg/appmgmt/appmgmt_test.go

This file was deleted.

43 changes: 0 additions & 43 deletions pkg/appmgmt/interfaces/appmgr.go

This file was deleted.

41 changes: 0 additions & 41 deletions pkg/appmgmt/interfaces/appprotocol.go

This file was deleted.

43 changes: 0 additions & 43 deletions pkg/appmgmt/interfaces/recoverable.go

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
limitations under the License.
*/

package interfaces
package cache

import (
v1 "k8s.io/api/core/v1"
Expand All @@ -29,20 +29,20 @@ import (
type ApplicationManagementProtocol interface {
// returns app that already existed in the cache,
// or nil, false if app with the given appID is not found
GetApplication(appID string) ManagedApp
GetApplication(appID string) *Application

// add app to the context, app manager needs to provide all
// necessary app metadata through this call. If this a existing app
// for recovery, the AddApplicationRequest#Recovery must be true.
AddApplication(request *AddApplicationRequest) ManagedApp
AddApplication(request *AddApplicationRequest) *Application

// remove application from the context
// returns an error if for some reason the app cannot be removed,
// e.g the given app is not found in current context.
RemoveApplication(appID string) error

// add task to the context, if add is successful,
AddTask(request *AddTaskRequest) ManagedTask
AddTask(request *AddTaskRequest) *Task

// remove task from the app
// return an error if for some reason the task cannot be removed
Expand Down
Loading

0 comments on commit afbb4a8

Please sign in to comment.