-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Problem: If a user wants to assign a GPU to a QEmu VM he cannot do it. Solution: Implement GPU assignation feature that will be pass-though to QEmu VMs with native performance. * Fix: Solved code quality issues * Fix: Solved compilation issue and fixed gpu logic. * Fix: Solved issue getting already running executions with GPU * Fix: Expose GPU support option in `status/config` endpoint * Fix: Applied some code review suggestions * Add migration * Fix: Allow to use the notify endpoint for GPU instances also. * Fix: Remove migration duplicity. * Fix: Changes DB initialization order to ensure that DB always exists before running the migrations. * Fix: Updated migration to only insert the column if isn't inside. --------- Co-authored-by: Olivier Le Thanh Duong <olivier@lethanh.be>
- Loading branch information
Showing
18 changed files
with
180 additions
and
46 deletions.
There are no files selected for viewing
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
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
38 changes: 38 additions & 0 deletions
38
.../orchestrator/migrations/versions/0002_5c6ae643c69b_add_gpu_column_to_executions_table.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,38 @@ | ||
"""add gpu table | ||
Revision ID: 5c6ae643c69b | ||
Revises: bbb12a12372e | ||
Create Date: 2024-12-09 19:40:19.279735 | ||
""" | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
from sqlalchemy import create_engine | ||
from sqlalchemy.engine import reflection | ||
|
||
from aleph.vm.conf import make_db_url | ||
|
||
revision = "5c6ae643c69b" | ||
down_revision = "bbb12a12372e" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
engine = create_engine(make_db_url()) | ||
inspector = reflection.Inspector.from_engine(engine) | ||
|
||
# The table already exists on most CRNs. | ||
tables = inspector.get_table_names() | ||
if "executions" in tables: | ||
columns = inspector.get_columns("executions") | ||
column_names = [c["name"] for c in columns] | ||
if "gpus" not in column_names: | ||
op.add_column("executions", sa.Column("gpus", sa.JSON(), nullable=True)) | ||
|
||
|
||
def downgrade() -> None: | ||
op.drop_column("executions", "gpus") |
Oops, something went wrong.