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

Support YDB in YQL Generic Provider (YQv1) #2300

Merged
merged 4 commits into from
Mar 1, 2024

Conversation

vitalyisaev2
Copy link
Member

Changelog entry

  • Support YDB in YQL Generic Provider (for YQv1 only)
  • Add --token-accessor-endpoint flag to dqrun

Changelog category

  • New feature

@vitalyisaev2 vitalyisaev2 requested review from a team as code owners February 28, 2024 08:39
Copy link

github-actions bot commented Feb 28, 2024

2024-02-28 08:42:39 UTC Pre-commit check for ee0a25d has started.
2024-02-28 08:42:42 UTC Build linux-x86_64-release-cmake14 is running...
2024-02-28 08:50:31 UTC Check cancelled

Copy link

github-actions bot commented Feb 28, 2024

2024-02-28 08:42:40 UTC Pre-commit check for ee0a25d has started.
2024-02-28 08:42:43 UTC Build linux-x86_64-relwithdebinfo is running...
2024-02-28 08:50:31 UTC Check cancelled

Copy link

github-actions bot commented Feb 28, 2024

2024-02-28 08:42:48 UTC Pre-commit check for ee0a25d has started.
2024-02-28 08:42:50 UTC Build linux-x86_64-release-asan is running...
2024-02-28 08:50:32 UTC Check cancelled

Copy link

github-actions bot commented Feb 28, 2024

2024-02-28 08:51:38 UTC Pre-commit check for 820ba56 has started.
2024-02-28 08:51:39 UTC Build linux-x86_64-release-cmake14 is running...
🟢 2024-02-28 09:15:41 UTC Build successful.

Copy link

github-actions bot commented Feb 28, 2024

2024-02-28 08:51:38 UTC Pre-commit check for 820ba56 has started.
2024-02-28 08:51:40 UTC Build linux-x86_64-release-asan is running...
🟢 2024-02-28 09:19:47 UTC Build successful.
2024-02-28 09:20:02 UTC Tests are running...
🔴 2024-02-28 09:40:02 UTC Test run completed, no test results found for commit 8d315c6. Please check build logs.
2024-02-28 09:40:06 UTC Check cancelled

Copy link

github-actions bot commented Feb 28, 2024

2024-02-28 08:51:39 UTC Pre-commit check for 820ba56 has started.
2024-02-28 08:51:40 UTC Build linux-x86_64-relwithdebinfo is running...
🟢 2024-02-28 09:21:16 UTC Build successful.
2024-02-28 09:21:29 UTC Tests are running...
🔴 2024-02-28 09:40:06 UTC Test run completed, no test results found for commit 8d315c6. Please check build logs.
2024-02-28 09:40:10 UTC Check cancelled

Copy link

github-actions bot commented Feb 28, 2024

2024-02-28 09:44:35 UTC Pre-commit check for e5cf83f has started.
2024-02-28 09:44:37 UTC Build linux-x86_64-relwithdebinfo is running...
🟢 2024-02-28 09:46:04 UTC Build successful.
2024-02-28 09:46:17 UTC Tests are running...
🔴 2024-02-28 11:31:00 UTC Some tests failed, follow the links below.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
67878 56949 0 23 10883 23

Copy link

github-actions bot commented Feb 28, 2024

2024-02-28 09:44:52 UTC Pre-commit check for e5cf83f has started.
2024-02-28 09:44:54 UTC Build linux-x86_64-release-cmake14 is running...
🟢 2024-02-28 09:46:20 UTC Build successful.

Copy link

github-actions bot commented Feb 28, 2024

2024-02-28 09:45:06 UTC Pre-commit check for e5cf83f has started.
2024-02-28 09:45:09 UTC Build linux-x86_64-release-asan is running...
🟢 2024-02-28 09:46:36 UTC Build successful.
2024-02-28 09:46:47 UTC Tests are running...
🔴 2024-02-28 11:27:39 UTC Some tests failed, follow the links below.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
14879 14726 0 39 84 30

if (db.endpoint())
clusterCfg->SetEndpoint(db.endpoint());
clusterCfg->SetSecure(db.secure());
clusterCfg->SetAddBearerToToken(common.GetUseBearerForYdb());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Bearer - важная тема. хорошо бы ее тоже запилить. это нужно для работы внутри Я не с помощью OAuth токена, а с помощью IAM токена

