-
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.
Deploy DSCI as it is not created automatically (#66)
Signed-off-by: David Kornel <[email protected]>
- Loading branch information
Showing
7 changed files
with
158 additions
and
5 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
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
63 changes: 63 additions & 0 deletions
63
src/main/java/io/odh/test/framework/manager/resources/DataScienceInitializationResource.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,63 @@ | ||
/* | ||
* 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.resources; | ||
|
||
import io.fabric8.kubernetes.api.model.KubernetesResourceList; | ||
import io.fabric8.kubernetes.client.dsl.MixedOperation; | ||
import io.fabric8.kubernetes.client.dsl.Resource; | ||
import io.odh.test.TestConstants; | ||
import io.odh.test.TestUtils; | ||
import io.odh.test.framework.manager.ResourceManager; | ||
import io.odh.test.framework.manager.ResourceType; | ||
import io.opendatahub.dscinitialization.v1.DSCInitialization; | ||
|
||
public class DataScienceInitializationResource implements ResourceType<DSCInitialization> { | ||
|
||
@Override | ||
public String getKind() { | ||
return "DSCInitialization"; | ||
} | ||
|
||
@Override | ||
public DSCInitialization get(String namespace, String name) { | ||
return dsciClient().withName(name).get(); | ||
} | ||
|
||
@Override | ||
public void create(DSCInitialization resource) { | ||
dsciClient().resource(resource).create(); | ||
} | ||
|
||
@Override | ||
public void delete(DSCInitialization resource) { | ||
dsciClient().withName(resource.getMetadata().getName()).delete(); | ||
} | ||
|
||
@Override | ||
public void update(DSCInitialization resource) { | ||
dsciClient().resource(resource).update(); | ||
} | ||
|
||
@Override | ||
public boolean waitForReadiness(DSCInitialization resource) { | ||
String message = String.format("DataScienceCluster %s readiness", resource.getMetadata().getName()); | ||
TestUtils.waitFor(message, TestConstants.GLOBAL_POLL_INTERVAL_SHORT, TestConstants.GLOBAL_TIMEOUT, () -> { | ||
boolean dsciReady; | ||
|
||
DSCInitialization dsci = dsciClient().withName(resource.getMetadata().getName()).get(); | ||
|
||
dsciReady = dsci.getStatus().getPhase().equals("Ready"); | ||
|
||
return dsciReady; | ||
}, () -> { | ||
}); | ||
return true; | ||
} | ||
|
||
public static MixedOperation<DSCInitialization, KubernetesResourceList<DSCInitialization>, Resource<DSCInitialization>> dsciClient() { | ||
return ResourceManager.getClient().getClient().resources(DSCInitialization.class); | ||
} | ||
|
||
} |
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