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 committed Apr 8, 2024
1 parent 7f74a99 commit 8d5ff45
Show file tree
Hide file tree
Showing 83 changed files with 5,718 additions and 15,385 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.

1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ require (
github.com/longhorn/go-common-libs v0.0.0-20240319112414-b75404dc7fbc
github.com/longhorn/go-iscsi-helper v0.0.0-20240329081212-26b6406b3b2b
github.com/longhorn/sparse-tools v0.0.0-20240228120902-ce8c4c2e71ca
github.com/longhorn/types v0.0.0-00010101000000-000000000000
github.com/moby/moby v24.0.9+incompatible
github.com/pkg/errors v0.9.1
github.com/rancher/go-fibmap v0.0.0-20160418233256-5fc9f8c1ed47
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSu
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0 h1:Px2UA+2RvSSvv+RvJNuUB6n7rs5Wsel4dXLe90Um2n4=
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo=
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/FrankYang0529/types v0.0.0-20240229024041-25f1b5bbec5b h1:C0CctfQZaOs7Ehvv/qCodJwa0RL+4vwM1GqMspXEdTc=
github.com/FrankYang0529/types v0.0.0-20240229024041-25f1b5bbec5b/go.mod h1:mVHVu8eO9amwMUo2IVudjkWrUkar9KrdECxeGOSHOvU=
github.com/aws/aws-sdk-go v1.34.2 h1:9vCknCdTAmmV4ht7lPuda7aJXzllXwEQyCMZKJHjBrM=
github.com/aws/aws-sdk-go v1.34.2/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
Expand Down
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 8d5ff45

Please sign in to comment.