Skip to content

Commit

Permalink
fix(package): move proto dir inside control
Browse files Browse the repository at this point in the history
Fixes: #178

Signed-off-by: Ernesto Puerta <[email protected]>
  • Loading branch information
epuertat committed Aug 11, 2023
1 parent a49e86b commit 4a893d7
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
**
# Exclude everything except:
!control/*.py
!proto/*.proto
!control/proto/*.proto
!pyproject.toml
!pdm.lock
!pdm.toml
Expand Down
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Globals
VERSION="0.0.2"
VERSION="0.0.3"
CEPH_VERSION="17.2.6"
SPDK_VERSION="23.01"
MAINTAINER="Ceph Developers <[email protected]>"
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ LABEL io.ceph.component="$NVMEOF_NAME" \
io.ceph.git.branch="$NVMEOF_GIT_BRANCH" \
io.ceph.git.commit="$NVMEOF_GIT_COMMIT"

ENV PYTHONPATH=$APPDIR/proto:$APPDIR/__pypackages__/$PYTHON_MAJOR.$PYTHON_MINOR/lib
ENV PYTHONPATH=$APPDIR/__pypackages__/$PYTHON_MAJOR.$PYTHON_MINOR/lib

WORKDIR $APPDIR

Expand Down Expand Up @@ -120,7 +120,6 @@ RUN \
pdm "$PDM_INSTALL_CMD" $PDM_INSTALL_FLAGS

COPY . .
RUN pdm run protoc

#------------------------------------------------------------------------------
FROM python-intermediate
Expand Down
4 changes: 2 additions & 2 deletions control/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

from functools import wraps

from proto import gateway_pb2_grpc as pb2_grpc
from proto import gateway_pb2 as pb2
from .proto import gateway_pb2_grpc as pb2_grpc
from .proto import gateway_pb2 as pb2


def argument(*name_or_flags, **kwargs):
Expand Down
4 changes: 2 additions & 2 deletions control/grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import spdk.rpc.nvmf as rpc_nvmf

from google.protobuf import json_format
from proto import gateway_pb2 as pb2
from proto import gateway_pb2_grpc as pb2_grpc
from .proto import gateway_pb2 as pb2
from .proto import gateway_pb2_grpc as pb2_grpc


class GatewayService(pb2_grpc.GatewayServicer):
Expand Down
Empty file added control/proto/__init__.py
Empty file.
File renamed without changes.
4 changes: 2 additions & 2 deletions control/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
import spdk.rpc.client as rpc_client
import spdk.rpc.nvmf as rpc_nvmf

from proto import gateway_pb2 as pb2
from proto import gateway_pb2_grpc as pb2_grpc
from .proto import gateway_pb2 as pb2
from .proto import gateway_pb2_grpc as pb2_grpc
from .state import GatewayState, LocalGatewayState, OmapGatewayState, GatewayStateHandler
from .grpc import GatewayService

Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "pdm.backend"

[project]
name = "ceph-nvmeof"
version = "0.0.2"
version = "0.0.3"
description = "Service to provide Ceph storage over NVMe-oF protocol"
readme = "README.md"
requires-python = "~=3.9"
Expand All @@ -29,7 +29,8 @@ dependencies = [
]

[tool.pdm.scripts]
protoc = {call = "grpc_tools.command:build_package_protos('proto')"}
protoc = {call = "grpc_tools.command:build_package_protos('src.proto')"}
pre_build = {composite = ["protoc"]}

[project.urls]
#homepage = ""
Expand Down

0 comments on commit 4a893d7

Please sign in to comment.