X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=a1%2Frun.py;fp=a1%2Frun.py;h=903fe856a7c6ab6d320186c3b04365148486449c;hb=5ad8f03e1fc7683bb59da31f59edc2f6c0b2372b;hp=0000000000000000000000000000000000000000;hpb=d36a35ba53b3d805cb73eda3d72af946ed977f16;p=ric-plt%2Fa1.git diff --git a/a1/run.py b/a1/run.py new file mode 100644 index 0000000..903fe85 --- /dev/null +++ b/a1/run.py @@ -0,0 +1,40 @@ +# ================================================================================== +# Copyright (c) 2019 Nokia +# Copyright (c) 2018-2019 AT&T Intellectual Property. +# +# 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.0 +# +# 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. +# ================================================================================== +from gevent.pywsgi import WSGIServer +from a1 import get_module_logger, app +from a1 import utils, exceptions +from a1.a1rmr import init_rmr +import sys + + +logger = get_module_logger(__name__) + + +def main(): + """Entrypoint""" + # Fail fast if we don't have a manifest + try: + utils.get_ric_manifest() + except exceptions.MissingManifest: + logger.error("Failing fast: no A1 manifest found!") + sys.exit(1) + + logger.debug("Initializing rmr") + init_rmr() + logger.debug("Starting gevent server") + http_server = WSGIServer(('', 10000), app) + http_server.serve_forever()