Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add longhorn/types #1015

Merged
merged 2 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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-20240411093823-b8862efb8e03
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-20240417064442-e7df610ea802
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 @@ -74,6 +74,8 @@ github.com/longhorn/go-iscsi-helper v0.0.0-20240329081212-26b6406b3b2b h1:Cp8eBy
github.com/longhorn/go-iscsi-helper v0.0.0-20240329081212-26b6406b3b2b/go.mod h1:tynRAH865oFPQQw4rY4wgL7a/JEYQsAhy+DXglx51eI=
github.com/longhorn/sparse-tools v0.0.0-20240228120902-ce8c4c2e71ca h1:dECamLpXIlL7GRmiruGseb5xO6hGAWyu2xYm9D46mb8=
github.com/longhorn/sparse-tools v0.0.0-20240228120902-ce8c4c2e71ca/go.mod h1:pvlUkVwRGojXhcTkkzksOe4i7GVk59P2PbJjHIB2Yj0=
github.com/longhorn/types v0.0.0-20240417064442-e7df610ea802 h1:evjIqn8Ta4toYsdcfvUBXOyV64ZEo72CYe+Vfd+3STQ=
github.com/longhorn/types v0.0.0-20240417064442-e7df610ea802/go.mod h1:pqT+7B8T+nkyUZYe8tL3CwPDCHjkbe3mHUDY5ntJFyQ=
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I=
github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
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