-
Notifications
You must be signed in to change notification settings - Fork 377
NoSQL: Add to runtime-service #3396
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,6 +41,8 @@ quarkus.micrometer.enabled=true | |
| quarkus.micrometer.export.prometheus.enabled=true | ||
| quarkus.oidc.enabled=true | ||
| quarkus.otel.enabled=true | ||
| #quarkus.mongodb.metrics.enabled=true | ||
| #quarkus.mongodb.connection-string=mongodb://localhost:27017 | ||
|
|
||
| # ---- Runtime Configuration ---- | ||
| # Below are default values for properties that can be changed in runtime. | ||
|
|
@@ -128,16 +130,29 @@ polaris.features."SUPPORTED_CATALOG_CONNECTION_TYPES"=["ICEBERG_REST"] | |
| # realm overrides | ||
| # polaris.features.realm-overrides."my-realm"."SKIP_CREDENTIAL_SUBSCOPING_INDIRECTION"=true | ||
|
|
||
| # polaris.persistence.type=in-memory-atomic | ||
| # Available types: | ||
| # - in-memory - InMemoryPolarisMetaStoreManagerFactory | ||
| # - in-memory-atomic - InMemoryAtomicOperationMetaStoreManagerFactory | ||
| # - nosql (beta) - NoSQL persistence backend, define the backend type via 'polaris.persistence.nosql.backend' | ||
| # - relational-jdbc | ||
| polaris.persistence.type=in-memory | ||
| # polaris.persistence.type=relational-jdbc | ||
| # Database backend for 'nosql' persistence-type | ||
| # Available backends: | ||
| # - InMemory - for testing purposes | ||
| # - MongoDb - configure the via the Quarkus extension | ||
| # Configure the necessary MongoDB properties starting with 'quarkus.mongodb.' in this file. | ||
| # See https://quarkus.io/guides/mongodb#configuration-reference for details about these configurations. | ||
| #polaris.persistence.nosql.backend=InMemory | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: whitespace |
||
|
|
||
| polaris.secrets-manager.type=in-memory | ||
| # if set to true it will try to start localstack at build and run time for the local environment | ||
| # https://docs.quarkiverse.io/quarkus-amazon-services/dev/amazon-rds.html#_configuration_reference for more details | ||
| quarkus.rds.devservices.enabled=false | ||
| quarkus.rds.sync-client.type=apache | ||
|
|
||
| ## MongoDB specific configuration | ||
| #quarkus.mongodb.database=polaris | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: whitespace |
||
|
|
||
| polaris.file-io.type=default | ||
|
|
||
| polaris.event-listener.type=no-op | ||
|
|
@@ -283,6 +298,8 @@ quarkus.arc.ignored-split-packages=\ | |
|
|
||
| ## Quarkus required setting for third party indexing | ||
| # fixed at build-time | ||
| quarkus.index-dependency.agrona.group-id=org.agrona | ||
| quarkus.index-dependency.agrona.artifact-id=agrona | ||
|
Comment on lines
+301
to
+302
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question, why do we need these two new configs?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The comment just above (lines 298-299) explains it, does it not?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. indexing jars is generally required for proper CDI
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CDI has been there since we introduced Quarkus to Polaris without indexing jars. Why do we need them now?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I'm understanding correctly, indexing isn't the new thing, but I do agree a bit that agrona is less ubiquitous the others here, so could be worth a quick comment in here saying what agrona does (looks like it's a fancy utils library? https://github.com/aeron-io/agrona) In my experience avro, guava, and protobuf are ubiquitous enough that no one thinks twice seeing it in deps, but agrona might be new to some folks (like me, or maybe I'm just old-fashioned :) ) I like to lean towards over-communicating rather than risk under-communicating in comments in these cases, since things like compliance audits, etc., will have folks looking through these types of configs and anything that can avoid unnecessary questions will help save time for everyone
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, in my local env. I experimented with commenting out all of these index properties and I do not see any effect :) I propose to open a GH issue for a more in-depth investigation and removal of them later, on
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks @dimas-b , that works for me. We can always add them back if it turns out useful.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here's the issue: #3467
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did more local debugging and this indexing property does appear to be advised by Quarkus for the Here's the warning message from Quarkus when running without this property: That said, I'm investigating the reason why this message does not show up during normal build (no debugger) under #3467. I believe this resolves this comment thread. @flyrain : WDYT?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SGTM. Thanks @dimas-b ! |
||
| quarkus.index-dependency.avro.group-id=org.apache.avro | ||
| quarkus.index-dependency.avro.artifact-id=avro | ||
| quarkus.index-dependency.guava.group-id=com.google.guava | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,6 +39,12 @@ dependencies { | |
| compileOnly(project(":polaris-immutables")) | ||
| annotationProcessor(project(":polaris-immutables", configuration = "processor")) | ||
|
|
||
| runtimeOnly(project(":polaris-persistence-nosql-metastore")) | ||
| runtimeOnly(project(":polaris-persistence-nosql-cdi-quarkus")) | ||
| runtimeOnly(project(":polaris-persistence-nosql-cdi-quarkus-distcache")) | ||
| runtimeOnly(project(":polaris-persistence-nosql-maintenance-impl")) | ||
| runtimeOnly(project(":polaris-persistence-nosql-metastore-maintenance")) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we already did this for JDBC, adding these makes sense. That said, looking at the Not a blocker
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I support the idea of doing integration tests separately in each major plugin module (JDBC, NoSQL, etc.). OPA does that already. It will probably add CI time due to extra Quarkus build activity, but improves isolation. This is certainly for future discussion / follow-up PRs.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is imho, a great use of a followup issue. The follow up would make things arguably more clean but requires a larger refactoring than the scope of this pr which currently just follows the existing model from JDBC.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For consideration: #3569 |
||
|
|
||
| implementation(platform(libs.iceberg.bom)) | ||
| implementation("org.apache.iceberg:iceberg-api") | ||
| implementation("org.apache.iceberg:iceberg-core") | ||
|
|
@@ -153,6 +159,10 @@ dependencies { | |
| testImplementation("org.testcontainers:testcontainers") | ||
| testImplementation("org.testcontainers:testcontainers-postgresql") | ||
|
|
||
| testImplementation(project(":polaris-persistence-nosql-api")) | ||
| testImplementation(testFixtures(project(":polaris-persistence-nosql-api"))) | ||
| testImplementation(project(":polaris-persistence-nosql-impl")) | ||
|
|
||
| testFixturesImplementation(project(":polaris-core")) | ||
| testFixturesImplementation(project(":polaris-api-management-model")) | ||
| testFixturesImplementation(project(":polaris-api-management-service")) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| /* | ||
| * 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.polaris.service.it.nosql; | ||
|
|
||
| import io.quarkus.test.junit.QuarkusIntegrationTest; | ||
| import io.quarkus.test.junit.TestProfile; | ||
| import org.apache.polaris.service.it.test.PolarisApplicationIntegrationTest; | ||
|
|
||
| @QuarkusIntegrationTest | ||
| @TestProfile(value = NoSqlTesting.PersistenceInMemoryProfile.class) | ||
| public class NoSqlApplicationIT extends PolarisApplicationIntegrationTest {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| /* | ||
| * 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.polaris.service.it.nosql; | ||
|
|
||
| import com.google.common.collect.ImmutableMap; | ||
| import io.quarkus.test.junit.QuarkusIntegrationTest; | ||
| import io.quarkus.test.junit.TestProfile; | ||
| import java.util.Map; | ||
| import org.apache.polaris.service.it.PolarisRestCatalogMinIOIT; | ||
|
|
||
| @QuarkusIntegrationTest | ||
| @TestProfile(value = NoSqlCatalogIT.Profile.class) | ||
| public class NoSqlCatalogIT extends PolarisRestCatalogMinIOIT { | ||
| public static class Profile extends NoSqlTesting.PersistenceInMemoryProfile { | ||
| @Override | ||
| public Map<String, String> getConfigOverrides() { | ||
| return ImmutableMap.<String, String>builder() | ||
| .putAll(super.getConfigOverrides()) | ||
| .put("polaris.storage.aws.access-key", MINIO_ACCESS_KEY) | ||
| .put("polaris.storage.aws.secret-key", MINIO_SECRET_KEY) | ||
| .put("polaris.features.\"SKIP_CREDENTIAL_SUBSCOPING_INDIRECTION\"", "false") | ||
| .build(); | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| /* | ||
| * 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.polaris.service.it.nosql; | ||
|
|
||
| import io.quarkus.test.junit.QuarkusIntegrationTest; | ||
| import io.quarkus.test.junit.TestProfile; | ||
| import org.apache.polaris.service.it.test.PolarisManagementServiceIntegrationTest; | ||
|
|
||
| @QuarkusIntegrationTest | ||
| @TestProfile(value = NoSqlTesting.PersistenceInMemoryProfile.class) | ||
| public class NoSqlManagementServiceIT extends PolarisManagementServiceIntegrationTest {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| /* | ||
| * 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.polaris.service.it.nosql; | ||
|
|
||
| import io.quarkus.test.junit.QuarkusTestProfile; | ||
| import java.util.Map; | ||
|
|
||
| public final class NoSqlTesting { | ||
| private NoSqlTesting() {} | ||
|
|
||
| public static class PersistenceInMemoryProfile implements QuarkusTestProfile { | ||
| @Override | ||
| public Map<String, String> getConfigOverrides() { | ||
| return Map.of( | ||
| "polaris.persistence.type", | ||
| "nosql", | ||
| "polaris.persistence.nosql.backend", | ||
| "InMemory", | ||
| "polaris.persistence.auto-bootstrap-types", | ||
| "nosql"); | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| /* | ||
| * 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.polaris.service.catalog.generic; | ||
|
|
||
| import io.quarkus.test.junit.QuarkusTest; | ||
| import io.quarkus.test.junit.TestProfile; | ||
| import jakarta.inject.Inject; | ||
| import java.util.List; | ||
| import org.apache.polaris.core.persistence.MetaStoreManagerFactory; | ||
| import org.apache.polaris.core.persistence.bootstrap.RootCredentialsSet; | ||
| import org.apache.polaris.service.catalog.Profiles; | ||
|
|
||
| @QuarkusTest | ||
| @TestProfile(Profiles.DefaultNoSqlProfile.class) | ||
| public class PolarisGenericTableCatalogNoSqlInMemTest | ||
| extends AbstractPolarisGenericTableCatalogTest { | ||
|
|
||
| @Inject MetaStoreManagerFactory metaStoreManagerFactory; | ||
|
|
||
| @Override | ||
| protected void bootstrapRealm(String realmName) { | ||
| metaStoreManagerFactory | ||
| .bootstrapRealms( | ||
| List.of(realmName), | ||
| RootCredentialsSet.fromList(List.of(realmName + ",aClientId,aSecret"))) | ||
| .get(realmName); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| /* | ||
| * 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.polaris.service.catalog.iceberg; | ||
|
|
||
| import static org.apache.polaris.service.catalog.Profiles.NOSQL_IN_MEM; | ||
|
|
||
| import com.google.common.collect.ImmutableMap; | ||
| import io.quarkus.test.junit.QuarkusTest; | ||
| import io.quarkus.test.junit.TestProfile; | ||
| import jakarta.inject.Inject; | ||
| import java.util.List; | ||
| import java.util.Map; | ||
| import org.apache.polaris.core.persistence.MetaStoreManagerFactory; | ||
| import org.apache.polaris.core.persistence.bootstrap.RootCredentialsSet; | ||
| import org.apache.polaris.service.admin.PolarisAuthzTestBase; | ||
|
|
||
| @QuarkusTest | ||
| @TestProfile(IcebergCatalogHandlerNoSqlAuthzTest.Profile.class) | ||
| public class IcebergCatalogHandlerNoSqlAuthzTest extends AbstractIcebergCatalogHandlerAuthzTest { | ||
|
|
||
| public static class Profile extends PolarisAuthzTestBase.Profile { | ||
| @Override | ||
| public Map<String, String> getConfigOverrides() { | ||
| return ImmutableMap.<String, String>builder() | ||
| .putAll(super.getConfigOverrides()) | ||
| .putAll(NOSQL_IN_MEM) | ||
| .build(); | ||
| } | ||
| } | ||
|
|
||
| @Inject MetaStoreManagerFactory metaStoreManagerFactory; | ||
|
|
||
| @Override | ||
| protected void bootstrapRealm(String realmIdentifier) { | ||
| metaStoreManagerFactory.bootstrapRealms(List.of(realmIdentifier), RootCredentialsSet.EMPTY); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this config?