Copy link
Member Author

Choose a reason for hiding this comment

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

Ты имеешь в виду, добавить опцию AddBearerToToken вот сюда https://github.com/ydb-platform/ydb/blob/main/ydb/library/yql/providers/common/proto/gateways_config.proto#L547-L590, чтобы индивидуально указывать каждому кластеру?

Сейчас при ресолвинге безусловно true. Это неправильно? https://github.com/ydb-platform/ydb/blob/main/ydb/library/yql/providers/generic/provider/yql_generic_settings.cpp#L52

Copy link
Collaborator

Choose a reason for hiding this comment

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

пусть будет true, нормуль

Copy link
Member Author

@vitalyisaev2 vitalyisaev2 Feb 29, 2024

Choose a reason for hiding this comment

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

Ещё раз хочу по пунктам проговорить, что надо делать с bearer, потому что логика весьма запутанная и есть разные контексты применения bearer.

Поход в MDB API, в YDB CP (за ресолвингом)

Bearer всегда true. Так всё и остаётся.

Поход в YDB CP (за метаданными/данными)

Сейчас Bearer всегда false. Надо:

  1. Добавить в TGenericClusterConfig поле AddBearerToToken.
  2. Устанавливать значение из этого поля в YQv1 в clusters_from_connections.cpp, брать его из конфига YQ.
  3. Устанавливать значение из этого поля в YQv2 в external source factory, и оттуда прокидывать в провадйер через TGenericProvider::AddCluster. Это означает, что AddBearerToToken просочится в DSL (как минимум в параметры CREATE EXTERNAL DATA SOURCE для YDB).
  4. В конфигах YQ типа этого поменять true на false.

Всё верно?

Copy link
Collaborator

Choose a reason for hiding this comment

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

вроде верно. это доп флаг для аутентификации во внешней системе

