-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Modelmesh, Ray and TrustyAI operands
Signed-off-by: Jakub Stejskal <[email protected]>
- Loading branch information
Showing
10 changed files
with
275 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,5 +38,5 @@ build/ | |
|
||
## Suite specific files | ||
**/*.kubeconfig | ||
env | ||
*.env | ||
config.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/main/java/io/odh/test/framework/manager/requirements/PipelinesOperator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright Skodjob authors. | ||
* License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html). | ||
*/ | ||
package io.odh.test.framework.manager.requirements; | ||
|
||
import io.fabric8.openshift.api.model.operatorhub.v1alpha1.Subscription; | ||
import io.fabric8.openshift.api.model.operatorhub.v1alpha1.SubscriptionBuilder; | ||
import io.odh.test.OdhAnnotationsLabels; | ||
import io.odh.test.framework.manager.ResourceItem; | ||
import io.odh.test.framework.manager.ResourceManager; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collections; | ||
|
||
public class PipelinesOperator { | ||
private static final Logger LOGGER = LoggerFactory.getLogger(PipelinesOperator.class); | ||
|
||
public static void deployOperator() { | ||
Subscription subscription = new SubscriptionBuilder() | ||
.editOrNewMetadata() | ||
.withName("openshift-pipelines-operator") | ||
.withNamespace("openshift-operators") | ||
.withLabels(Collections.singletonMap(OdhAnnotationsLabels.APP_LABEL_KEY, OdhAnnotationsLabels.APP_LABEL_VALUE)) | ||
.endMetadata() | ||
.editOrNewSpec() | ||
.withName("openshift-pipelines-operator-rh") | ||
.withChannel("latest") | ||
.withSource("redhat-operators") | ||
.withSourceNamespace("openshift-marketplace") | ||
.withInstallPlanApproval("Automatic") | ||
.editOrNewConfig() | ||
.endConfig() | ||
.endSpec() | ||
.build(); | ||
|
||
ResourceManager.getInstance().createResourceWithWait(subscription); | ||
ResourceManager.getInstance().pushToStack(new ResourceItem(() -> deleteOperator(subscription), null)); | ||
} | ||
|
||
public static void deleteOperator(Subscription subscription) { | ||
ResourceManager.getClient().delete(Arrays.asList(subscription)); | ||
} | ||
} |
72 changes: 72 additions & 0 deletions
72
src/main/java/io/odh/test/framework/manager/requirements/ServerlessOperator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* Copyright Skodjob authors. | ||
* License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html). | ||
*/ | ||
package io.odh.test.framework.manager.requirements; | ||
|
||
import io.fabric8.kubernetes.api.model.Namespace; | ||
import io.fabric8.kubernetes.api.model.NamespaceBuilder; | ||
import io.fabric8.openshift.api.model.operatorhub.v1.OperatorGroupBuilder; | ||
import io.fabric8.openshift.api.model.operatorhub.v1alpha1.Subscription; | ||
import io.fabric8.openshift.api.model.operatorhub.v1alpha1.SubscriptionBuilder; | ||
import io.odh.test.OdhAnnotationsLabels; | ||
import io.odh.test.framework.manager.ResourceItem; | ||
import io.odh.test.framework.manager.ResourceManager; | ||
import io.odh.test.framework.manager.resources.OperatorGroupResource; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collections; | ||
|
||
public class ServerlessOperator { | ||
private static final Logger LOGGER = LoggerFactory.getLogger(ServerlessOperator.class); | ||
public static void deployOperator() { | ||
String operatorNs = "openshift-serverless"; | ||
// Create ns for the operator | ||
Namespace ns = new NamespaceBuilder() | ||
.withNewMetadata() | ||
.withName(operatorNs) | ||
.withLabels(Collections.singletonMap(OdhAnnotationsLabels.APP_LABEL_KEY, OdhAnnotationsLabels.APP_LABEL_VALUE)) | ||
.endMetadata() | ||
.build(); | ||
ResourceManager.getInstance().createResourceWithoutWait(ns); | ||
//Create operator group for the operator | ||
if (OperatorGroupResource.operatorGroupClient().inNamespace(operatorNs).list().getItems().isEmpty()) { | ||
OperatorGroupBuilder operatorGroup = new OperatorGroupBuilder() | ||
.editOrNewMetadata() | ||
.withName("odh-group") | ||
.withNamespace(operatorNs) | ||
.withLabels(Collections.singletonMap(OdhAnnotationsLabels.APP_LABEL_KEY, OdhAnnotationsLabels.APP_LABEL_VALUE)) | ||
.endMetadata(); | ||
|
||
ResourceManager.getInstance().createResourceWithWait(operatorGroup.build()); | ||
} else { | ||
LOGGER.info("OperatorGroup is already exists."); | ||
} | ||
// Create subscription | ||
Subscription subscription = new SubscriptionBuilder() | ||
.editOrNewMetadata() | ||
.withName("serverless-operator") | ||
.withNamespace(operatorNs) | ||
.withLabels(Collections.singletonMap(OdhAnnotationsLabels.APP_LABEL_KEY, OdhAnnotationsLabels.APP_LABEL_VALUE)) | ||
.endMetadata() | ||
.editOrNewSpec() | ||
.withName("serverless-operator") | ||
.withChannel("stable") | ||
.withSource("redhat-operators") | ||
.withSourceNamespace("openshift-marketplace") | ||
.withInstallPlanApproval("Automatic") | ||
.editOrNewConfig() | ||
.endConfig() | ||
.endSpec() | ||
.build(); | ||
|
||
ResourceManager.getInstance().createResourceWithWait(subscription); | ||
ResourceManager.getInstance().pushToStack(new ResourceItem(() -> deleteOperator(ns), null)); | ||
} | ||
|
||
public static void deleteOperator(Namespace namespace) { | ||
ResourceManager.getClient().delete(Arrays.asList(namespace)); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
src/main/java/io/odh/test/framework/manager/requirements/ServiceMeshOperator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright Skodjob authors. | ||
* License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html). | ||
*/ | ||
package io.odh.test.framework.manager.requirements; | ||
|
||
import io.fabric8.openshift.api.model.operatorhub.v1alpha1.Subscription; | ||
import io.fabric8.openshift.api.model.operatorhub.v1alpha1.SubscriptionBuilder; | ||
import io.odh.test.OdhAnnotationsLabels; | ||
import io.odh.test.framework.manager.ResourceItem; | ||
import io.odh.test.framework.manager.ResourceManager; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collections; | ||
|
||
public class ServiceMeshOperator { | ||
private static final Logger LOGGER = LoggerFactory.getLogger(ServiceMeshOperator.class); | ||
|
||
public static void deployOperator() { | ||
Subscription subscription = new SubscriptionBuilder() | ||
.editOrNewMetadata() | ||
.withName("servicemeshoperator") | ||
.withNamespace("openshift-operators") | ||
.withLabels(Collections.singletonMap(OdhAnnotationsLabels.APP_LABEL_KEY, OdhAnnotationsLabels.APP_LABEL_VALUE)) | ||
.endMetadata() | ||
.editOrNewSpec() | ||
.withName("servicemeshoperator") | ||
.withChannel("stable") | ||
.withSource("redhat-operators") | ||
.withSourceNamespace("openshift-marketplace") | ||
.withInstallPlanApproval("Automatic") | ||
.editOrNewConfig() | ||
.endConfig() | ||
.endSpec() | ||
.build(); | ||
|
||
ResourceManager.getInstance().createResourceWithWait(subscription); | ||
ResourceManager.getInstance().pushToStack(new ResourceItem(() -> deleteOperator(subscription), null)); | ||
} | ||
|
||
public static void deleteOperator(Subscription subscription) { | ||
ResourceManager.getClient().delete(Arrays.asList(subscription)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.