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 18, 2024
1 parent 834bbbb commit fbd2fb7
Show file tree
Hide file tree
Showing 69 changed files with 96 additions and 14,310 deletions.
41 changes: 2 additions & 39 deletions Dockerfile.dapper
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ ARG DAPPER_HOST_ARCH=amd64
ARG http_proxy
ARG https_proxy
ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH}
ENV PROTOBUF_VER=24.3
ENV PROTOBUF_VER_PY=4.24.3

# Setup environment
ENV PATH /go/bin:$PATH
ENV DAPPER_DOCKER_SOCKET true
ENV DAPPER_ENV TAG REPO DRONE_REPO DRONE_PULL_REQUEST DRONE_COMMIT_REF
ENV DAPPER_OUTPUT bin coverage.out ./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-instance-manager
WORKDIR ${DAPPER_SOURCE}
Expand All @@ -22,13 +20,11 @@ RUN zypper refresh && \
zypper -n --gpg-auto-import-keys ref

# Install packages
# TODO: use default python3 if SLE upgrade system python version to python3.11
RUN zypper -n install cmake wget curl git less file \
python311 python311-pip python311-devel \
libglib-2_0-0 libkmod-devel libnl3-devel linux-glibc-devel pkg-config \
psmisc tox qemu-tools fuse python3-devel git zlib-devel zlib-devel-static \
bash-completion rdma-core-devel libibverbs xsltproc docbook-xsl-stylesheets \
perl-Config-General libaio-devel glibc-devel-static glibc-devel iptables libltdl7 libdevmapper1_03 iproute2 jq unzip docker gcc gcc-c++ && \
perl-Config-General libaio-devel glibc-devel-static glibc-devel iptables libltdl7 libdevmapper1_03 iproute2 jq docker gcc gcc-c++ && \
rm -rf /var/cache/zypp/*

# needed for ${!var} substitution
Expand All @@ -44,39 +40,6 @@ ENV GOLANG_ARCH_amd64=amd64 GOLANG_ARCH_arm64=arm64 GOLANG_ARCH_s390x=s390x GOLA
RUN wget -O - https://storage.googleapis.com/golang/go1.21.3.linux-${!GOLANG_ARCH}.tar.gz | tar -xzf - -C /usr/local
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2

# 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

# python grpc-tools
RUN if [ "${ARCH}" == "s390x" ]; then \
zypper -n in libopenssl-devel && \
GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=True pip3 install grpcio==1.58.0 grpcio_tools==1.58.0 protobuf==${PROTOBUF_VER_PY}; \
else \
pip3 install grpcio==1.58.0 grpcio_tools==1.58.0 protobuf==${PROTOBUF_VER_PY}; \
fi

# Install libqcow to resolve error:
# vendor/github.com/longhorn/longhorn-engine/pkg/qcow/libqcow.go:6:11: fatal error: libqcow.h: No such file or directory
RUN wget -O - https://s3-us-west-1.amazonaws.com/rancher-longhorn/libqcow-alpha-20181117.tar.gz | tar xvzf - -C /usr/src
Expand Down
5 changes: 2 additions & 3 deletions app/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,14 @@ import (
helperutil "github.com/longhorn/go-spdk-helper/pkg/util"
spdk "github.com/longhorn/longhorn-spdk-engine/pkg/spdk"
spdkutil "github.com/longhorn/longhorn-spdk-engine/pkg/util"
spdkrpc "github.com/longhorn/longhorn-spdk-engine/proto/spdkrpc"
rpc "github.com/longhorn/types/pkg/generated/imrpc"
spdkrpc "github.com/longhorn/types/pkg/generated/spdkrpc"

"github.com/longhorn/longhorn-instance-manager/pkg/disk"
"github.com/longhorn/longhorn-instance-manager/pkg/health"
rpc "github.com/longhorn/longhorn-instance-manager/pkg/imrpc"
"github.com/longhorn/longhorn-instance-manager/pkg/instance"
"github.com/longhorn/longhorn-instance-manager/pkg/process"
"github.com/longhorn/longhorn-instance-manager/pkg/proxy"

"github.com/longhorn/longhorn-instance-manager/pkg/types"
"github.com/longhorn/longhorn-instance-manager/pkg/util"
)
Expand Down
42 changes: 0 additions & 42 deletions generate_grpc.sh

This file was deleted.

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions integration/rpc/disk/__init__.py

This file was deleted.

50 changes: 0 additions & 50 deletions integration/rpc/disk/disk_client.py

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit fbd2fb7

Please sign in to comment.