Skip to content

Commit faaa671

Browse files
Added parameters for S3 compatible storage bucket from which to download MNIST datasets
1 parent 22087f8 commit faaa671

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

support/environment.go

+36-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const (
2929
CodeFlareTestRayVersion = "CODEFLARE_TEST_RAY_VERSION"
3030
CodeFlareTestRayImage = "CODEFLARE_TEST_RAY_IMAGE"
3131
CodeFlareTestPyTorchImage = "CODEFLARE_TEST_PYTORCH_IMAGE"
32+
NotebookImage = "NOTEBOOK_IMAGE"
3233

3334
// The testing output directory, to write output files into.
3435
CodeFlareTestOutputDir = "CODEFLARE_TEST_OUTPUT_DIR"
@@ -51,6 +52,13 @@ const (
5152
// URL for PiPI index containing all the required test Python packages
5253
pipIndexURL = "PIP_INDEX_URL"
5354
pipTrustedHost = "PIP_TRUSTED_HOST"
55+
56+
// Storage bucket credentials
57+
storageDefaultEndpoint = "AWS_DEFAULT_ENDPOINT"
58+
storageAccessKeyId = "AWS_ACCESS_KEY_ID"
59+
storageSecretKey = "AWS_SECRET_ACCESS_KEY"
60+
storageBucketName = "AWS_STORAGE_BUCKET"
61+
storageBucketMnistDir = "AWS_STORAGE_BUCKET_MNIST_DIR"
5462
)
5563

5664
type ClusterType string
@@ -79,6 +87,10 @@ func GetPyTorchImage() string {
7987
return lookupEnvOrDefault(CodeFlareTestPyTorchImage, "pytorch/pytorch:1.11.0-cuda11.3-cudnn8-runtime")
8088
}
8189

90+
func GetNotebookImage() string {
91+
return lookupEnvOrDefault(NotebookImage, "quay.io/modh/odh-generic-data-science-notebook@sha256:bb33abc67af1328d3b32899f58bcdc0cf1681605e1b5da57f8fe8da81523a9bd")
92+
}
93+
8294
func GetInstascaleOcmSecret() (string, string) {
8395
res := strings.SplitN(lookupEnvOrDefault(InstaScaleOcmSecret, "default/instascale-ocm-secret"), "/", 2)
8496
return res[0], res[1]
@@ -118,7 +130,30 @@ func GetClusterHostname(t Test) string {
118130
}
119131

120132
func GetMnistDatasetURL() string {
121-
return lookupEnvOrDefault(mnistDatasetURL, "http://yann.lecun.com/exdb/mnist/")
133+
return lookupEnvOrDefault(mnistDatasetURL, "https://ossci-datasets.s3.amazonaws.com/mnist/")
134+
}
135+
136+
func GetStorageBucketDefaultEndpoint() (string, bool) {
137+
storage_endpoint, exists := os.LookupEnv(storageDefaultEndpoint)
138+
return storage_endpoint, exists
139+
}
140+
141+
func GetStorageBucketAccessKeyId() (string, bool) {
142+
storage_access_key_id, exists := os.LookupEnv(storageAccessKeyId)
143+
return storage_access_key_id, exists
144+
}
145+
146+
func GetStorageBucketSecretKey() (string, bool) {
147+
storage_secret_key, exists := os.LookupEnv(storageSecretKey)
148+
return storage_secret_key, exists
149+
}
150+
151+
func GetStorageBucketName() string {
152+
return lookupEnvOrDefault(storageBucketName, "rhoai-dw")
153+
}
154+
155+
func GetStorageBucketMnistDir() string {
156+
return lookupEnvOrDefault(storageBucketMnistDir, "mnist-datasets")
122157
}
123158

124159
func GetPipIndexURL() string {

0 commit comments

Comments
 (0)