-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
80 changed files
with
6,575 additions
and
342 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# OPENSOURCE-CLEANUP DELETE_FILE | ||
BlackList = ["BE1054006"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# OPENSOURCE-CLEANUP DELETE_FILE | ||
reviewers: ["wangzijie.wzj", "xiaol.huxl", "dongwen.hdw", "guoshilei.gsl", "caochen.cao", "yansi.zy", "jiamingyang.jmy", "lilinchuan.zwz","zhanhanbing.zhb","zhuangzhuangyan.yz","yj01523683"] | ||
threshold: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# OPENSOURCE-CLEANUP DELETE_FILE | ||
# latest image version: reg.docker.alibaba-inc.com/nueva-stack/alios7u2-py-base:0.20 | ||
|
||
FROM openanolis/anolisos:8.4-x86_64 AS build | ||
|
||
RUN yum groupinstall -y "Development Tools" && yum install -y wget fuse fuse-devel fuse3 fuse3-devel | ||
RUN wget -O unionfs-fuse.tgz https://github.com/rpodgorny/unionfs-fuse/archive/refs/tags/v2.1.tar.gz && \ | ||
tar xf unionfs-fuse.tgz && cd unionfs-fuse-2.1/ && make && make install | ||
|
||
|
||
FROM reg.docker.alibaba-inc.com/alipay/7u2-common:202202.0T | ||
|
||
LABEL maintainer="[email protected]" | ||
|
||
ENV TZ=Asia/Shanghai | ||
|
||
USER root | ||
WORKDIR /home/admin | ||
|
||
COPY --from=build /usr/local/bin/unionfs* /usr/local/bin/ | ||
|
||
# update glibc to 2.30 | ||
# https://yuque.antfin-inc.com/baseos/manual/gcc92 | ||
|
||
RUN yum clean all && yum -y install glibc-devel && \ | ||
yum -y update util-linux bash-completion gnupg2 python perl systemd && \ | ||
yum -y install alios7u-2_30-gcc-9-repo.noarch && \ | ||
yum -y install libdb binutils && \ | ||
yum -y install glibc glibc-langpack-en && \ | ||
yum -y install glibc-devel libstdc++-devel libstdc++-static libstdc++ libasan && \ | ||
yum clean all | ||
|
||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | ||
|
||
RUN yum install -y wget && \ | ||
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo && \ | ||
wget -O /etc/yum.repos.d/openresty.repo https://openresty.org/package/centos/openresty.repo && \ | ||
yum install --setopt=skip_missing_names_on_install=False -y \ | ||
net-tools-2.0 epel-release tar iproute sudo logrotate \ | ||
tcpdump less rsync tree which \ | ||
zlib-devel libffi-devel openssl-devel fuse fuse-devel fuse3 fuse3-devel fuse-overlayfs perl perl-Digest-MD5 python3 java openresty openresty-opm && \ | ||
yum clean all | ||
|
||
RUN opm get knyar/nginx-lua-prometheus ledgetech/lua-resty-http cdbattags/lua-resty-jwt && \ | ||
wget -O /usr/bin/ossutil64 http://gosspublic.alicdn.com/ossutil/1.6.0/ossutil64 && \ | ||
chmod 0755 /usr/bin/ossutil64 | ||
|
||
RUN pushd /usr/bin/ && rm -rf python && ln -s python3 python && popd && \ | ||
sed -i 's/\/usr\/bin\/python/\/usr\/bin\/python2.7/g' /usr/bin/yum /usr/libexec/urlgrabber-ext-down && \ | ||
yum install -y python3-devel | ||
|
||
RUN pip3 install --upgrade pip && \ | ||
pip3 install cryptography==3.3.2 paramiko scp | ||
|
||
RUN yum install -y libxml2-devel | ||
|
||
RUN pushd /tmp && \ | ||
ln -s /usr/lib64/liblua-5.1.so /usr/lib64/liblua.so && \ | ||
wget https://mpc-antbase.oss-cn-hangzhou.aliyuncs.com/release/linux/acjail/t-aliyun-acjail-2.0.1.an8.x86_64.rpm && \ | ||
rpm -ivh t-aliyun-acjail-2.0.1.an8.x86_64.rpm && \ | ||
sed -i '/blacklist_ip = {/c\blacklist_ip = blacklist_ip or {}' /usr/local/aliyun_acjail/config.lua && \ | ||
rm -rfv t-aliyun-acjail-2.0.1.an8.x86_64.rpm && popd | ||
|
||
RUN pushd /tmp && wget https://bindfs.org/downloads/bindfs-1.15.1.tar.gz --no-check-certificate && \ | ||
tar xf bindfs-1.15.1.tar.gz && cd bindfs-1.15.1 && ./configure && make && make install && \ | ||
cd .. && rm -rfv bindfs* && popd | ||
|
||
RUN yum -y remove openssh && rm -rf /etc/runit/sshd && \ | ||
yum -y remove telnet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# latest image version: reg.docker.alibaba-inc.com/secretflow/kuscia-dev:0.6 | ||
|
||
FROM reg.docker.alibaba-inc.com/nueva-stack/dev-base:0.3 | ||
|
||
LABEL maintainer="[email protected]" | ||
|
||
ENV TZ=Asia/Shanghai | ||
|
||
RUN yum update -y \ | ||
&& yum clean all | ||
|
||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \ | ||
yum install -y wget sudo less epel-release net-tools iproute git jq tree unzip gcc perl perl-Digest-MD5 git-lfs which && \ | ||
yum clean all && \ | ||
wget -O /usr/bin/ossutil64 http://gosspublic.alicdn.com/ossutil/1.6.0/ossutil64 && \ | ||
chmod 0755 /usr/bin/ossutil64 && \ | ||
wget https://github.com/protocolbuffers/protobuf/releases/download/v21.8/protoc-21.8-linux-x86_64.zip && \ | ||
unzip protoc-21.8-linux-x86_64.zip -d /usr/local && chgrp -R users /usr/local/include/google /usr/local/bin/protoc && cd ../ && \ | ||
wget http://mpc-antbase.oss-cn-hangzhou.aliyuncs.com/influxdb/influxd -O /usr/local/bin/influxd && chmod 755 /usr/local/bin/influxd && \ | ||
wget https://mpc-antbase.oss-cn-hangzhou.aliyuncs.com/mysql-8.0.28-lite/mysql.tar.gz && tar -xvf mysql.tar.gz -C /usr/local && chmod 755 /usr/local/bin/mysqld | ||
|
||
RUN wget https://golang.google.cn/dl/go1.19.10.linux-amd64.tar.gz -O - | tar -xz -C /usr/local && \ | ||
echo export GOPROXY=https://goproxy.cn,direct >> ~/.bashrc && \ | ||
echo export GO111MODULE=on >> ~/.bashrc && \ | ||
echo export GOPATH=$HOME/gopath >> ~/.bashrc && \ | ||
echo export PATH=$PATH:/usr/local/go/bin:'$GOPATH'/bin >> ~/.bashrc && \ | ||
echo export GOPRIVATE=gitlab.alipay-inc.com >> ~/.bashrc && \ | ||
source ~/.bashrc && \ | ||
ssh-keyscan -t rsa gitlab.alipay-inc.com >> ~/.ssh/known_hosts && \ | ||
git config --global url."[email protected]:".insteadOf "http://gitlab.alipay-inc.com/" && \ | ||
go install google.golang.org/protobuf/cmd/[email protected] && \ | ||
go install github.com/t-yuki/gocover-cobertura@latest && \ | ||
go install github.com/jstemmer/go-junit-report/v2@latest && \ | ||
go install github.com/golangci/golangci-lint/cmd/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# OPENSOURCE-CLEANUP DELETE_FILE | ||
ARG DEPS_IMAGE="reg.docker.alibaba-inc.com/secretflow/kuscia-deps:0.2.0" | ||
ARG KUSCIA_ENVOY_IMAGE="reg.docker.alibaba-inc.com/secretflow/kuscia-envoy:0.5.0b0" | ||
ARG PROM_NODE_EXPORTER="prom/node-exporter:v1.7.0" | ||
|
||
FROM ${DEPS_IMAGE} as deps | ||
FROM ${PROM_NODE_EXPORTER} as node_exporter | ||
FROM ${KUSCIA_ENVOY_IMAGE} as kuscia_envoy | ||
|
||
FROM reg.docker.alibaba-inc.com/nueva-stack/alios7u2-py-base:0.20 | ||
|
||
ENV TZ=Asia/Shanghai | ||
|
||
ARG ROOT_DIR="/home/kuscia" | ||
RUN yum install -y openssl net-tools which jq logrotate && \ | ||
yum clean all && \ | ||
mkdir -p ${ROOT_DIR}/bin && \ | ||
mkdir -p /bin/aux && \ | ||
mkdir -p ${ROOT_DIR}/scripts && \ | ||
mkdir -p ${ROOT_DIR}/var/storage && \ | ||
mkdir -p ${ROOT_DIR}/pause | ||
|
||
COPY --from=deps /image/home/kuscia/bin ${ROOT_DIR}/bin | ||
COPY --from=deps /image/bin/aux /bin/aux | ||
COPY --from=node_exporter /bin/node_exporter ${ROOT_DIR}/bin | ||
RUN pushd ${ROOT_DIR}/bin && \ | ||
ln -s k3s crictl && \ | ||
ln -s k3s ctr && \ | ||
ln -s k3s kubectl && \ | ||
ln -s cni bridge && \ | ||
ln -s cni flannel && \ | ||
ln -s cni host-local && \ | ||
ln -s cni loopback && \ | ||
ln -s cni portmap && \ | ||
popd | ||
|
||
COPY build/apps/kuscia/kuscia ${ROOT_DIR}/bin | ||
COPY build/pause/pause-amd64.tar ${ROOT_DIR}/pause/pause.tar | ||
COPY crds/v1alpha1 ${ROOT_DIR}/crds/v1alpha1 | ||
COPY etc ${ROOT_DIR}/etc | ||
COPY testdata ${ROOT_DIR}/var/storage/data | ||
COPY scripts ${ROOT_DIR}/scripts | ||
|
||
COPY thirdparty/*/scripts ${ROOT_DIR}/scripts | ||
|
||
COPY --from=kuscia_envoy /home/kuscia/bin/envoy ${ROOT_DIR}/bin | ||
|
||
ENV PATH="${PATH}:${ROOT_DIR}/bin:/bin/aux" | ||
|
||
WORKDIR ${ROOT_DIR} | ||
|
||
ENTRYPOINT ["tini", "--"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2023 Ant Group Co., Ltd. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package main | ||
|
||
import ( | ||
"github.com/secretflow/kuscia/pkg/kusciastorage" | ||
"github.com/secretflow/kuscia/pkg/utils/nlog" | ||
) | ||
|
||
func main() { | ||
err := kusciastorage.RunKusciaStorage() | ||
if err != nil { | ||
nlog.Errorf("Run kuscia storage service failed: %v", err.Error()) | ||
} | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Copyright 2023 Ant Group Co., Ltd. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package main | ||
|
||
import ( | ||
"context" | ||
"strconv" | ||
|
||
"github.com/secretflow/kuscia/pkg/utils/nlog" | ||
"github.com/secretflow/kuscia/pkg/web/asserts" | ||
"github.com/secretflow/kuscia/pkg/web/errorcode" | ||
"github.com/secretflow/kuscia/pkg/web/framework" | ||
"github.com/secretflow/kuscia/pkg/web/framework/config" | ||
) | ||
|
||
type TestBean struct { | ||
framework.ConfigLoader | ||
// config | ||
DataStoreType string `name:"data-store-type" usage:"Data Store Type" required:""` | ||
RPCPort int `name:"rpc-port" usage:"rpc-port" default:"8118"` | ||
|
||
DataStoreRPCPort string | ||
DemoConfig *DemoConfig | ||
} | ||
|
||
func NewTestBean(c *DemoConfig) *TestBean { | ||
return &TestBean{ | ||
ConfigLoader: &config.FlagEnvConfigLoader{Source: config.SourceFlag}, | ||
DemoConfig: c, | ||
} | ||
} | ||
|
||
func (b *TestBean) Validate(errs *errorcode.Errs) { | ||
errs.AppendErr(asserts.NotEmpty(b.DataStoreType, "DataStoreType is empty")) | ||
errs.AppendErr(asserts.IsTrue(b.RPCPort > 0, "RpcPort is invalid")) | ||
} | ||
|
||
func (b *TestBean) Init(e framework.ConfBeanRegistry) error { | ||
b.DataStoreRPCPort = b.DataStoreType + strconv.Itoa(b.RPCPort) | ||
// TODO Init ... | ||
nlog.Info("Init: " + b.DataStoreRPCPort) | ||
return nil | ||
} | ||
|
||
func (b *TestBean) Start(ctx context.Context, e framework.ConfBeanRegistry) error { | ||
nlog.Info("Start" + b.DataStoreRPCPort) | ||
b.DemoConfig.Print() | ||
return nil | ||
} |
Oops, something went wrong.