yunikorn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-yunikorn-k8shim] yangwwei commented on a change in pull request #72: Add ability to support 3rd party K8s operator integration
Date Tue, 25 Feb 2020 07:10:14 GMT
yangwwei commented on a change in pull request #72: Add ability to support 3rd party K8s operator
integration
URL: https://github.com/apache/incubator-yunikorn-k8shim/pull/72#discussion_r383693044
 
 

 ##########
 File path: pkg/appmgmt/appmgmt.go
 ##########
 @@ -0,0 +1,101 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+package appmgmt
+
+import (
+	"github.com/apache/incubator-yunikorn-k8shim/pkg/appmgmt/general"
+	"github.com/apache/incubator-yunikorn-k8shim/pkg/appmgmt/interfaces"
+	"github.com/apache/incubator-yunikorn-k8shim/pkg/appmgmt/sparkoperator"
+	"github.com/apache/incubator-yunikorn-k8shim/pkg/client"
+	"github.com/apache/incubator-yunikorn-k8shim/pkg/log"
+	"go.uber.org/zap"
+)
+
+// app manager service is a central service that interacts with
+// one or more K8s operators for app scheduling.
+type AppManagementService struct {
+	apiProvider client.APIProvider
+	amProtocol  interfaces.ApplicationManagementProtocol
+	managers    []interfaces.AppManager
+}
+
+func NewAMService(amProtocol interfaces.ApplicationManagementProtocol,
+	apiProvider client.APIProvider) *AppManagementService {
+	appManager := &AppManagementService{
+		amProtocol:    amProtocol,
+		apiProvider:   apiProvider,
+		managers:      make([]interfaces.AppManager, 0),
+	}
+
+	if !apiProvider.IsTestingMode() {
+		appManager.register(
+			// registered app plugins
+			// for general apps
+			general.New(amProtocol, apiProvider),
+			// for spark operator - SparkApplication
+			sparkoperator.New(amProtocol, apiProvider))
+	}
 
 Review comment:
   Let me know if you still have any problem with this, after the fix.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@yunikorn.apache.org
For additional commands, e-mail: dev-help@yunikorn.apache.org


Mime
View raw message