Skip to content

Commit

Permalink
feat: remove proto
Browse files Browse the repository at this point in the history
Signed-off-by: PoAn Yang <poan.yang@suse.com>
  • Loading branch information
FrankYang0529 authored and derekbit committed Apr 18, 2024
1 parent f712e9b commit 5195981
Show file tree
Hide file tree
Showing 80 changed files with 5,714 additions and 15,377 deletions.
24 changes: 1 addition & 23 deletions Dockerfile.dapper
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ENV PROTOBUF_VER_PY=4.24.3
ENV PATH /go/bin:$PATH
ENV DAPPER_DOCKER_SOCKET true
ENV DAPPER_ENV TAG REPO DRONE_REPO DRONE_PULL_REQUEST DRONE_COMMIT_REF SKIP_TASKS
ENV DAPPER_OUTPUT bin coverage.out ./integration/rpc/controller ./integration/rpc/replica ./proto
ENV DAPPER_OUTPUT bin coverage.out
ENV DAPPER_RUN_ARGS --privileged --tmpfs /go/src/github.com/longhorn/longhorn-engine/integration/.venv:exec --tmpfs /go/src/github.com/longhorn/longhorn-engine/integration/.tox:exec -v /dev:/host/dev -v /proc:/host/proc
ENV DAPPER_SOURCE /go/src/github.com/longhorn/longhorn-engine
WORKDIR ${DAPPER_SOURCE}
Expand Down Expand Up @@ -73,27 +73,6 @@ ENV GRPC_HEALTH_PROBE_amd64=https://github.com/grpc-ecosystem/grpc-health-probe/
RUN wget ${!GRPC_HEALTH_PROBE} -O /usr/local/bin/grpc_health_probe && \
chmod +x /usr/local/bin/grpc_health_probe

# protoc
ENV PROTOC_amd64=https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VER}/protoc-${PROTOBUF_VER}-linux-x86_64.zip \
PROTOC_arm64=https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VER}/protoc-${PROTOBUF_VER}-linux-aarch_64.zip \
PROTOC_s390x=https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VER}/protoc-${PROTOBUF_VER}-linux-s390_64.zip \
PROTOC=PROTOC_${ARCH}

RUN cd /usr/src && \
wget ${!PROTOC} -O protoc_${ARCH}.zip && \
unzip protoc_${ARCH}.zip -d /usr/local/

# protoc-gen-go
RUN cd /go/src/github.com/ && \
mkdir golang/ && \
cd golang && \
git clone https://github.com/golang/protobuf.git && \
cd protobuf && \
git checkout v1.5.3 && \
cd protoc-gen-go && \
go build && \
cp protoc-gen-go /usr/local/bin

# TODO: use default python3 if SLE upgrade system python version to python3.11
RUN ln -sf /usr/bin/python3.11 /usr/bin/python3 & \
ln -sf /usr/bin/pip3.11 /usr/bin/pip3
Expand Down Expand Up @@ -139,7 +118,6 @@ RUN cd /go/src/github.com/longhorn && \
git clone https://github.com/longhorn/longhorn-instance-manager.git && \
cd longhorn-instance-manager && \
go build -o ./longhorn-instance-manager -tags netgo -ldflags "-linkmode external -extldflags -static" && \
cp -r integration/rpc/ ${DAPPER_SOURCE}/integration/rpc/ && \
install longhorn-instance-manager /usr/local/bin

VOLUME /tmp
Expand Down
4 changes: 2 additions & 2 deletions app/cmd/profiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/urfave/cli"
"google.golang.org/grpc"

"github.com/longhorn/longhorn-engine/proto/ptypes"
"github.com/longhorn/longhorn-engine/pkg/interceptor"
)

const (
Expand Down Expand Up @@ -39,7 +39,7 @@ func getProfilerClient(c *cli.Context) (*profiler.Client, error) {
url := c.GlobalString("url")
volumeName := c.GlobalString("volume-name")
engineInstanceName := c.GlobalString("engine-instance-name")
dialOpts := []grpc.DialOption{ptypes.WithIdentityValidationClientInterceptor(volumeName, engineInstanceName)}
dialOpts := []grpc.DialOption{interceptor.WithIdentityValidationClientInterceptor(volumeName, engineInstanceName)}
return profiler.NewClient(url, volumeName, dialOpts...)
}

Expand Down
36 changes: 0 additions & 36 deletions generate_grpc.sh

This file was deleted.

2 changes: 1 addition & 1 deletion integration/common/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
INSTANCE_MANAGER_REPLICA, INSTANCE_MANAGER_ENGINE,
)

from rpc.imrpc.process_manager_client import ProcessManagerClient
from rpc.process_manager.process_manager_client import ProcessManagerClient


@pytest.fixture()
Expand Down
2 changes: 1 addition & 1 deletion integration/core/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from rpc.controller.controller_client import ControllerClient
from rpc.replica.replica_client import ReplicaClient
from rpc.imrpc.process_manager_client import ProcessManagerClient
from rpc.process_manager.process_manager_client import ProcessManagerClient


@pytest.fixture
Expand Down
2 changes: 1 addition & 1 deletion integration/core/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

from rpc.controller.controller_client import ControllerClient
from rpc.replica.replica_client import ReplicaClient
from rpc.imrpc.process_manager_client import ProcessManagerClient
from rpc.process_manager.process_manager_client import ProcessManagerClient

VOLUME_HEAD = "volume-head"

Expand Down
2 changes: 1 addition & 1 deletion integration/data/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from common.core import get_controller_version_detail


from rpc.imrpc.process_manager_client import ProcessManagerClient
from rpc.process_manager.process_manager_client import ProcessManagerClient
from rpc.replica.replica_client import ReplicaClient
from rpc.controller.controller_client import ControllerClient

Expand Down
2 changes: 1 addition & 1 deletion integration/instance/test_launcher_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

from rpc.controller.controller_client import ControllerClient
from rpc.replica.replica_client import ReplicaClient
from rpc.imrpc.process_manager_client import ProcessManagerClient
from rpc.process_manager.process_manager_client import ProcessManagerClient


def test_start_stop_replicas(pm_client): # NOQA
Expand Down
10 changes: 10 additions & 0 deletions integration/rpc/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import os
import sys


# include current directory to fix relative import in generated grpc files
sys.path.append(
os.path.abspath(
os.path.join(os.path.split(__file__)[0], ".")
)
)
66 changes: 66 additions & 0 deletions integration/rpc/bimrpc/bimrpc_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5195981

Please sign in to comment.