eolivelli commented on code in PR #3592: URL: https://github.com/apache/celeborn/pull/3592#discussion_r2758432422
########## tests/spark-it/src/test/scala/org/apache/celeborn/tests/spark/s3/BasicEndToEndTieredStorageTest.scala: ########## @@ -0,0 +1,112 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.celeborn.tests.spark + +import io.minio.{MakeBucketArgs, MinioClient} +import org.apache.spark.SparkConf +import org.apache.spark.sql.SparkSession +import org.scalatest.BeforeAndAfterEach +import org.scalatest.funsuite.AnyFunSuite +import org.testcontainers.containers.MinIOContainer + +import org.apache.celeborn.client.ShuffleClient +import org.apache.celeborn.common.CelebornConf +import org.apache.celeborn.common.protocol.ShuffleMode + +class BasicEndToEndTieredStorageTest extends AnyFunSuite + with SparkTestBase + with BeforeAndAfterEach { + + var container: MinIOContainer = null; + + override def beforeAll(): Unit = { + container = new MinIOContainer("minio/minio:RELEASE.2023-09-04T19-57-37Z"); + container.start() + + val minioClient = MinioClient + .builder() + .endpoint(container.getS3URL) + .credentials(container.getUserName, container.getPassword) + .build(); + minioClient + .makeBucket(MakeBucketArgs.builder().bucket("sample-bucket").build()) + + System.setProperty("aws.accessKeyId", container.getUserName) + System.setProperty("aws.secretKey", container.getPassword) + + super.beforeAll() + } + + override def beforeEach(): Unit = { + ShuffleClient.reset() + } + + override def afterAll(): Unit = { + if (container != null) { + container.close() + super.afterAll() + } + } + + override def overrideDefaultConfiguration(conf: Map[String, String]): Map[String, String] = { Review Comment: > It seems like all other test classes that derive from SparkTestBase do this This is not always the case (many tests rely on the default `beforeAll`), but I think that given that I was adding this method to the framework only for this test then it make sense to keep it simple and follow your suggestion ########## multipart-uploader/multipart-uploader-s3/src/main/java/org/apache/celeborn/S3MultipartUploadHandler.java: ########## @@ -103,12 +106,25 @@ public S3MultipartUploadHandler( new ClientConfiguration() .withRetryPolicy(retryPolicy) .withMaxErrorRetry(s3MultiplePartUploadMaxRetries); - this.s3Client = + var builder = AmazonS3ClientBuilder.standard() - .withCredentials(providers) - .withRegion(conf.get(Constants.AWS_REGION)) - .withClientConfiguration(clientConfig) - .build(); + .withCredentials( + DefaultAWSCredentialsProviderChain.getInstance()) // TODO: Use config from Hadoop or + // DefaultAWSCredentialsProviderChain + .withClientConfiguration(clientConfig); Review Comment: good catch, I messed up while resolving the conflicts ########## worker/src/main/scala/org/apache/celeborn/service/deploy/worker/storage/StorageManager.scala: ########## @@ -1081,6 +1082,7 @@ final private[worker] class StorageManager(conf: CelebornConf, workerSource: Abs partitionType: PartitionType, partitionSplitEnabled: Boolean): (Flusher, DiskFileInfo, File) = { val suggestedMountPoint = location.getStorageInfo.getMountPoint + val storageTyoe = location.getStorageInfo.getType Review Comment: fixed -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
