Skip to content

Commit

Permalink
feature: chaosmetad support containerd
Browse files Browse the repository at this point in the history
  • Loading branch information
KingsonKai committed Sep 15, 2023
1 parent 72ffe8e commit f3d60c3
Show file tree
Hide file tree
Showing 15 changed files with 378 additions and 48 deletions.
9 changes: 5 additions & 4 deletions chaosmeta-deploy/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ BASE_DIR=$(
pwd
)

mkdir -p ${BASE_DIR}/yamls
# param check
OP=$1
NAMESPACE=$2
Expand All @@ -27,10 +28,10 @@ for ((i = 3; i <= $#; i++)); do
done

if [ "$OP" == "-h" ] || [ "$OP" == "--help" ] || [ -z "$OP" ] || [ ${#COMPONENT_LIST[@]} -eq 0 ]; then
echo "format: sh deploy.sh [operation] [namespace] [component list]"
echo "operation support: ${OP_INSTALL},${OP_UNINSTALL}"
echo "component support: ${COMPONENT_ALL} ${COMPONENT_PLATFORM} ${COMPONENT_WORKFLOW} ${COMPONENT_INJECT} ${COMPONENT_MEASURE} ${COMPONENT_FLOW} ${COMPONENT_DAEMON}"
echo "example: sh deploy.sh install default ${COMPONENT_PLATFORM} ${COMPONENT_WORKFLOW} ${COMPONENT_INJECT} ${COMPONENT_DAEMON}"
echo -e "\nformat: sh deploy.sh [operation] [namespace] [component list]"
echo -e "example: sh deploy.sh install default ${COMPONENT_PLATFORM} ${COMPONENT_WORKFLOW} ${COMPONENT_INJECT} ${COMPONENT_DAEMON}\n"
echo "operation support: ${OP_INSTALL} ${OP_UNINSTALL}"
echo -e "component support: ${COMPONENT_ALL} ${COMPONENT_PLATFORM} ${COMPONENT_WORKFLOW} ${COMPONENT_INJECT} ${COMPONENT_MEASURE} ${COMPONENT_FLOW} ${COMPONENT_DAEMON}\n"
exit 1
fi

Expand Down
2 changes: 1 addition & 1 deletion chaosmeta-deploy/templates/chaosmeta-daemon-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
# chaos-role.chaosmeta.io: chaosmeta-daemon
containers:
- name: chaosmeta-daemon
image: registry.cn-hangzhou.aliyuncs.com/chaosmeta/chaosmeta-daemon:v0.1.1
image: registry.cn-hangzhou.aliyuncs.com/chaosmeta/chaosmeta-daemon:v0.2.0
securityContext:
privileged: true
volumeMounts:
Expand Down
2 changes: 1 addition & 1 deletion chaosmeta-deploy/templates/chaosmeta-inject-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ data:
"executor": {
"mode": "daemonset",
"executor": "chaosmetad",
"version": "0.1.1",
"version": "0.2.0",
"agentConfig": {
"agentPort": 29595
},
Expand Down
2 changes: 1 addition & 1 deletion chaosmeta-inject-operator/config/chaosmeta-inject.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"executor": {
"mode": "daemonset",
"executor": "chaosmetad",
"version": "0.1.1",
"version": "0.2.0",
"agentConfig": {
"agentPort": 29595
},
Expand Down
1 change: 1 addition & 0 deletions chaosmeta-platform/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
github.com/onsi/ginkgo/v2 v2.9.4 h1:xR7vG4IXt5RWx6FfIjyAtsoMAtnc3C/rFXBBd2AjZwE=
github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE=
github.com/panjf2000/ants v1.3.0 h1:8pQ+8leaLc9lys2viEEr8md0U4RN6uOSUCE9bOYjQ9M=
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# docker build -t registry.cn-hangzhou.aliyuncs.com/chaosmeta/chaosmeta-daemon:v0.1.1 -f chaosmeta-daemonset.Dockerfile .
# docker build -t registry.cn-hangzhou.aliyuncs.com/chaosmeta/chaosmeta-daemon:v0.2.0 -f chaosmeta-daemonset.Dockerfile .
From centos:centos7
ENV CHAOSMETAD_VERSION=0.1.1
ENV CHAOSMETAD_VERSION=0.2.0
ADD ./chaosmetad-$CHAOSMETAD_VERSION.tar.gz /opt/chaosmeta
CMD while true; do if [ ! -d "/tmp/chaosmetad-$CHAOSMETAD_VERSION" ]; then cp -r /opt/chaosmeta/chaosmetad-$CHAOSMETAD_VERSION /tmp/chaosmetad-$CHAOSMETAD_VERSION; fi; sleep 600; done
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# docker build -t registry.cn-hangzhou.aliyuncs.com/chaosmeta/chaosmetad-demo:v0.1.1 .
# docker build -t registry.cn-hangzhou.aliyuncs.com/chaosmeta/chaosmetad-demo:v0.2.0 -f chaosmetad-demo.Dockerfile .
From centos:centos7
ADD ./jdk-8u361-linux-x64.tar.gz /usr/local
RUN yum install -y iproute && yum clean all
ENV CHAOSMETAD_VERSION=0.1.1
ENV CHAOSMETAD_VERSION=0.2.0
ADD ./chaosmetad-$CHAOSMETAD_VERSION.tar.gz /opt/chaosmeta
RUN echo 'export JAVA_HOME=/usr/local/jdk1.8.0_361' >> /etc/profile && echo 'export PATH=$PATH:$JAVA_HOME/bin' >> /etc/profile && echo 'export PATH=$PATH:/opt/chaosmeta/chaosmetad-'${CHAOSMETAD_VERSION} >> /etc/profile
2 changes: 1 addition & 1 deletion chaosmetad/build/ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fi

# base info
BUILD_NAME="chaosmetad"
VERSION="0.1.1"
VERSION="0.2.0"
BUILD_DATE=$(date "+%Y-%m-%d %H:%M:%S")

# env var
Expand Down
21 changes: 18 additions & 3 deletions chaosmetad/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ require (
github.com/alibaba/pouch v0.0.0-20221109061116-9caf9bae0b23
github.com/bndr/gotabulate v1.1.2
github.com/containerd/cgroups v1.0.4
github.com/containerd/containerd v1.6.12
github.com/docker/docker v20.10.21+incompatible
github.com/google/uuid v1.3.0
github.com/gorilla/mux v1.8.0
github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417
github.com/shirou/gopsutil v3.21.11+incompatible
github.com/sirupsen/logrus v1.9.0
github.com/spf13/cobra v1.5.0
Expand All @@ -21,11 +24,15 @@ require (
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef // indirect
github.com/containerd/containerd v1.6.12 // indirect
github.com/containerd/continuity v0.3.0 // indirect
github.com/containerd/fifo v1.0.0 // indirect
github.com/containerd/ttrpc v1.1.0 // indirect
github.com/containerd/typeurl v1.0.2 // indirect
github.com/contiv/executor v0.0.0-20180626233236-d263f4daa3ad // indirect
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
github.com/docker/distribution v2.8.1+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-openapi/analysis v0.21.2 // indirect
Expand All @@ -38,24 +45,28 @@ require (
github.com/go-openapi/swag v0.21.1 // indirect
github.com/go-openapi/validate v0.22.1 // indirect
github.com/godbus/dbus/v5 v5.0.6 // indirect
github.com/gogo/googleapis v1.4.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/klauspost/compress v1.13.6 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/mattn/go-sqlite3 v1.14.15 // indirect
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/moby/locker v1.0.1 // indirect
github.com/moby/sys/mount v0.3.3 // indirect
github.com/moby/sys/mountinfo v0.6.2 // indirect
github.com/moby/sys/signal v0.6.0 // indirect
github.com/moby/term v0.0.0-20221128092401-c43b287e0e0f // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799 // indirect
github.com/opencontainers/runc v1.1.4 // indirect
github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 // indirect
github.com/opencontainers/selinux v1.10.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/tklauser/go-sysconf v0.3.10 // indirect
Expand All @@ -65,10 +76,14 @@ require (
go.opencensus.io v0.23.0 // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.2.0 // indirect
golang.org/x/tools v0.1.12 // indirect
google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21 // indirect
google.golang.org/grpc v1.47.0 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gotest.tools/v3 v3.4.0 // indirect
)
Loading

0 comments on commit f3d60c3

Please sign in to comment.