Skip to content

Commit b41e108

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

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

support/environment.go

+33-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ const (
5151
// URL for PiPI index containing all the required test Python packages
5252
pipIndexURL = "PIP_INDEX_URL"
5353
pipTrustedHost = "PIP_TRUSTED_HOST"
54+
55+
// Storage bucket credentials
56+
storageDefaultEndpoint = "AWS_DEFAULT_ENDPOINT"
57+
storageAccessKeyId = "AWS_ACCESS_KEY_ID"
58+
storageSecretKey = "AWS_SECRET_ACCESS_KEY"
59+
storageBucketName = "AWS_STORAGE_BUCKET"
60+
storageBucketMnistDir = "AWS_STORAGE_BUCKET_MNIST_DIR"
5461
)
5562

5663
type ClusterType string
@@ -118,7 +125,32 @@ func GetClusterHostname(t Test) string {
118125
}
119126

120127
func GetMnistDatasetURL() string {
121-
return lookupEnvOrDefault(mnistDatasetURL, "http://yann.lecun.com/exdb/mnist/")
128+
return lookupEnvOrDefault(mnistDatasetURL, "https://ossci-datasets.s3.amazonaws.com/mnist/")
129+
}
130+
131+
func GetStorageBucketDefaultEndpoint() (string, bool) {
132+
storage_endpoint, exists := os.LookupEnv(storageDefaultEndpoint)
133+
return storage_endpoint, exists
134+
}
135+
136+
func GetStorageBucketAccessKeyId() (string, bool) {
137+
storage_access_key_id, exists := os.LookupEnv(storageAccessKeyId)
138+
return storage_access_key_id, exists
139+
}
140+
141+
func GetStorageBucketSecretKey() (string, bool) {
142+
storage_secret_key, exists := os.LookupEnv(storageSecretKey)
143+
return storage_secret_key, exists
144+
}
145+
146+
func GetStorageBucketName() (string, bool) {
147+
storage_bucket_name, exists := os.LookupEnv(storageBucketName)
148+
return storage_bucket_name, exists
149+
}
150+
151+
func GetStorageBucketMnistDir() (string, bool) {
152+
storage_bucket_mnist_dir, exists := os.LookupEnv(storageBucketMnistDir)
153+
return storage_bucket_mnist_dir, exists
122154
}
123155

124156
func GetPipIndexURL() string {

0 commit comments

Comments
 (0)