-
Notifications
You must be signed in to change notification settings - Fork 370
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
[core] Moved namespaces and computes to database #3446
[core] Moved namespaces and computes to database #3446
Conversation
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.
looks good so far. if I get some code walkthrough will be helpful.
@@ -0,0 +1,203 @@ | |||
#!/usr/bin/env python |
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.
how frequently does the sync warehouse happen? Is this script responsible for deleting VW which has gone away?
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.
Please do downgrade test before merging.
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.
Nice work! Taking shape, few review comments to address.
|
||
response[interface] = namespaces | ||
response['status'] = 0 | ||
|
||
return JsonResponse(response) | ||
|
||
|
||
@api_error_handler | ||
def get_context_computes(request, interface): |
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.
Update docstring
desktop/core/src/desktop/management/commands/sync_warehouses.py
Outdated
Show resolved
Hide resolved
@@ -1800,7 +1800,7 @@ def get_config(self): | |||
], | |||
'default_sql_interpreter': default_sql_interpreter, | |||
'cluster_type': self.cluster_type, | |||
'has_computes': self.cluster_type in ('altus', 'snowball'), # or any grouped engine connectors | |||
'has_computes': self.cluster_type in ('cdw', 'altus', 'snowball'), # or any grouped engine connectors |
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.
Let's remove altus and snowball? They are not used anywhere right?
@JohanAhlen Any idea?
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.
I am thinking of creating a separate commit to remove the altus/snowball related code.
f81856f
to
074dae5
Compare
Done the downgrade test. Rollback worked fine. |
7a1c082
to
3ea8782
Compare
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.
Looks good
3ea8782
to
7b326ed
Compare
3c9a591
to
acaeb5f
Compare
The existing implementation was connecting to external Altus and DWX api's to fetch the available computes. This commit changes that by moving the cluster config to database. Two new tables have been added (a) `beeswax_namespace` to hold config for a namespace/dialect (b) `beeswax_compute` to hold configs for individual compute clusters linked to the namespaces. This change currently support hive and impala clusters. There is also a service-discovery component that keeps the list of namespaces and computes updated in the corresponding tables. `sync_warehouses.py` performs the service discovery in the CDW environ by talking to kubernetes api's. It creates one Hive and one Impala namespace and one compute for each virtual warehouse. The command is supposed to run every minute and keep the list of warehouses updated. There are related changes and fixes to the rest of the code to support the query execution on different computes. Change-Id: Ifd8dbc8d716dfe2000fbfa8121e39f2610051fa1
acaeb5f
to
3594a73
Compare
The existing implementation was connecting to external Altus and DWX
api's to fetch the available computes. This commit changes that by
moving the cluster config to database. Two new tables have been added
(a)
beeswax_namespace
to hold config for a namespace/dialect(b)
beeswax_compute
to hold configs for individual compute clusterslinked to the namespaces.
This change currently support hive and impala clusters.
There is also a service-discovery component that keeps the list of
namespaces and computes updated in the corresponding tables.
sync_warehouses.py
performs the service discovery in the CDW environby talking to kubernetes api's. It creates one Hive and one Impala
namespace and one compute for each virtual warehouse. The command is
supposed to run every minute and keep the list of warehouses updated.
There are related changes and fixes to the rest of the code to support
the query execution on different computes.
Change-Id: Ifd8dbc8d716dfe2000fbfa8121e39f2610051fa1