-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[core] Moved namespaces and computes to database
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
- Loading branch information
1 parent
a51f01f
commit 3594a73
Showing
18 changed files
with
508 additions
and
139 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
apps/beeswax/src/beeswax/migrations/0003_compute_namespace.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Generated by Django 3.2.16 on 2023-09-07 14:30 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('beeswax', '0002_auto_20200320_0746'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Namespace', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('name', models.CharField(default='', max_length=255)), | ||
('description', models.TextField(default='')), | ||
('dialect', models.CharField(db_index=True, help_text='Type of namespace, e.g. hive, mysql... ', max_length=32)), | ||
('interface', models.CharField(db_index=True, default='sqlalchemy', help_text='Type of interface, e.g. sqlalchemy, hiveserver2... ', max_length=32)), | ||
('external_id', models.CharField(db_index=True, max_length=255, null=True)), | ||
('last_modified', models.DateTimeField(auto_now=True, db_index=True, verbose_name='Time last modified')), | ||
], | ||
options={ | ||
'verbose_name': 'namespace', | ||
'verbose_name_plural': 'namespaces', | ||
'unique_together': {('name',)}, | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name='Compute', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('name', models.CharField(default='', max_length=255)), | ||
('description', models.TextField(default='')), | ||
('dialect', models.CharField(db_index=True, help_text='Type of compute, e.g. hive, impala... ', max_length=32)), | ||
('interface', models.CharField(db_index=True, default='sqlalchemy', help_text='Type of interface, e.g. sqlalchemy, hiveserver2... ', max_length=32)), | ||
('is_ready', models.BooleanField(default=True)), | ||
('external_id', models.CharField(db_index=True, max_length=255, null=True)), | ||
('ldap_groups_json', models.TextField(default='[]')), | ||
('settings', models.TextField(default='{}')), | ||
('last_modified', models.DateTimeField(auto_now=True, db_index=True, verbose_name='Time last modified')), | ||
('namespace', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='beeswax.namespace')), | ||
], | ||
options={ | ||
'verbose_name': 'compute', | ||
'verbose_name_plural': 'computes', | ||
'unique_together': {('name',)}, | ||
}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.