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

Turnoff misleading error/warning messages #1554

Conversation

shuklanirdesh82
Copy link
Contributor

@shuklanirdesh82 shuklanirdesh82 commented Jul 7, 2017

fixes #1356

This PR cleans up following misleading error/warning message from CI test run.

  1. Avoid spitting warning: overriding commands for target clean'`
  2. Not a git repository (or any of the parent directories): .git when the VERSION_TAG is set no need to invoke remote call to fetch GIT_SHA or GIT_TAG .. in case of vm on the CI where repo is not checked out; it prints such fatal message that creates some distraction while debugging the failure.

e.g. https://ci.vmware.run/vmware/docker-volume-vsphere/949

:::::::::::::::::::::::::::
:::::::::::::::::::::::::::
Makefile:152: warning: overriding commands for target `clean'
../plugin/Makefile:87: warning: ignoring old commands for target `clean'
:::::::::::::::::::::::::::
:::::::::::::::::::::::::::
Makefile:152: warning: overriding commands for target `clean'
../plugin/Makefile:87: warning: ignoring old commands for target `clean'
Removing auth DB file at 192.168.31.62:'/etc/vmware/vmdkops/auth-db'
Makefile:152: warning: overriding commands for target `clean'
../plugin/Makefile:87: warning: ignoring old commands for target `clean'
:::::::::::::::::::::::::::
:::::::::::::::::::::::::::
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git

Testing done: yes

  1. make clean build-all deploy-all (works fine as expected)

CI output https://ci.vmware.run/vmware/docker-volume-vsphere/968

Using the following config:
DOCKER_HUB_REPO cnastorage EXTRA_TAG -CI VERSION_TAG latest
PLUGIN_NAME cnastorage/docker-volume-vsphere:latest-CI
=== Cleaning work files, images and plugin(s)...
rm -rf /tmp/plugin
rm -f docker-volume-vsphere
docker plugin rm cnastorage/docker-volume-vsphere:latest-CI -f
Error response from daemon: plugin "cnastorage/docker-volume-vsphere:latest-CI" not found
Makefile:54: recipe for target 'clean' failed
docker rm -vf tempContainer
make: [clean] Error 1 (ignored)
Error response from daemon: No such container: tempContainer
Makefile:54: recipe for target 'clean' failed
docker rmi cnastorage/docker-volume-vsphere:rootfs
make: [clean] Error 1 (ignored)
Error response from daemon: No such image: cnastorage/docker-volume-vsphere:rootfs
Makefile:54: recipe for target 'clean' failed
== building Docker image, unpacking to ./rootfs and creating plugin...
cp ../build/docker-volume-vsphere .
make: [clean] Error 1 (ignored)
docker build -q -t cnastorage/docker-volume-vsphere:rootfs .
sha256:b9e9e607f5f4bdef1b428d514b04defd8d66edf254201cc53f409362abe3598d
docker create --name tempContainer cnastorage/docker-volume-vsphere:rootfs
d364b786e6e80c616ce54b08fb6ce96bc24cb9f907bfba182aef9a5b2ef1445c
mkdir -p /tmp/plugin/rootfs
docker export  tempContainer  | tar -x -C /tmp/plugin/rootfs
cp config.json docker-volume-vsphere /tmp/plugin
-- Creating  plugin cnastorage/docker-volume-vsphere:latest-CI ...
docker plugin create cnastorage/docker-volume-vsphere:latest-CI /tmp/plugin
cnastorage/docker-volume-vsphere:latest-CI

/CC @msterin

Copy link
Contributor

@msterin msterin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good. See a couple of minor points inside. Thanks for the fix !

Constants.mk Outdated
# This Makefile's purpose is to hold common variables to reuse across
# Makefiles for vDVS.

export
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does 'export' here do

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exporting all the variables resided in this file.

Constants.mk Outdated
@@ -0,0 +1,78 @@
# Copyright 2016 VMware, Inc. All Rights Reserved.
#
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not really constants. More.like vars

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct! My bad, I will rename it.

