Skip to content
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

refactor: Use named collections for dictionaries #554

Closed
wants to merge 1 commit into from

Conversation

bmtcril
Copy link
Contributor

@bmtcril bmtcril commented Jan 4, 2024

This allows us to change admin passwords and keep credentials out of the migrations.

Draft for now, until I have a chance to test against CH Cloud and Altinity, but I want to see what CI does.

@bmtcril bmtcril force-pushed the bmtcril/named_collections branch from eae2eab to 0a450e0 Compare January 4, 2024 21:11
Copy link
Contributor

@Ian2012 Ian2012 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a comment on the new setting

Comment on lines 241 to 261
(
"CLICKHOUSE_EXTRA_NAMED_COLLECTION_XML_CONFIG",
"""
<local_ch_xapi>
<host overridable="false">localhost</host>
<port overridable="false">{{ CLICKHOUSE_INTERNAL_NATIVE_PORT }}</port>
<database overridable="false">{{ ASPECTS_XAPI_DATABASE }}</database>
<user overridable="false">{{ ASPECTS_CLICKHOUSE_REPORT_USER }}</user>
<password overridable="false">{{ ASPECTS_CLICKHOUSE_REPORT_PASSWORD }}</password>
<secure overridable="false">{% if CLICKHOUSE_SECURE_CONNECTION %}1{% else %}0{% endif %}</secure>
</local_ch_xapi>
<local_ch_event_sink>
<host overridable="false">localhost</host>
<port overridable="false">{{ CLICKHOUSE_INTERNAL_NATIVE_PORT }}</port>
<database overridable="false">{{ ASPECTS_EVENT_SINK_DATABASE }}</database>
<user overridable="false">{{ ASPECTS_CLICKHOUSE_REPORT_USER }}</user>
<password overridable="false">{{ ASPECTS_CLICKHOUSE_REPORT_PASSWORD }}</password>
<secure overridable="false">{% if CLICKHOUSE_SECURE_CONNECTION %}1{% else %}0{% endif %}</secure>
</local_ch_event_sink>
"""
),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a too large to be a setting, can we use a patch for it and template it?

Also, as Clickhouse resolves any conflicts we can just override any value here using the patch

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did this to match the other ClickHouse settings (CLICKHOUSE_EXTRA_XML_CONFIG, CLICKHOUSE_EXTRA_USERS_XML_CONFIG) so that they're not being configured in two different ways. I can make all of those patches, but I think that requires people to create a plugin to override them instead of just changing a config value? Just making sure since we would probably need to document the two types of settings clearly to say how to override the different settings.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's also worth noting that CLICKHOUSE_EXTRA_USERS_XML_CONFIG in the current configuration doesn't work on k8s as well. I wasn't able to solve that problem as part of this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a too large configuration to be managed as a setting. I would prefer the patch

This allows us to change admin passwords and keep
credentials out of the migrations.
@bmtcril bmtcril force-pushed the bmtcril/named_collections branch from 85199fb to c3c6ac6 Compare January 10, 2024 21:07
@bmtcril
Copy link
Contributor Author

bmtcril commented Jan 16, 2024

We can't actually use this until CH Cloud supports named collections / 23.11 build. So I'm closing this in favor of the work to get dictionaries into dbt, which would also solve this problem.

@bmtcril bmtcril closed this Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants