diff --git a/main/lib/idds/orm/base/alembic/versions/6ca0e5e466eb_update_message_null_constraints.py b/main/lib/idds/orm/base/alembic/versions/6ca0e5e466eb_update_message_null_constraints.py new file mode 100644 index 00000000..b477aa3e --- /dev/null +++ b/main/lib/idds/orm/base/alembic/versions/6ca0e5e466eb_update_message_null_constraints.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0OA +# +# Authors: +# - Wen Guan, , 2023 + +"""update message null constraints + +Revision ID: 6ca0e5e466eb +Revises: 5e0aa2aa1fa3 +Create Date: 2023-04-25 16:58:29.975397+00:00 + +""" +from alembic import op +from alembic import context +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '6ca0e5e466eb' +down_revision = '5e0aa2aa1fa3' +branch_labels = None +depends_on = None + + +def upgrade() -> None: + if context.get_context().dialect.name in ['oracle', 'mysql', 'postgresql']: + schema = context.get_context().version_table_schema if context.get_context().version_table_schema else '' + op.alter_column('messages', sa.Column('request_id'), nullable=True, schema=schema) + op.alter_column('messages', sa.Column('transform_id'), nullable=True, schema=schema) + op.alter_column('messages', sa.Column('processing_id'), nullable=True, schema=schema) + + +def downgrade() -> None: + if context.get_context().dialect.name in ['oracle', 'mysql', 'postgresql']: + schema = context.get_context().version_table_schema if context.get_context().version_table_schema else '' + op.alter_column('messages', sa.Column('request_id'), nullable=False, schema=schema) + op.alter_column('messages', sa.Column('transform_id'), nullable=False, schema=schema) + op.alter_column('messages', sa.Column('processing_id'), nullable=False, schema=schema) diff --git a/main/lib/idds/orm/base/models.py b/main/lib/idds/orm/base/models.py index 85800f33..ed0c2539 100644 --- a/main/lib/idds/orm/base/models.py +++ b/main/lib/idds/orm/base/models.py @@ -705,9 +705,9 @@ class Message(BASE, ModelBase): locking = Column(EnumWithValue(MessageLocking), nullable=False) source = Column(EnumWithValue(MessageSource), nullable=False) destination = Column(EnumWithValue(MessageDestination), nullable=False) - request_id = Column(BigInteger().with_variant(Integer, "sqlite"), nullable=False) + request_id = Column(BigInteger().with_variant(Integer, "sqlite")) workload_id = Column(Integer()) - transform_id = Column(Integer(), nullable=False) + transform_id = Column(Integer()) processing_id = Column(Integer()) num_contents = Column(Integer()) retries = Column(Integer(), default=0) diff --git a/main/lib/idds/tests/core_tests.py b/main/lib/idds/tests/core_tests.py index b9d42530..d9dd89c2 100644 --- a/main/lib/idds/tests/core_tests.py +++ b/main/lib/idds/tests/core_tests.py @@ -171,7 +171,7 @@ def print_workflow_template(workflow, layers=0): # reqs = get_requests(request_id=381520, with_request=True, with_detail=False, with_metadata=True) # reqs = get_requests(request_id=28182323, with_request=True, with_detail=False, with_metadata=True) # reqs = get_requests(request_id=385554, with_request=True, with_detail=False, with_metadata=True) -reqs = get_requests(request_id=458999, with_request=True, with_detail=False, with_metadata=True) +reqs = get_requests(request_id=479187, with_request=True, with_detail=False, with_metadata=True) for req in reqs: # print(req['request_id']) # print(req) diff --git a/main/lib/idds/tests/test_migrate_requests.py b/main/lib/idds/tests/test_migrate_requests.py index 489eb6ed..6c62cf01 100644 --- a/main/lib/idds/tests/test_migrate_requests.py +++ b/main/lib/idds/tests/test_migrate_requests.py @@ -66,10 +66,10 @@ def migrate(): for old_request_id in old_request_ids: # noqa E115 # doma 183 reqs = cm1.get_requests(request_id=old_request_id, with_metadata=True) - cm2 = ClientManager(host=dev_host) + # cm2 = ClientManager(host=dev_host) # cm2 = ClientManager(host=doma_host) # cm2 = ClientManager(host=atlas_host) - # cm2 = ClientManager(host=slac_k8s_dev_host) + cm2 = ClientManager(host=slac_k8s_dev_host) # cm2 = ClientManager(host=cern_k8s_dev_host) # print(reqs) diff --git a/monitor/data/conf.js b/monitor/data/conf.js index 014a6e97..89f5608d 100644 --- a/monitor/data/conf.js +++ b/monitor/data/conf.js @@ -1,9 +1,9 @@ var appConfig = { - 'iddsAPI_request': "https://lxplus807.cern.ch:443/idds/monitor_request/null/null", - 'iddsAPI_transform': "https://lxplus807.cern.ch:443/idds/monitor_transform/null/null", - 'iddsAPI_processing': "https://lxplus807.cern.ch:443/idds/monitor_processing/null/null", - 'iddsAPI_request_detail': "https://lxplus807.cern.ch:443/idds/monitor/null/null/true/false/false", - 'iddsAPI_transform_detail': "https://lxplus807.cern.ch:443/idds/monitor/null/null/false/true/false", - 'iddsAPI_processing_detail': "https://lxplus807.cern.ch:443/idds/monitor/null/null/false/false/true" + 'iddsAPI_request': "https://lxplus810.cern.ch:443/idds/monitor_request/null/null", + 'iddsAPI_transform': "https://lxplus810.cern.ch:443/idds/monitor_transform/null/null", + 'iddsAPI_processing': "https://lxplus810.cern.ch:443/idds/monitor_processing/null/null", + 'iddsAPI_request_detail': "https://lxplus810.cern.ch:443/idds/monitor/null/null/true/false/false", + 'iddsAPI_transform_detail': "https://lxplus810.cern.ch:443/idds/monitor/null/null/false/true/false", + 'iddsAPI_processing_detail': "https://lxplus810.cern.ch:443/idds/monitor/null/null/false/false/true" }