@@ -327,9 +333,11 @@ class TDatabaseResolver: public TActor<TDatabaseResolver>
if (!isDedicatedDb && ret.Endpoint.StartsWith("ydb.")) {
// Replace "ydb." -> "yds."
ret.Endpoint[2] = 's';
ret.Host[2] = 's';
Copy link
Collaborator

Choose a reason for hiding this comment

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

избыточность. нет смысл заменить endpoint на два поля host + port ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Такие мысли были, но думаю, что точно не в этом ревью, так как это изменение затронет много провайдеров в yql.

Copy link

github-actions bot commented Feb 28, 2024

2024-02-28 13:30:41 UTC Pre-commit check for db2ebe9 has started.
2024-02-28 13:30:44 UTC Build linux-x86_64-release-cmake14 is running...
🟢 2024-02-28 14:01:02 UTC Build successful.

Copy link

github-actions bot commented Feb 28, 2024

2024-02-28 13:30:45 UTC Pre-commit check for db2ebe9 has started.
2024-02-28 13:30:48 UTC Build linux-x86_64-relwithdebinfo is running...
🟢 2024-02-28 14:03:18 UTC Build successful.
2024-02-28 14:03:34 UTC Tests are running...
🔴 2024-02-28 15:50:40 UTC Some tests failed, follow the links below.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
68017 57097 0 11 10889 20

Copy link

github-actions bot commented Feb 28, 2024

2024-02-28 13:30:59 UTC Pre-commit check for db2ebe9 has started.
2024-02-28 13:31:02 UTC Build linux-x86_64-release-asan is running...
🟢 2024-02-28 14:03:53 UTC Build successful.
2024-02-28 14:04:06 UTC Tests are running...
🔴 2024-02-28 15:47:24 UTC Some tests failed, follow the links below.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
14880 14747 0 24 80 29

Copy link

github-actions bot commented Feb 29, 2024

2024-02-29 10:47:31 UTC Pre-commit check for 65ae0d6 has started.
2024-02-29 10:47:33 UTC Build linux-x86_64-release-cmake14 is running...
🟢 2024-02-29 11:21:47 UTC Build successful.

Copy link

github-actions bot commented Feb 29, 2024

2024-02-29 10:47:37 UTC Pre-commit check for 65ae0d6 has started.
2024-02-29 10:47:39 UTC Build linux-x86_64-relwithdebinfo is running...
🟢 2024-02-29 11:20:37 UTC Build successful.
2024-02-29 11:20:49 UTC Tests are running...
🔴 2024-02-29 11:24:24 UTC Test run completed, no test results found for commit 3fc03a7. Please check build logs.
2024-02-29 11:24:27 UTC Check cancelled

Copy link

github-actions bot commented Feb 29, 2024

2024-02-29 10:48:13 UTC Pre-commit check for 65ae0d6 has started.
2024-02-29 10:48:16 UTC Build linux-x86_64-release-asan is running...
2024-02-29 11:24:23 UTC Check cancelled

uzhastik
uzhastik previously approved these changes Feb 29, 2024
Copy link

github-actions bot commented Feb 29, 2024

2024-02-29 11:27:35 UTC Pre-commit check for b041167 has started.
2024-02-29 11:27:38 UTC Build linux-x86_64-release-asan is running...
🟢 2024-02-29 11:30:47 UTC Build successful.
2024-02-29 11:31:00 UTC Tests are running...
🔴 2024-02-29 13:18:49 UTC Some tests failed, follow the links below.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
14890 14744 0 30 86 30

Copy link

github-actions bot commented Feb 29, 2024

2024-02-29 11:28:09 UTC Pre-commit check for b041167 has started.
2024-02-29 11:28:11 UTC Build linux-x86_64-release-cmake14 is running...
🟢 2024-02-29 11:30:13 UTC Build successful.

Copy link

github-actions bot commented Feb 29, 2024

2024-02-29 11:28:10 UTC Pre-commit check for b041167 has started.
2024-02-29 11:28:12 UTC Build linux-x86_64-relwithdebinfo is running...
🟢 2024-02-29 11:30:09 UTC Build successful.
2024-02-29 11:30:23 UTC Tests are running...
🔴 2024-02-29 13:14:17 UTC Some tests failed, follow the links below.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
68024 57103 0 10 10890 21

Copy link

github-actions bot commented Mar 1, 2024

2024-03-01 09:40:26 UTC Pre-commit check for 708cdf0 has started.
2024-03-01 09:40:28 UTC Build linux-x86_64-release-asan is running...
🟢 2024-03-01 10:14:41 UTC Build successful.
2024-03-01 10:14:52 UTC Tests are running...
🔴 2024-03-01 12:02:47 UTC Some tests failed, follow the links below.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
14894 14744 0 38 91 21

Copy link

github-actions bot commented Mar 1, 2024

2024-03-01 09:40:35 UTC Pre-commit check for 708cdf0 has started.
2024-03-01 09:40:36 UTC Build linux-x86_64-relwithdebinfo is running...
🟢 2024-03-01 10:11:34 UTC Build successful.
2024-03-01 10:11:44 UTC Tests are running...
🔴 2024-03-01 11:56:31 UTC Some tests failed, follow the links below.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
68046 57113 0 6 10901 26

Copy link

github-actions bot commented Mar 1, 2024

2024-03-01 09:41:57 UTC Pre-commit check for 708cdf0 has started.
2024-03-01 09:41:58 UTC Build linux-x86_64-release-cmake14 is running...
🟢 2024-03-01 10:14:30 UTC Build successful.

@vitalyisaev2 vitalyisaev2 merged commit fdb5fe4 into ydb-platform:main Mar 1, 2024
3 of 5 checks passed
vitalyisaev2 added a commit to vitalyisaev2/ydb that referenced this pull request Mar 18, 2024
* Support YDB in YQL Generic Provider (for YQv1 only)
* Add `--token-accessor-endpoint` flag to dqrun
* Drop some outdated tests
@vitalyisaev2 vitalyisaev2 mentioned this pull request Mar 18, 2024
@shnikd shnikd mentioned this pull request Mar 26, 2024
EgorkaZ pushed a commit to EgorkaZ/ydb that referenced this pull request Apr 5, 2024
* Support YDB in YQL Generic Provider (for YQv1 only)
* Add `--token-accessor-endpoint` flag to dqrun
* Drop some outdated tests
EgorkaZ pushed a commit to EgorkaZ/ydb that referenced this pull request Apr 8, 2024
* Support YDB in YQL Generic Provider (for YQv1 only)
* Add `--token-accessor-endpoint` flag to dqrun
* Drop some outdated tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants