-
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 (#79)
Signed-off-by: Jakub Stejskal <[email protected]>
- Loading branch information
Showing
13 changed files
with
314 additions
and
17 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
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
50 changes: 50 additions & 0 deletions
50
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,50 @@ | ||
/* | ||
* 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.TestConstants; | ||
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 final String SUBSCRIPTION_NAME = "openshift-pipelines-operator"; | ||
public static final String OPERATOR_NAME = "openshift-pipelines-operator-rh"; | ||
|
||
public static void deployOperator() { | ||
Subscription subscription = new SubscriptionBuilder() | ||
.editOrNewMetadata() | ||
.withName(SUBSCRIPTION_NAME) | ||
.withNamespace(TestConstants.OPENSHIFT_OPERATORS_NS) | ||
.withLabels(Collections.singletonMap(OdhAnnotationsLabels.APP_LABEL_KEY, OdhAnnotationsLabels.APP_LABEL_VALUE)) | ||
.endMetadata() | ||
.editOrNewSpec() | ||
.withName(OPERATOR_NAME) | ||
.withChannel(TestConstants.CHANNEL_LATEST) | ||
.withSource(TestConstants.REDHAT_CATALOG) | ||
.withSourceNamespace(TestConstants.OPENSHIFT_MARKETPLACE_NS) | ||
.withInstallPlanApproval(TestConstants.APPROVAL_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)); | ||
} | ||
} |
75 changes: 75 additions & 0 deletions
75
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,75 @@ | ||
/* | ||
* 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.TestConstants; | ||
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 final String SUBSCRIPTION_NAME = "serverless-operator"; | ||
public static final String OPERATOR_NAME = "serverless-operator"; | ||
public static final String OPERATOR_NAMESPACE = "openshift-serverless"; | ||
public static void deployOperator() { | ||
// Create ns for the operator | ||
Namespace ns = new NamespaceBuilder() | ||
.withNewMetadata() | ||
.withName(OPERATOR_NAMESPACE) | ||
.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(OPERATOR_NAMESPACE).list().getItems().isEmpty()) { | ||
OperatorGroupBuilder operatorGroup = new OperatorGroupBuilder() | ||
.editOrNewMetadata() | ||
.withName("odh-group") | ||
.withNamespace(OPERATOR_NAMESPACE) | ||
.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(SUBSCRIPTION_NAME) | ||
.withNamespace(OPERATOR_NAMESPACE) | ||
.withLabels(Collections.singletonMap(OdhAnnotationsLabels.APP_LABEL_KEY, OdhAnnotationsLabels.APP_LABEL_VALUE)) | ||
.endMetadata() | ||
.editOrNewSpec() | ||
.withName(OPERATOR_NAME) | ||
.withChannel(TestConstants.CHANNEL_STABLE) | ||
.withSource(TestConstants.REDHAT_CATALOG) | ||
.withSourceNamespace(TestConstants.OPENSHIFT_MARKETPLACE_NS) | ||
.withInstallPlanApproval(TestConstants.APPROVAL_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)); | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
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,51 @@ | ||
/* | ||
* 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.TestConstants; | ||
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 final String SUBSCRIPTION_NAME = "servicemeshoperator"; | ||
public static final String OPERATOR_NAME = "servicemeshoperator"; | ||
public static final String SERVICE_MESH_NAMESPACE = "istio-system"; | ||
public static final String SERVICE_MESH_NAME = "data-science-smcp"; | ||
|
||
public static void deployOperator() { | ||
Subscription subscription = new SubscriptionBuilder() | ||
.editOrNewMetadata() | ||
.withName(SUBSCRIPTION_NAME) | ||
.withNamespace(TestConstants.OPENSHIFT_OPERATORS_NS) | ||
.withLabels(Collections.singletonMap(OdhAnnotationsLabels.APP_LABEL_KEY, OdhAnnotationsLabels.APP_LABEL_VALUE)) | ||
.endMetadata() | ||
.editOrNewSpec() | ||
.withName(OPERATOR_NAME) | ||
.withChannel(TestConstants.CHANNEL_STABLE) | ||
.withSource(TestConstants.REDHAT_CATALOG) | ||
.withSourceNamespace(TestConstants.OPENSHIFT_MARKETPLACE_NS) | ||
.withInstallPlanApproval(TestConstants.APPROVAL_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
Oops, something went wrong.