@@ -18,7 +18,6 @@ package odh
18
18
19
19
import (
20
20
"bytes"
21
- "os"
22
21
23
22
gomega "github.com/onsi/gomega"
24
23
. "github.com/project-codeflare/codeflare-common/support"
@@ -61,6 +60,7 @@ func createNotebook(test Test, namespace *corev1.Namespace, notebookUserToken, j
61
60
s3BucketName , _ := GetStorageBucketName ()
62
61
s3AccessKeyId , _ := GetStorageBucketAccessKeyId ()
63
62
s3SecretAccessKey , _ := GetStorageBucketSecretKey ()
63
+ s3DefaultRegion , _ := GetStorageBucketDefaultRegion ()
64
64
65
65
// Read the Notebook CR from resources and perform replacements for custom values using go template
66
66
notebookProps := NotebookProps {
@@ -78,45 +78,7 @@ func createNotebook(test Test, namespace *corev1.Namespace, notebookUserToken, j
78
78
S3BucketName : s3BucketName ,
79
79
S3AccessKeyId : s3AccessKeyId ,
80
80
S3SecretAccessKey : s3SecretAccessKey ,
81
- S3DefaultRegion : GetS3DefaultRegion (),
82
- }
83
- notebookTemplate , err := files .ReadFile ("resources/custom-nb-small.yaml" )
84
- test .Expect (err ).NotTo (gomega .HaveOccurred ())
85
-
86
- parsedNotebookTemplate := ParseTemplate (test , notebookTemplate , notebookProps )
87
-
88
- // Create Notebook CR
89
- notebookCR := & unstructured.Unstructured {}
90
- err = yaml .NewYAMLOrJSONDecoder (bytes .NewBuffer (parsedNotebookTemplate ), 8192 ).Decode (notebookCR )
91
- test .Expect (err ).NotTo (gomega .HaveOccurred ())
92
- _ , err = test .Client ().Dynamic ().Resource (notebookResource ).Namespace (namespace .Name ).Create (test .Ctx (), notebookCR , metav1.CreateOptions {})
93
- test .Expect (err ).NotTo (gomega .HaveOccurred ())
94
- }
95
-
96
- func createNotebookWithPvc (test Test , namespace * corev1.Namespace , notebookUserToken , jupyterNotebookConfigMapName , jupyterNotebookConfigMapFileName string , numGpus int ) {
97
- // Create PVC for Notebook
98
- notebookPVC := CreatePersistentVolumeClaim (test , namespace .Name , "10Gi" , corev1 .ReadWriteOnce )
99
- s3BucketName , _ := GetStorageBucketName ()
100
- s3AccessKeyId , _ := GetStorageBucketAccessKeyId ()
101
- s3SecretAccessKey , _ := GetStorageBucketSecretKey ()
102
-
103
- // Read the Notebook CR from resources and perform replacements for custom values using go template
104
- notebookProps := NotebookProps {
105
- IngressDomain : GetOpenShiftIngressDomain (test ),
106
- OpenShiftApiUrl : GetOpenShiftApiUrl (test ),
107
- KubernetesUserBearerToken : notebookUserToken ,
108
- Namespace : namespace .Name ,
109
- OpenDataHubNamespace : GetOpenDataHubNamespace (test ),
110
- RayImage : GetRayImage (),
111
- NotebookImage : GetNotebookImage (test ),
112
- NotebookConfigMapName : jupyterNotebookConfigMapName ,
113
- NotebookConfigMapFileName : jupyterNotebookConfigMapFileName ,
114
- NotebookPVC : notebookPVC .Name ,
115
- NumGpus : numGpus ,
116
- S3BucketName : s3BucketName ,
117
- S3AccessKeyId : s3AccessKeyId ,
118
- S3SecretAccessKey : s3SecretAccessKey ,
119
- S3DefaultRegion : GetS3DefaultRegion (),
81
+ S3DefaultRegion : s3DefaultRegion ,
120
82
}
121
83
notebookTemplate , err := files .ReadFile ("resources/custom-nb-small.yaml" )
122
84
test .Expect (err ).NotTo (gomega .HaveOccurred ())
@@ -147,7 +109,3 @@ func listNotebooks(test Test, namespace *corev1.Namespace) []*unstructured.Unstr
147
109
148
110
return ntbsp
149
111
}
150
-
151
- func GetS3DefaultRegion () string {
152
- return os .Getenv ("AWS_DEFAULT_REGION" )
153
- }
0 commit comments