Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

Commit

Permalink
More code and script change to enable vFile CI (#1886)
Browse files Browse the repository at this point in the history
  • Loading branch information
Miao Luo authored Oct 25, 2017
1 parent d13ca00 commit 8a6951e
Show file tree
Hide file tree
Showing 10 changed files with 97 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .drone.sec
Original file line number Diff line number Diff line change
@@ -1 +1 @@
eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkExMjhHQ00ifQ.FJ2hpLzy4pvUCJUSEa3tc1_LYd3fQ9tJ_MLjLRtw324YScsGu9HcdL-gkY7nm2OET60LU0jYj0iuvYuU1-IlEYnPV7kXriv6IBkchTnAHRBhXAwixvgBiCx1zdX_jxkgz_rLXpRJSxWKX25G0L8ddV33wJ7buTrJY5I8raeu7Iiji5zT2R-IiaZPAK4fUlNPgPdi7-_tg1sdH6qBDPW9f2uRQi9QcHlT0rBf4-aP_GUDMRpPyiYUN9kR_OG_0RIcyS6AOJeRwCNbeRnRQruZj0XkfIILKw8_wtq0Rq8PyEvYup2q4d4GruLwNDZ4vbUQ7-IXBrROa99qiz8YS_wTZg.sLLzcH1Lv2oZ5DRB.TqWmfVJiELe1aIr39YWFA1KJG0ughLA3Jwj3-v17uJXWfz1wTsfiaI5LAmmBC-RV1OkAowfU9IR5QZ9pdFt7kSCsdzAE_DgK4r5i9icMDrsRXJb3bMj1x0VGSKauohR6TjK31kp4qwqpV3j78KATNsoJmIFlJ-GyjhW3e0jV4iG7WRhtpZPAloN1nr-xXhQUpq80TLDmcrAhwJE6pdpbyfXsShHR0MrPuHoDCPVeor2FlYfJ2Z7zs9plGafX0KcpqcZyTNZKZfEo0rwRLxRT6jdALXEZiceXC15kHEdRgYBqIpM-ra4ccwYkThKvfJTRwE8R19xMRtStPtiJ3TzoHPH0ZWXdCClZOslVj0AbZq8D42xjEp2Y_KbjXULOhDUWT2C8HneuyJBUwWQbuTz1wOmNlo_Nli7Kl-MCiqNP9AE7USakG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t0xHhMwbn_kpIojNYOakNo7RFdSIyeN1R2D2NM4xKBfnr0kyCai6lovkwEAHfgWp2xl1UK8DzwWCIr3YYMx2Avc2HQ7AxZvJH7O11Xp3QBdG02Xn19SjHtSPhc3xGHSI2wjHbIwBLdPEYM1djIm7n_TkmcBg95ppH32pJzbtNWKsxpyauxtkXqrJdbalaikJDFa_oyD7GpW6bMfYBMFBBVAns6QVTHoBh1g5GNoeqSD3XJX25tUVBhHJvGE8xEQ7fMabZcuOO_vhQn2RH0OngNVbUxgUarABfiFFajb_syz8rjbYOi8E5HTTA_fD16-TfR88L6bYVNkVJGVcDK-ieNQO-bdU9sSuiFAyXjV0Z6Z-0YzM3qHg.WCiEgPW9MMuivG9uSg5-WA
7 changes: 6 additions & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,15 @@ build:
- #
- ./misc/drone-scripts/deploy-and-test-wrapper.sh runtests $GOVC_URL_6_5 $VM1 $VM2 $$BUILD_NUMBER < /dev/null
- #
- echo "=> Running tests on VSAN ESX_6.5" `date` > /dev/null
- echo "=> Building and running tests for vFile plugin on VMFS ESX_6.5" `date` > /dev/null
- #
- ./misc/drone-scripts/deploy-and-test-wrapper.sh vfileplugin $GOVC_URL_6_5 $VM1 $VM2 $$BUILD_NUMBER < /dev/null
- #
- export VM1=$CI_NODE4
- export VM2=$WORKER2
- #
- echo "=> Running tests on VSAN ESX_6.5" `date` > /dev/null
- #
- ./misc/drone-scripts/deploy-and-test-wrapper.sh runtests $GOVC_URL_6_5 $VM1 $VM2 $$BUILD_NUMBER < /dev/null
- #
- echo "=> Building and running tests for Windows vDVS plugin on VMFS" `date` > /dev/null
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ build-all: dockerized-build-ui
$(MAKE) --directory=plugin_dockerbuild all

# build vfile plugin
build-vfile: dockerized-build-ui
build-vfile-all: dockerized-build-ui
$(MAKE) $(MAKEFLAGS) --directory=client_plugin dockerbuild-vfile
$(MAKE) $(MAKEFLAGS) --directory=plugin_dockerbuild vfile-all

Expand All @@ -59,6 +59,10 @@ ifeq ($(INCLUDE_UI), true)
$(MAKE) --directory=ui $@
endif
$(MAKE) --directory=client_plugin $@
$(MAKE) --directory=client_plugin build-vfile

build-vfile:
$(MAKE) --directory=client_plugin $@

# Forward to UI inside docker run
dockerized-build-ui:
Expand Down
10 changes: 7 additions & 3 deletions client_plugin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ DEPLOY_ESX_SH := $(DEPLOY_TOOLS) deployesx
DEPLOY_ESX_FOR_UPGRADE := $(DEPLOY_TOOLS) deployesxForUpgrade
CLEANVM_SH := $(DEPLOY_TOOLS) cleanvm
CLEANESX_SH := $(DEPLOY_TOOLS) cleanesx
CLEANVFILE_SH := $(DEPLOY_TOOLS) cleanvfile


#
Expand Down Expand Up @@ -337,15 +338,15 @@ deploy-vm: clean-vm
deploy-vm-test:
$(DEPLOY_VM_TEST_SH) "$(VMS)" $(BIN) $(SCRIPTS)
build-plugin:
$(BUILD_PLUGIN_SH) "$(VM2)" $(PLUGIN_BIN) $(MANAGED_PLUGIN_LOC) $(SCRIPTS) $(DOCKER_HUB_REPO) $(VERSION_TAG) $(EXTRA_TAG)
$(BUILD_PLUGIN_SH) "$(VM2)" $(PLUGIN_BIN) $(MANAGED_PLUGIN_LOC) $(SCRIPTS) $(DOCKER_HUB_REPO) $(VERSION_TAG) $(EXTRA_TAG) $(PLUGNAME)
build-windows-plugin:
$(BUILD_WINDOWS_PLUGIN_SH) $(WIN_VM1)
deploy-windows-plugin:
$(DEPLOY_WINDOWS_PLUGIN_SH) "$(WIN_VMS)"
build-vfile-plugin:
$(BUILD_PLUGIN_SH) "$(VM2)" $(VFILE_PLUGIN_BIN) $(MANAGED_PLUGIN_LOC) $(SCRIPTS) $(DOCKER_HUB_REPO) $(VERSION_TAG) $(EXTRA_TAG) $(VFILE_PREFIX)
$(BUILD_PLUGIN_SH) "$(VM2)" $(VFILE_PLUGIN_BIN) $(MANAGED_PLUGIN_LOC) $(SCRIPTS) $(DOCKER_HUB_REPO) $(VERSION_TAG) $(EXTRA_TAG) $(VFILE_PLUGNAME) $(VFILE_PREFIX)
deploy-vfile-plugin:
$(DEPLOY_VM_SH) "$(VMS)" $(VFILE_PLUGIN_NAME):$(PLUGIN_TAG) $(VFILE_PLUGIN_ALIAS) $(VFILE_PLUGNAME)
$(DEPLOY_VM_SH) "$(VM1) $(VM2)" $(VFILE_PLUGIN_NAME):$(PLUGIN_TAG) $(VFILE_PLUGIN_ALIAS) $(VFILE_PLUGNAME)


deploy-all: deploy-esx deploy-vm deploy-vm-test
Expand Down Expand Up @@ -450,6 +451,9 @@ test-e2e-runonce-vfile:
clean-vm:
$(CLEANVM_SH) "$(VMS)" "$(MANAGED_PLUGIN_NAME)"

clean-vfile:
$(CLEANVFILE_SH) "$(VMS)" "$(VFILE_MANAGED_PLUGIN_NAME)"

clean-esx:
$(CLEANESX_SH) "$(ESX)" esx-vmdkops-service

Expand Down
10 changes: 5 additions & 5 deletions client_plugin/drivers/vfile/dockerops/dockerops.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const (
// Samba service listens
defaultSambaPort = 445
// Time between successive checks for general checking
checkTicker = time.Second
checkTicker = 3 * time.Second
// default Timeout to mark Samba service launch as unsuccessful
defaultSvcStartTimeoutSec = 45
// Prefix for internal volume names
Expand Down Expand Up @@ -347,12 +347,12 @@ func (d *DockerOps) isFileServiceRunning(servID string, volName string) (uint32,
return port, false
}
for _, task := range tasks {
if task.Status.State != swarm.TaskStateRunning {
log.Infof("File server not running for volume %s", volName)
return port, false
if task.Status.State == swarm.TaskStateRunning {
return port, true
}
}
return port, true
log.Infof("File server not running for volume %s", volName)
return port, false
}

// getServiceIDAndPort - return the file service ID and port for given volume
Expand Down
2 changes: 1 addition & 1 deletion client_plugin/drivers/vfile/kvstore/etcdops/etcdops.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const (
etcdRequestTimeout = 2 * time.Second
etcdUpdateTimeout = 10 * time.Second
checkSleepDuration = time.Second
gcTicker = 5 * time.Second
gcTicker = 30 * time.Second
etcdClientCreateError = "Failed to create etcd client"
swarmUnhealthyErrorMsg = "Swarm cluster maybe unhealthy"
etcdSingleRef = "1"
Expand Down
54 changes: 34 additions & 20 deletions client_plugin/drivers/vfile/vfile_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"os/exec"
"strconv"
"strings"
"time"

log "github.com/Sirupsen/logrus"
"github.com/docker/go-plugins-helpers/volume"
Expand All @@ -55,6 +56,8 @@ const (
internalVolumePrefix = "_vF_"
fsType = "cifs"
initError = "vFile volume driver is not fully initialized yet."
mountError = "exit status 255"
checkTicker = time.Second
)

/* VolumeDriver - vFile plugin volume driver struct
Expand Down Expand Up @@ -642,34 +645,45 @@ func (d *VolumeDriver) mountVFileVolume(volName string, mountpoint string, volRe
}
mountArgs = append(mountArgs, "-o", strings.Join(options, ","))

_, addr, _, err := d.dockerOps.GetSwarmInfo()
if err != nil {
log.WithFields(
log.Fields{"volume name": volName,
"error": err,
}).Error("Failed to get IP address from docker swarm ")
return err
}
source := "//" + addr + "/" + dockerops.FileShareName
source := "//127.0.0.1/" + dockerops.FileShareName
mountArgs = append(mountArgs, source)
mountArgs = append(mountArgs, mountpoint)

log.WithFields(
log.Fields{"volume name": volName,
"arguments": mountArgs,
}).Info("Mounting volume with options ")
command := exec.Command("mount", mountArgs...)
output, err := command.CombinedOutput()
if err != nil {
log.WithFields(
log.Fields{"volume name": volName,
"output": string(output),
"error": err,
}).Error("Mount failed: ")
return err
}

return nil
// host can be slow which results in host unreachable error during mount
// retry the mounting before error out
ticker := time.NewTicker(checkTicker)
defer ticker.Stop()
timer := time.NewTimer(dockerops.GetServiceStartTimeout())
defer timer.Stop()

for {
select {
case <-ticker.C:
command := exec.Command("mount", mountArgs...)
output, err := command.CombinedOutput()
if err != nil {
log.WithFields(
log.Fields{"volume name": volName,
"output": string(output),
"error": err,
}).Error("Mount failed: ")
if err.Error() != mountError {
return err
}
} else {
return nil
}
case <-timer.C:
msg := fmt.Sprintf("Failed to mount vFile volume %s after timeout", volName)
log.Errorf(msg)
return errors.New(msg)
}
}
}

// Unmount request from Docker. If mount refcount is drop to 0.
Expand Down
2 changes: 1 addition & 1 deletion misc/drone-scripts/deploy-and-test-wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ winplugin)
TARGET=" build-windows-plugin deploy-windows-plugin test-e2e-runonce-windows"
;;
vfileplugin)
TARGET=" build-plugin build-vfile-plugin deploy-vm deploy-vfile-plugin test-e2e-runonce-vfile"
TARGET=" build-vfile-plugin deploy-vfile-plugin test-e2e-runonce-vfile"
;;
esac

Expand Down
39 changes: 35 additions & 4 deletions misc/scripts/deploy-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
. ../misc/scripts/commands.sh

PLUGIN_NAME=docker-volume-vsphere
VFILE_PLUGNAME=vfile
VIB_NAME=esx-vmdkops-service
TMP_LOC=/tmp/$PLUGIN_NAME
VMDK_OPS_UNITTEST=/tmp/vmdk_ops_unit*
Expand Down Expand Up @@ -92,7 +93,9 @@ function buildplugin {

fi
$SSH $TARGET "cd $PLUGIN_LOC ; DOCKER_HUB_REPO=$DOCKER_HUB_REPO VERSION_TAG=$VERSION_TAG EXTRA_TAG=$EXTRA_TAG make ${PREFIX}info ${PREFIX}clean ${PREFIX}plugin"
if [ -z ${PREFIX} ]; then
managedPluginSanityCheck
fi
$SSH $TARGET "cd $PLUGIN_LOC ; DOCKER_HUB_REPO=$DOCKER_HUB_REPO VERSION_TAG=$VERSION_TAG EXTRA_TAG=$EXTRA_TAG make ${PREFIX}push ${PREFIX}clean"
done
}
Expand Down Expand Up @@ -143,7 +146,7 @@ function deploywindowsplugin {

function managedPluginSanityCheck {
$SCP $SCRIPTS/plugin_sanity_test.sh $TARGET:$BUILD_LOC
$SSH $TARGET 'sh ' $BUILD_LOC/plugin_sanity_test.sh
$SSH $TARGET "sh $BUILD_LOC/plugin_sanity_test.sh \"$PLUGNAME\""
}

function setupVMType {
Expand All @@ -166,8 +169,14 @@ function setupVMType {
}

function installManagedPlugin {
log "installManagedPlugin: Installing vDVS plugin [$MANAGED_PLUGIN_NAME]"
$SSH $TARGET "docker plugin install --grant-all-permissions --alias $PLUGIN_ALIAS $MANAGED_PLUGIN_NAME"
if [ $PLUGIN_NAME == $VFILE_PLUGNAME ]
then
log "installManagedPlugin: Installing vfile plugin [$MANAGED_PLUGIN_NAME]"
$SSH $TARGET "docker plugin install --grant-all-permissions --alias $PLUGIN_ALIAS $MANAGED_PLUGIN_NAME VFILE_TIMEOUT_IN_SECOND=300"
else
log "installManagedPlugin: Installing vDVS plugin [$MANAGED_PLUGIN_NAME]"
$SSH $TARGET "docker plugin install --grant-all-permissions --alias $PLUGIN_ALIAS $MANAGED_PLUGIN_NAME"
fi
}

function deployVMPost {
Expand Down Expand Up @@ -286,6 +295,15 @@ function cleanvm {
done
}

function cleanvfile {
set +e
for IP in $IP_LIST
do
TARGET=root@$IP
cleanupVFile
done
}

function cleanupVMPre {
case $FILE_EXT in
deb)
Expand Down Expand Up @@ -343,6 +361,10 @@ function cleanupVM {
$SSH $TARGET "docker plugin rm $MANAGED_PLUGIN_NAME -f > /dev/null 2>&1"
}

function cleanupVFile {
$SSH $TARGET "docker plugin rm $MANAGED_PLUGIN_NAME -f > /dev/null 2>&1"
}

function cleanupVMPost {
$SSH $TARGET "$PIDOF $PLUGIN_NAME"
if [ "$?" == "0" ]
Expand Down Expand Up @@ -439,14 +461,23 @@ cleanvm)
fi
cleanvm
;;
cleanvfile)
MANAGED_PLUGIN_NAME="$2"
if [ -z "$MANAGED_PLUGIN_NAME" ]
then
usage "Missing params: managed_plugin_name"
fi
cleanvfile
;;
buildplugin)
PLUGIN_BIN="$2"
MANAGED_PLUGIN_SRC="$3"
SCRIPTS="$4"
DOCKER_HUB_REPO="$5"
VERSION_TAG="$6"
EXTRA_TAG="$7"
PREFIX="$8"
PLUGNAME="$8"
PREFIX="$9"
if [ -z "$PLUGIN_BIN" -o -z "$MANAGED_PLUGIN_SRC" -o -z "$SCRIPTS" ]
then
usage "Missing params: plugin/binary/script folder"
Expand Down
3 changes: 2 additions & 1 deletion misc/scripts/plugin_sanity_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
echo "plugin_sanity_test: [INFO] Running plugin_sanity_test on the clean test setup..."

# get installed plugin name
pluginName=`docker plugin ls | sed 1,1d | awk '{ print $2 }'`
PLUGNAME=$1
pluginName=`docker plugin ls | sed -n '/'$PLUGNAME'/p' | awk '{ print $2 }'`
echo "plugin_sanity_test: [INFO] Installed plugin name is:$pluginName"

# make sure plugin name is not empty
Expand Down

0 comments on commit 8a6951e

Please sign in to comment.