diff --git a/Dockerfile b/Dockerfile index 3f012904a..e1562bf5a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -110,7 +110,6 @@ FROM base AS build_base RUN < Status: status: Status """ - app_log.debug("GET STATUS") - app_log.debug(f"use_internal_funcs: {self.use_internal_funcs}") - if self.use_internal_funcs: from covalent_dispatcher._service.app import get_result @@ -171,7 +168,6 @@ def trigger(self) -> None: ) status = self._get_status() - app_log.debug(f"STATUS: {status}") if status == Result.NEW_OBJ or status is None: # To continue the pending dispatch diff --git a/covalent_dispatcher/_triggers_app/__init__.py b/covalent_dispatcher/_triggers_app/__init__.py index 435979579..a5b66619e 100644 --- a/covalent_dispatcher/_triggers_app/__init__.py +++ b/covalent_dispatcher/_triggers_app/__init__.py @@ -16,3 +16,4 @@ from .app import router as triggers_router # nopycln: import from .app import triggers_only_app # nopycln: import +from .app import trigger_only_router diff --git a/covalent_dispatcher/_triggers_app/app.py b/covalent_dispatcher/_triggers_app/app.py index 6cb6ed8aa..4a4c8546d 100644 --- a/covalent_dispatcher/_triggers_app/app.py +++ b/covalent_dispatcher/_triggers_app/app.py @@ -33,6 +33,7 @@ log_stack_info = logger.log_stack_info router = APIRouter() +trigger_only_router = APIRouter() triggers_only_app = FastAPI() active_triggers = {} @@ -76,7 +77,7 @@ def get_threadpool(): return ThreadPoolExecutor() -@router.get("/triggers/healthcheck") +@trigger_only_router.get("/triggers/healthcheck") async def healthcheck(request: Request): return {"status": "ok"} @@ -140,3 +141,4 @@ async def stop_observe(request: Request): triggers_only_app.include_router(router, prefix="/api", tags=["Triggers"]) +triggers_only_app.include_router(trigger_only_router, prefix="/api", tags=["Triggers"]) diff --git a/covalent_ui/app.py b/covalent_ui/app.py index 0ec52ed14..aa2c830a5 100644 --- a/covalent_ui/app.py +++ b/covalent_ui/app.py @@ -58,7 +58,6 @@ def get_home(request: Request, rest_of_path: str): ) fastapi_app.mount("/", socketio_app) - if __name__ == "__main__": ap = argparse.ArgumentParser() @@ -116,7 +115,10 @@ def get_home(request: Request, rest_of_path: str): app_name = "app:fastapi_app" if args.triggers_only: + from covalent_dispatcher._triggers_app import trigger_only_router # nopycln: import + app_name = "app:triggers_only_app" + fastapi_app.include_router(trigger_only_router, prefix="/api", tags=["Triggers"]) elif args.no_triggers: import covalent_dispatcher._triggers_app.app as tr_app diff --git a/tests/covalent_tests/triggers/database_trigger_test.py b/tests/covalent_tests/triggers/database_trigger_test.py index bfab6603b..09d749956 100644 --- a/tests/covalent_tests/triggers/database_trigger_test.py +++ b/tests/covalent_tests/triggers/database_trigger_test.py @@ -2,22 +2,17 @@ # # This file is part of Covalent. # -# Licensed under the GNU Affero General Public License 3.0 (the "License"). -# A copy of the License may be obtained with this software package or at +# Licensed under the Apache License 2.0 (the "License"). A copy of the +# License may be obtained with this software package or at # -# https://www.gnu.org/licenses/agpl-3.0.en.html +# https://www.apache.org/licenses/LICENSE-2.0 # -# Use of this file is prohibited except in compliance with the License. Any -# modifications or derivative works of this file must retain this copyright -# notice, and modified files must contain a notice indicating that they have -# been altered from the originals. -# -# Covalent is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the License for more details. -# -# Relief from the License may be granted by purchasing a commercial license. - +# Use of this file is prohibited except in compliance with the License. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. import pytest