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

In worker Operator #60

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions rest/database/models/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ class Config:
use_enum_values = True


class PieceExecutionMode(str, enum.Enum):
docker = 'docker'
worker = 'worker'

class Config:
use_enum_values = True


class Permission(str, enum.Enum):
owner = 'owner'
read = 'read'
Expand Down
3 changes: 2 additions & 1 deletion rest/database/models/piece_repository.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from database.models.base import Base, BaseDatabaseModel
from sqlalchemy import Column, String, Integer, DateTime, Enum, JSON, ForeignKey
from database.models.enums import RepositorySource
from database.models.enums import RepositorySource, PieceExecutionMode
from sqlalchemy.orm import relationship
from datetime import datetime

Expand All @@ -16,6 +16,7 @@ class PieceRepository(Base, BaseDatabaseModel):
path = Column(String(250), nullable=True)
url = Column(String(250), nullable=True)
version = Column(String(10), nullable=True)
piece_execution_mode = Column(Enum(PieceExecutionMode), nullable=False, default=PieceExecutionMode.docker.value)
dependencies_map = Column(JSON, nullable=True)
compiled_metadata = Column(JSON, nullable=True)
workspace_id = Column(Integer, ForeignKey("workspace.id", ondelete='cascade'), nullable=False)
Expand Down