diff --git a/Dockerfile b/Dockerfile index 6582377..66f523e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM cloudforet/python-core:1 +FROM cloudforet/python-core:2 ENV PYTHONUNBUFFERED 1 ENV CLOUDONE_PORT 50051 @@ -10,8 +10,7 @@ RUN apt update && apt upgrade -y COPY pkg/*.txt ${PKG_DIR}/ RUN pip install --upgrade pip && \ - pip install --upgrade --use-deprecated=legacy-resolver -r ${PKG_DIR}/pip_requirements.txt && \ - pip install --upgrade spaceone-api + pip install --upgrade -r ${PKG_DIR}/pip_requirements.txt COPY src ${SRC_DIR} @@ -22,4 +21,4 @@ RUN python3 setup.py install && \ EXPOSE ${CLOUDONE_PORT} ENTRYPOINT ["spaceone"] -CMD ["grpc", "cloudforet.cost_analysis"] +CMD ["run", "grpc-server", "cloudforet.cost_analysis"] diff --git a/src/cloudforet/cost_analysis/conf/proto_conf.py b/src/cloudforet/cost_analysis/conf/proto_conf.py deleted file mode 100644 index ae53429..0000000 --- a/src/cloudforet/cost_analysis/conf/proto_conf.py +++ /dev/null @@ -1,5 +0,0 @@ -PROTO = { - 'cloudforet.cost_analysis.interface.grpc.plugin.data_source': ['DataSource'], - 'cloudforet.cost_analysis.interface.grpc.plugin.job': ['Job'], - 'cloudforet.cost_analysis.interface.grpc.plugin.cost': ['Cost'], -} diff --git a/src/cloudforet/cost_analysis/interface/grpc/__init__.py b/src/cloudforet/cost_analysis/interface/grpc/__init__.py index e69de29..ac1e2f0 100644 --- a/src/cloudforet/cost_analysis/interface/grpc/__init__.py +++ b/src/cloudforet/cost_analysis/interface/grpc/__init__.py @@ -0,0 +1,11 @@ +from spaceone.core.pygrpc.server import GRPCServer +from .cost import Cost +from .job import Job +from .data_source import DataSource + +__all__ = ["app"] + +app = GRPCServer() +app.add_service(DataSource) +app.add_service(Job) +app.add_service(Cost) diff --git a/src/cloudforet/cost_analysis/interface/grpc/plugin/cost.py b/src/cloudforet/cost_analysis/interface/grpc/cost.py similarity index 100% rename from src/cloudforet/cost_analysis/interface/grpc/plugin/cost.py rename to src/cloudforet/cost_analysis/interface/grpc/cost.py diff --git a/src/cloudforet/cost_analysis/interface/grpc/plugin/data_source.py b/src/cloudforet/cost_analysis/interface/grpc/data_source.py similarity index 100% rename from src/cloudforet/cost_analysis/interface/grpc/plugin/data_source.py rename to src/cloudforet/cost_analysis/interface/grpc/data_source.py diff --git a/src/cloudforet/cost_analysis/interface/grpc/plugin/job.py b/src/cloudforet/cost_analysis/interface/grpc/job.py similarity index 100% rename from src/cloudforet/cost_analysis/interface/grpc/plugin/job.py rename to src/cloudforet/cost_analysis/interface/grpc/job.py diff --git a/src/cloudforet/cost_analysis/interface/grpc/plugin/__init__.py b/src/cloudforet/cost_analysis/interface/grpc/plugin/__init__.py deleted file mode 100644 index e69de29..0000000