-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix typo #1
base: master
Are you sure you want to change the base?
Fix typo #1
Conversation
According to https://github.com/ceph/ceph-container/blob/master/src/daemon/demo.sh#L13 , `DEMO_DEMONS` should be `DEMO_DAEMONS`
@quaff is DEMO_DAEMONS necessary to test with Ceph as a testcontainer ? Should I add an option in https://github.com/jarlah/testcontainers-ceph (which is a community module) to override which modules are used in the ceph/demo image ? (if possible at all, but I do remember seeing this in the demo script) ofc necroing as hell here replying to this 2 year old issue ;D |
I'm using private static final String ACCESS_KEY = "test";
private static final String SECRET_KEY = "test";
@Container
static GenericContainer<?> container = new GenericContainer<>(
"quay.io/ceph/daemon:v7.0.3-stable-7.0-quincy-centos-stream8-x86_64")
.withEnv("CEPH_DEMO_ACCESS_KEY", ACCESS_KEY)
.withEnv("CEPH_DEMO_SECRET_KEY", SECRET_KEY)
.withEnv("RGW_NAME", "localhost")
.withEnv("CEPH_DEMO_UID", "admin")
.withEnv("NETWORK_AUTO_DETECT", "1")
.withExposedPorts(8080)
.withCommand("demo");
@DynamicPropertySource
static void registerDynamicProperties(DynamicPropertyRegistry registry) {
registry.add("file-storage.s3.endpoint",
() -> "http://" + container.getHost() + ":" + container.getFirstMappedPort());
registry.add("file-storage.s3.access-key", () -> ACCESS_KEY);
registry.add("file-storage.s3.secret-key", () -> SECRET_KEY);
} |
@quaff thanks. It looks like the only difference between the demo and daemon image is the command part. If you want to avoid defining all this your self you can start using the community module for ceph i have recently released. It doesnt look like it will change much. I think the biggest difference is that its now auto creating bucket. And its waitlng a bit too long before container is ready. I have a fix for the latter and the first part i guess is just practical. |
For reference, this is the community module https://github.com/jarlah/testcontainers-ceph currently working on supporting customer encrypted file uploads. Trying at least. |
I added this PR to speed up startup of container and also added a test to verify that daemon image is compatible with the module 👉 https://github.com/jarlah/testcontainers-ceph/pull/10/files#diff-fe944dd398e754a58f85a464c7734235a43c918aec028825b1d52ad93285c669R68 |
v1.2.0 is now ready https://central.sonatype.com/artifact/io.github.jarlah/testcontainers-ceph/1.2.0 about something completely different btw, but I recently found out about the singleton pattern combined with dynamic property source. @TestConfiguration
public class AbstractCephContainerTest {
private static final CephContainer container;
static {
container = new CephContainer();
container.start();
}
@DynamicPropertySource
static void registerDynamicProperties(DynamicPropertyRegistry registry) throws Exception {
String url = container.getCephUrl().toString();
registry.add("file-storage.s3.endpoint", () -> url);
registry.add("file-storage.s3.access-key", () -> container.getCephAccessKey());
registry.add("file-storage.s3.secret-key", () -> container.getCephSecretKey());
}
} at least for my 15-20 test suites .. this makes it a lot more peformant :D |
According to https://github.com/ceph/ceph-container/blob/master/src/daemon/demo.sh#L13 ,
DEMO_DEMONS
should beDEMO_DAEMONS