adoroszlai commented on code in PR #10966: URL: https://github.com/apache/ozone/pull/10966#discussion_r4374651345
########## hadoop-ozone/ozone-testcontainers/src/main/java/org/apache/ozone/testcontainers/OzoneContainer.java: ########## @@ -0,0 +1,86 @@ +/* + * 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.ozone.testcontainers; + +import java.time.Duration; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.containers.wait.strategy.Wait; +import org.testcontainers.containers.wait.strategy.WaitAllStrategy; +import org.testcontainers.utility.DockerImageName; + +/** + * Testcontainers wrapper for a single-node Ozone with S3 Gateway, so JVM + * integration tests can start Ozone the way they use the MinIO or LocalStack + * modules. Wraps the all-in-one quickstart image (HDDS-14452 / ozone-docker#49), + * which runs SCM, OM, datanode, S3 Gateway, Recon and HttpFS in one container + * and exposes S3G on 9878. + * + * <p>Credentials: in non-secure mode S3G does not verify request signatures, so any secret / region is + * accepted. The access key is still passed to OM as the Ozone user name, so it decides the owner of the + * buckets and keys a test creates. {@link #getAccessKey()} / {@link #getSecretKey()} / {@link #getRegion()} + * provide a consistent set for the caller to sign requests with. + * + * <p>Readiness: the container waits for the S3 Gateway port, then retries {@code ozone admin safemode wait} + * until SCM leaves safe mode. The startup timeout defaults to four minutes and can be changed with + * {@link #withStartupTimeout(Duration)}. + * + * <p><b>Incubating:</b> this module is new and its API may change in a future + * release. + */ +public class OzoneContainer extends GenericContainer<OzoneContainer> { + + public static final int S3G_PORT = 9878; + + static final DockerImageName DEFAULT_IMAGE = + DockerImageName.parse("apache/ozone:2.2.1-all-in-one"); Review Comment: Sure, we can add it here now and decide later. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
