Skip to content

Commit

Permalink
fix(api): PENG-2456 modify the alembic revision 99c3877d0f10.
Browse files Browse the repository at this point in the history
This commit modifies the table *job_submission_metrics* in a way that all the int32
columns are bumped to int64 columns.
  • Loading branch information
matheushent committed Dec 19, 2024
1 parent 1b3f28e commit 55fd69a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ def upgrade():
sa.Column("cpu_frequency", sa.Float(), nullable=False),
sa.Column("cpu_time", sa.Float(), nullable=False),
sa.Column("cpu_utilization", sa.Float(), nullable=False),
sa.Column("gpu_memory", sa.Integer(), nullable=False),
sa.Column("gpu_memory", sa.BigInteger(), nullable=False),
sa.Column("gpu_utilization", sa.Float(), nullable=False),
sa.Column("page_faults", sa.Integer(), nullable=False),
sa.Column("memory_rss", sa.Integer(), nullable=False),
sa.Column("memory_virtual", sa.Integer(), nullable=False),
sa.Column("disk_read", sa.Integer(), nullable=False),
sa.Column("disk_write", sa.Integer(), nullable=False),
sa.Column("page_faults", sa.BigInteger(), nullable=False),
sa.Column("memory_rss", sa.BigInteger(), nullable=False),
sa.Column("memory_virtual", sa.BigInteger(), nullable=False),
sa.Column("disk_read", sa.BigInteger(), nullable=False),
sa.Column("disk_write", sa.BigInteger(), nullable=False),
sa.PrimaryKeyConstraint("time", "job_submission_id", "node_host", "step", "task"),
sa.ForeignKeyConstraint(["job_submission_id"], ["job_submissions.id"], ondelete="CASCADE"),
)
Expand Down
14 changes: 7 additions & 7 deletions jobbergate-api/jobbergate_api/apps/job_submissions/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from __future__ import annotations
from datetime import datetime, timezone

from sqlalchemy import ARRAY, Dialect, Enum, ForeignKey, Integer, String, Float, Index, PrimaryKeyConstraint
from sqlalchemy import ARRAY, Dialect, Enum, ForeignKey, Integer, String, Float, Index, PrimaryKeyConstraint, BigInteger
from sqlalchemy.orm import Mapped, mapped_column, relationship, selectinload
from sqlalchemy.sql.expression import Select
from sqlalchemy.types import DateTime, TypeDecorator
Expand Down Expand Up @@ -164,13 +164,13 @@ class JobSubmissionMetric(CommonMixin, Base):
cpu_frequency: Mapped[float] = mapped_column(Float, nullable=False)
cpu_time: Mapped[float] = mapped_column(Float, nullable=False)
cpu_utilization: Mapped[float] = mapped_column(Float, nullable=False)
gpu_memory: Mapped[int] = mapped_column(Integer, nullable=False)
gpu_memory: Mapped[int] = mapped_column(BigInteger, nullable=False)
gpu_utilization: Mapped[float] = mapped_column(Float, nullable=False)
page_faults: Mapped[int] = mapped_column(Integer, nullable=False)
memory_rss: Mapped[int] = mapped_column(Integer, nullable=False)
memory_virtual: Mapped[int] = mapped_column(Integer, nullable=False)
disk_read: Mapped[int] = mapped_column(Integer, nullable=False)
disk_write: Mapped[int] = mapped_column(Integer, nullable=False)
page_faults: Mapped[int] = mapped_column(BigInteger, nullable=False)
memory_rss: Mapped[int] = mapped_column(BigInteger, nullable=False)
memory_virtual: Mapped[int] = mapped_column(BigInteger, nullable=False)
disk_read: Mapped[int] = mapped_column(BigInteger, nullable=False)
disk_write: Mapped[int] = mapped_column(BigInteger, nullable=False)

__table_args__ = (
PrimaryKeyConstraint("time", "job_submission_id", "node_host", "step", "task"),
Expand Down

0 comments on commit 55fd69a

Please sign in to comment.