Skip to content

Commit

Permalink
update ci image address and version
Browse files Browse the repository at this point in the history
  • Loading branch information
BSWANG committed Nov 21, 2018
1 parent 80ac43a commit 79d2e73
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 22 deletions.
6 changes: 3 additions & 3 deletions ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ cd ../ci
cp -r ../script .

cat > Dockerfile <<EOF
FROM registry.aliyuncs.com/wangbs/netdia:latest
FROM alpine:3.8
COPY script/ /bin/
RUN apk --update add ipset bash && chmod +x /bin/traffic && chmod +x /bin/policyinit.sh && rm -f /var/cache/apk/*
RUN apk --update add curl ipset bash iproute2 ethtool bridge-utils && chmod +x /bin/traffic && chmod +x /bin/policyinit.sh && rm -f /var/cache/apk/*
RUN curl -sSL -o /bin/calico-felix https://docker-plugin.oss-cn-shanghai.aliyuncs.com/calico-felix && chmod +x /bin/calico-felix
COPY terwayd terway /usr/bin/
ENTRYPOINT ["/usr/bin/terwayd"]
EOF
docker build --no-cache -t acs/terway:1.0-$GIT_SHA .
docker build --no-cache -t acs/terway:v0.1.0-$GIT_SHA .
23 changes: 11 additions & 12 deletions deviceplugin/eni.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type EniDevicePlugin struct {
socket string
server *grpc.Server
count int
stop chan struct{}
stop chan struct{}
sync.Locker
}

Expand Down Expand Up @@ -78,7 +78,6 @@ func (m *EniDevicePlugin) Start() error {
m.server = grpc.NewServer([]grpc.ServerOption{}...)
pluginapi.RegisterDevicePluginServer(m.server, m)


m.stop = make(chan struct{}, 1)
go m.server.Serve(sock)

Expand Down Expand Up @@ -178,7 +177,7 @@ func (m *EniDevicePlugin) cleanup() error {

for _, preSock := range preSocks {
log.Debugf("device plugin file info: %+v", preSock)
if eniServerSockRegex.Match([]byte(preSock.Name())) && preSock.Mode() & os.ModeSocket != 0 {
if eniServerSockRegex.Match([]byte(preSock.Name())) && preSock.Mode()&os.ModeSocket != 0 {
if err = syscall.Unlink(path.Join(pluginapi.DevicePluginPath, preSock.Name())); err != nil {
log.Errorf("error on clean up previous device plugin listens, %+v", err)
}
Expand Down Expand Up @@ -228,8 +227,8 @@ func (m *EniDevicePlugin) watchKubeletRestart() {
}
err = m.Register(
pluginapi.RegisterRequest{
Version: pluginapi.Version,
Endpoint: path.Base(m.socket),
Version: pluginapi.Version,
Endpoint: path.Base(m.socket),
ResourceName: DefaultResourceName,
},
)
Expand All @@ -239,7 +238,7 @@ func (m *EniDevicePlugin) watchKubeletRestart() {
return
}
log.Fatalf("error stat socket: %+v", err)
}, time.Second * 30, make(chan struct{}, 1), )
}, time.Second*30, make(chan struct{}, 1))
}

// Serve starts the gRPC server and register the device plugin to Kubelet
Expand All @@ -253,12 +252,12 @@ func (m *EniDevicePlugin) Serve(resourceName string) error {
log.Infof("Starting to serve on %s", m.socket)

err = m.Register(
pluginapi.RegisterRequest{
Version: pluginapi.Version,
Endpoint: path.Base(m.socket),
ResourceName: resourceName,
},
)
pluginapi.RegisterRequest{
Version: pluginapi.Version,
Endpoint: path.Base(m.socket),
ResourceName: resourceName,
},
)
if err != nil {
log.Errorf("Could not register device plugin: %v", err)
m.Stop()
Expand Down
2 changes: 1 addition & 1 deletion deviceplugin/eni_capability.go
Original file line number Diff line number Diff line change
Expand Up @@ -457,4 +457,4 @@ var ecsEniMatix = map[string]int{
"ecs.gn5e-c11g1.11xlarge": 8,
"ecs.gn5e-c11g1.22xlarge": 8,
"ecs.ebmg5ne.24xlarge": 1,
}
}
3 changes: 2 additions & 1 deletion script/policyinit.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
export DATASTORE_TYPE=kubernetes
export FELIX_LOGSEVERITYSYS=info
export FELIX_LOGSEVERITYSYS=none
export CALICO_NETWORKING_BACKEND=none
export CLUSTER_TYPE=k8s,canal
export CALICO_DISABLE_FILE_LOGGING=true
Expand All @@ -11,6 +11,7 @@ export WAIT_FOR_DATASTORE=true
export IP=""
export FELIX_DEFAULTENDPOINTTOHOSTACTION=ACCEPT
export FELIX_HEALTHENABLED=true
export FELIX_LOGFILEPATH=/dev/null
exec 2>&1
if [ ! -z $NODENAME ]; then
export FELIX_FELIXHOSTNAME=$NODENAME
Expand Down
6 changes: 3 additions & 3 deletions terway.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ spec:
hostNetwork: true
initContainers:
- name: terway-init
image: registry.cn-hangzhou.aliyuncs.com/wangbs/terway:latest
image: registry.aliyuncs.com/acs/terway:v0.1.0
imagePullPolicy: Always
securityContext:
privileged: true
Expand All @@ -129,7 +129,7 @@ spec:
name: lib-modules
containers:
- name: terway
image: registry.cn-hangzhou.aliyuncs.com/wangbs/terway:latest
image: registry.aliyuncs.com/acs/terway:v0.1.0
imagePullPolicy: Always
securityContext:
privileged: true
Expand All @@ -152,7 +152,7 @@ spec:
- mountPath: /var/lib/kubelet/device-plugins
name: device-plugin-path
- name: policy
image: registry.aliyuncs.com/wangbs/terway
image: registry.aliyuncs.com/acs/terway:v0.1.0
command: ["/bin/policyinit.sh"]
env:
- name: NODENAME
Expand Down
2 changes: 1 addition & 1 deletion types/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type Configure struct {
MinPoolSize int `yaml:"min_pool_size" json:"min_pool_size"`
Prefix string `yaml:"prefix" json:"prefix"`
SecurityGroup string `yaml:"security_group" json:"security_group"`
HotPlug string `yaml:"hot_plug" json:"hot_plug"`
HotPlug string `yaml:"hot_plug" json:"hot_plug"`
}

type PoolConfig struct {
Expand Down
2 changes: 1 addition & 1 deletion version/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import "github.com/containernetworking/cni/pkg/version"
// * VERSION
// Refer to https://github.com/containernetworking/cni/blob/master/SPEC.md
// for details
var specVersionSupported = version.PluginSupports( "0.3.0")
var specVersionSupported = version.PluginSupports("0.3.0")

// GetSpecVersionSupported gets the version of the CNI spec that's supported
// by the ENI plugin
Expand Down

0 comments on commit 79d2e73

Please sign in to comment.