How about Commonvars.mk or EnvVars.mk?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commonvars sounds good. At any rate, this is minor

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will push the change shortly to avoid future confusion with naming.

# developer builds use last tagged release and sha1 of the most recent commit.
# Format: <last tagged release>.<last commit hash>
PKG_VERSION ?= $(shell \
git describe --tags `git rev-list --tags --max-count=1` \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not used anymore , right ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is being referred from Constants.mk.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean set in ? Yes, I see it now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah!

Constants.mk Outdated
# developer builds use last tagged release and sha1 of the most recent commit.
# Format: <last tagged release>.<last commit hash>
PKG_VERSION ?= $(shell \
git describe --tags `git rev-list --tags --max-count=1` \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it uses git so I think it may fail exactly the same GIT_SHA calculation used to fail during managed plugin build unless it is pre-defened from upstairs. Please check the logs.

# developer builds use last tagged release and sha1 of the most recent commit.
# Format: <last tagged release>.<last commit hash>
PKG_VERSION ?= $(shell \
git describe --tags `git rev-list --tags --max-count=1` \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean set in ? Yes, I see it now.

Copy link
Contributor

@msterin msterin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Actually,

I take the "approval" back. Per CI, (1) the managed plugin make is broken, and (2) CI itself ignores serious error in plugin build:

(1)

rm -f 
docker plugin rm : -f
Error response from daemon: plugin ":" not found
make: [clean] Error 1 (ignored)
Makefile:51: recipe for target 'clean' failed
docker rm -vf tempContainer
Error response from daemon: No such container: tempContainer
make: [clean] Error 1 (ignored)
Error response from daemon: invalid reference format
make: [clean] Error 1 (ignored)
cp: omitting directory '/'
make: *** [plugin] Error 1
Makefile:51: recipe for target 'clean' failed
docker rmi :rootfs
Makefile:51: recipe for target 'clean' failed
== building Docker image, unpacking to ./rootfs and creating plugin...
cp / .
Makefile:59: recipe for target 'plugin' failed
plugin_sanity_test: [INFO] Running plugin_sanity_test on the clean test setup...
plugin_sanity_test: [INFO] Installed plugin name is:
plugin_sanity_test: [ERROR] error has occurred while fetching created plugin name..
         please make sure plugin is built correctly or not
Pushing : to dockerhub.io...
invalid reference format
  1. despite the above, the CI did not stop and did not report error

@shuklanirdesh82
Copy link
Contributor Author

shuklanirdesh82 commented Jul 7, 2017

Thanks @msterin!

#1554 (review)

For (1) I have a local fix (missed a commit) and waiting for the file rename to push new commit. Sure I will Commonvars.mk as name

for (2) I need to investigate why make deploy-vm-plugin ignores failure.

from https://github.com/vmware/docker-volume-vsphere/blob/master/misc/drone-scripts/deploy-and-test-wrapper.sh

TARGET+=" deploy-vm-plugin"


if make -s $TARGET $PARAMETER;
  | then
  | echo "=> Build Complete" `date`
  | #stop_build $VM1 $BUILD_NUMBER
  | else
  | log "Build + Test not successful"
  | INCLUDE_HOSTD="true"
  | dump_logs
  | stop_build $VM1 $BUILD_NUMBER
  | exit 1
  | fi

@shuklanirdesh82 shuklanirdesh82 force-pushed the misleadingErrCleanup.shuklanirdesh82 branch from 49f2190 to 6d39c67 Compare July 7, 2017 18:25
@shuklanirdesh82 shuklanirdesh82 force-pushed the misleadingErrCleanup.shuklanirdesh82 branch from 6d39c67 to 4269c19 Compare July 7, 2017 19:50
@shuklanirdesh82 shuklanirdesh82 merged commit 556bf78 into vmware-archive:master Jul 8, 2017
@shuklanirdesh82 shuklanirdesh82 deleted the misleadingErrCleanup.shuklanirdesh82 branch July 8, 2017 00:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Turn off Makefile target warning
3 participants