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

VIB copy during build is copying files as root #637

Closed
govint opened this issue Oct 20, 2016 · 3 comments
Closed

VIB copy during build is copying files as root #637

govint opened this issue Oct 20, 2016 · 3 comments

Comments

@govint
Copy link
Contributor

govint commented Oct 20, 2016

The issue is seen on current TOT code. After the first build user needs to do a sudo rm each time before doing a make. The files copied under build are owned to root and hence the issue.


rm: cannot remove ‘../build/payloads/vmdkops/usr/lib/vmware/vmdkops/bin/vmdk_ops.py’: Permission denied
rm: cannot remove ‘../build/payloads/vmdkops/usr/lib/vmware/vmdkops/bin/vmdkops_admin.py’: Permission denied
rm: cannot remove ‘../build/payloads/vmdkops/usr/lib/vmware/vmdkops/bin/volume_kv.py’: Permission denied
rm: cannot remove ‘../build/payloads/vmdkops/usr/lib/vmware/vmdkops/bin/vsan_policy.py’: Permission denied
rm: cannot remove ‘../build/payloads/vmdkops/usr/lib/vmware/vmdkops/lib/libvmci_srv.so’: Permission denied
rm: cannot remove ‘../build/payloads/vmdkops/usr/lib/vmware/vmdkops/Python/vmdk_utils.py’: Permission denied
rm: cannot remove ‘../build/payloads/vmdkops/usr/lib/vmware/vmdkops/Python/kvESX.py’: Permission denied
rm: cannot remove ‘../build/payloads/vmdkops/usr/lib/vmware/vmdkops/Python/log_config.py’: Permission denied
rm: cannot remove ‘../build/payloads/vmdkops/usr/lib/vmware/vmdkops/Python/cli_table.py’: Permission denied
rm: cannot remove ‘../build/payloads/vmdkops/usr/lib/vmware/vmdkops/Python/vsan_info.py’: Permission denied
rm: cannot remove ‘../build/payloads/vmdkops/usr/lib/vmware/vmdkops/lib64/libvmci_srv.so’: Permission denied
rm: cannot remove ‘../build/payloads/vmdkops/etc/init.d/vmdk-opsd’: Permission denied


@kerneltime
Copy link
Contributor

I do not see this issue, here is what I tried, let me know what is different when you run into this.

promc-2n-dhcp255:docker-volume-vsphere sritesh$ git fetch
remote: Counting objects: 81, done.
remote: Compressing objects: 100% (72/72), done.
remote: Total 81 (delta 38), reused 7 (delta 7), pack-reused 2
Unpacking objects: 100% (81/81), done.
From https://github.com/vmware/docker-volume-vsphere
   396dec8..06a14a5  master     -> origin/master
 + e68981c...55a7144 auth.liping -> origin/auth.liping  (forced update)
 + e48b82f...65c2f43 cli        -> origin/cli  (forced update)
 + 8a2620d...df39995 cli-auth.liping -> origin/cli-auth.liping  (forced update)
 * [new branch]      revert-640-cli-auth.liping -> origin/revert-640-cli-auth.liping
   d2aef4b..ee72662  ui         -> origin/ui
 + 247efaf...5df6f4f vmodl.msterin -> origin/vmodl.msterin  (forced update)
promc-2n-dhcp255:docker-volume-vsphere sritesh$ git reset --hard origin/master
HEAD is now at 06a14a5 Removed accidental .pyc files
promc-2n-dhcp255:docker-volume-vsphere sritesh$ make clean
/Applications/Xcode.app/Contents/Developer/usr/bin/make --directory=vmdk_plugin clean
rm -rf ../build .code_verify
/Applications/Xcode.app/Contents/Developer/usr/bin/make --directory=../esx_service clean
rm -rf vmware-esx-vmdkops-0.7.06a14a5.vib ../build/libvmci_srv.so ../build/libvmci_srv.so.64 ../build/descriptor.xml ../build/payloads
promc-2n-dhcp255:docker-volume-vsphere sritesh$ make
/Applications/Xcode.app/Contents/Developer/usr/bin/make --directory=vmdk_plugin build-all
../misc/scripts/build.sh build
make: Entering directory `/go/src/github.com/vmware/docker-volume-vsphere/vmdk_plugin'
go tool vet .
gofmt -s -l -w .
GO15VENDOREXPERIMENT=1 go build --ldflags '-extldflags "-static"' -o ../build/docker-volume-vsphere github.com/vmware/docker-volume-vsphere/vmdk_plugin
GO15VENDOREXPERIMENT=1 go test -c -o ../build/vmdkops.test github.com/vmware/docker-volume-vsphere/vmdk_plugin/vmdkops
GO15VENDOREXPERIMENT=1 go test -c -o ../build/docker-volume-vsphere.test github.com/vmware/docker-volume-vsphere/vmdk_plugin
make  --directory=../esx_service build
make[1]: Entering directory `/go/src/github.com/vmware/docker-volume-vsphere/esx_service'
cc -fPIC -m32 -shared -o ../build/libvmci_srv.so vmci/vmci_server.c
cc -fPIC -shared -o ../build/libvmci_srv.so.64 vmci/vmci_server.c
Staging in ../build/payloads
vibauthor --debug --compose --vib=../build/vmware-esx-vmdkops-0.7.06a14a5.vib --stage-dir ../build --offline-depot ../build/vmware-esx-vmdkops-0.7.06a14a5.zip --force
WARNING: a VIB file with "partner" acceptance level need to be signed
    you can do it later using vibauthor with --sign option
Successfully created ../build/vmware-esx-vmdkops-0.7.06a14a5.vib.
Successfully created ../build/vmware-esx-vmdkops-0.7.06a14a5.zip.
make[1]: Leaving directory `/go/src/github.com/vmware/docker-volume-vsphere/esx_service'
make: Leaving directory `/go/src/github.com/vmware/docker-volume-vsphere/vmdk_plugin'
../misc/scripts/build.sh deb
make: Entering directory '/go/src/github.com/vmware/docker-volume-vsphere/vmdk_plugin'
fpm --deb-no-default-config-files -p ../build -C package -s dir -n docker-volume-vsphere -v 0.7.06a14a5 --provides docker-volume-vsphere -m cna-storage@vmware.com --url https://github.com/vmware/docker-volume-vsphere --after-install ../misc/scripts/install/after-install.sh --before-remove ../misc/scripts/install/before-remove.sh --after-remove ../misc/scripts/install/after-remove.sh --description "Docker Volume Driver for vSphere" --architecture x86_64 --force -d 'docker-engine > 1.9' -t deb .
Created package {:path=>"../build/docker-volume-vsphere_0.7.06a14a5_amd64.deb"}
make: Leaving directory '/go/src/github.com/vmware/docker-volume-vsphere/vmdk_plugin'
../misc/scripts/build.sh rpm
make: Entering directory '/go/src/github.com/vmware/docker-volume-vsphere/vmdk_plugin'
#fpm --epoch 0 -p ../build -C package -s dir -n docker-volume-vsphere -v 0.7.06a14a5 --provides docker-volume-vsphere -m cna-storage@vmware.com --url https://github.com/vmware/docker-volume-vsphere --after-install ../misc/scripts/install/after-install.sh --before-remove ../misc/scripts/install/before-remove.sh --after-remove ../misc/scripts/install/after-remove.sh --description "Docker Volume Driver for vSphere" --architecture x86_64 --force -d 'docker > 1.9' -t rpm .
fpm --epoch 0 -p ../build -C package -s dir -n docker-volume-vsphere -v 0.7.06a14a5 --provides docker-volume-vsphere -m cna-storage@vmware.com --url https://github.com/vmware/docker-volume-vsphere --after-install ../misc/scripts/install/after-install.sh --before-remove ../misc/scripts/install/before-remove.sh --after-remove ../misc/scripts/install/after-remove.sh --description "Docker Volume Driver for vSphere" --architecture x86_64 --force -t rpm .
Created package {:path=>"../build/docker-volume-vsphere-0.7.06a14a5-1.x86_64.rpm"}
make: Leaving directory '/go/src/github.com/vmware/docker-volume-vsphere/vmdk_plugin'
promc-2n-dhcp255:docker-volume-vsphere sritesh$ make 
/Applications/Xcode.app/Contents/Developer/usr/bin/make --directory=vmdk_plugin build-all
../misc/scripts/build.sh build
make: Entering directory `/go/src/github.com/vmware/docker-volume-vsphere/vmdk_plugin'
make  --directory=../esx_service build
make[1]: Entering directory `/go/src/github.com/vmware/docker-volume-vsphere/esx_service'
make[1]: Nothing to be done for `build'.
make[1]: Leaving directory `/go/src/github.com/vmware/docker-volume-vsphere/esx_service'
make: Leaving directory `/go/src/github.com/vmware/docker-volume-vsphere/vmdk_plugin'
../misc/scripts/build.sh deb
make: Entering directory '/go/src/github.com/vmware/docker-volume-vsphere/vmdk_plugin'
fpm --deb-no-default-config-files -p ../build -C package -s dir -n docker-volume-vsphere -v 0.7.06a14a5 --provides docker-volume-vsphere -m cna-storage@vmware.com --url https://github.com/vmware/docker-volume-vsphere --after-install ../misc/scripts/install/after-install.sh --before-remove ../misc/scripts/install/before-remove.sh --after-remove ../misc/scripts/install/after-remove.sh --description "Docker Volume Driver for vSphere" --architecture x86_64 --force -d 'docker-engine > 1.9' -t deb .
Force flag given. Overwriting package at ../build/docker-volume-vsphere_0.7.06a14a5_amd64.deb {:level=>:warn}
Created package {:path=>"../build/docker-volume-vsphere_0.7.06a14a5_amd64.deb"}
make: Leaving directory '/go/src/github.com/vmware/docker-volume-vsphere/vmdk_plugin'
../misc/scripts/build.sh rpm
make: Entering directory '/go/src/github.com/vmware/docker-volume-vsphere/vmdk_plugin'
#fpm --epoch 0 -p ../build -C package -s dir -n docker-volume-vsphere -v 0.7.06a14a5 --provides docker-volume-vsphere -m cna-storage@vmware.com --url https://github.com/vmware/docker-volume-vsphere --after-install ../misc/scripts/install/after-install.sh --before-remove ../misc/scripts/install/before-remove.sh --after-remove ../misc/scripts/install/after-remove.sh --description "Docker Volume Driver for vSphere" --architecture x86_64 --force -d 'docker > 1.9' -t rpm .
fpm --epoch 0 -p ../build -C package -s dir -n docker-volume-vsphere -v 0.7.06a14a5 --provides docker-volume-vsphere -m cna-storage@vmware.com --url https://github.com/vmware/docker-volume-vsphere --after-install ../misc/scripts/install/after-install.sh --before-remove ../misc/scripts/install/before-remove.sh --after-remove ../misc/scripts/install/after-remove.sh --description "Docker Volume Driver for vSphere" --architecture x86_64 --force -t rpm .
Force flag given. Overwriting package at ../build/docker-volume-vsphere-0.7.06a14a5-1.x86_64.rpm {:level=>:warn}
Created package {:path=>"../build/docker-volume-vsphere-0.7.06a14a5-1.x86_64.rpm"}
make: Leaving directory '/go/src/github.com/vmware/docker-volume-vsphere/vmdk_plugin'
promc-2n-dhcp255:docker-volume-vsphere sritesh$ make clean
/Applications/Xcode.app/Contents/Developer/usr/bin/make --directory=vmdk_plugin clean
rm -rf ../build .code_verify
/Applications/Xcode.app/Contents/Developer/usr/bin/make --directory=../esx_service clean
rm -rf vmware-esx-vmdkops-0.7.06a14a5.vib ../build/libvmci_srv.so ../build/libvmci_srv.so.64 ../build/descriptor.xml ../build/payloads
promc-2n-dhcp255:docker-volume-vsphere sritesh$

@govint
Copy link
Contributor Author

govint commented Oct 26, 2016

These are the steps used,


$ cd
$ mkdir vpl-new
$ cd vpl-new
$ git init
Initialized empty Git repository in /home/administrator/vpl-new/.git/

Build the plugin,


administrator@hte-1s-eng-dhcp98:/vpl-new$ git clone https://github.com/vmware/docker-volume-vsphere
Cloning into 'docker-volume-vsphere'...
remote: Counting objects: 6056, done.
remote: Compressing objects: 100% (78/78), done.
remote: Total 6056 (delta 33), reused 0 (delta 0), pack-reused 5978
Receiving objects: 100% (6056/6056), 7.68 MiB | 759.00 KiB/s, done.
Resolving deltas: 100% (3482/3482), done.
Checking connectivity... done.
administrator@hte-1s-eng-dhcp98:
/vpl-new$ cd docker-volume-vsphere/
administrator@hte-1s-eng-dhcp98:/vpl-new/docker-volume-vsphere$ make all^C
administrator@hte-1s-eng-dhcp98:
/vpl-new/docker-volume-vsphere$ make all ESX=10.110.48.29 VM1=10.110.48.49 VM2=10.110.48.54
make --directory=vmdk_plugin all
make[1]: Entering directory /home/administrator/vpl-new/docker-volume-vsphere/vmdk_plugin' rm -rf ../build .code_verify make --directory=../esx_service clean make[2]: Entering directory/home/administrator/vpl-new/docker-volume-vsphere/esx_service'
rm -rf vmware-esx-vmdkops-0.7.06a14a5.vib ../build/libvmci_srv.so ../build/libvmci_srv.so.64 ../build/descriptor.xml ../build/payloads
make[2]: Leaving directory `/home/administrator/vpl-new/docker-volume-vsphere/esx_service'
../misc/scripts/deploy-tools.sh cleanvm "10.110.48.49 10.110.48.54" "TestVolume"

......

../misc/scripts/build.sh build
make: Entering directory /go/src/github.com/vmware/docker-volume-vsphere/vmdk_plugin' go tool vet . gofmt -s -l -w . GO15VENDOREXPERIMENT=1 go build --ldflags '-extldflags "-static"' -o ../build/docker-volume-vsphere github.com/vmware/docker-volume-vsphere/vmdk_plugin GO15VENDOREXPERIMENT=1 go test -c -o ../build/vmdkops.test github.com/vmware/docker-volume-vsphere/vmdk_plugin/vmdkops GO15VENDOREXPERIMENT=1 go test -c -o ../build/docker-volume-vsphere.test github.com/vmware/docker-volume-vsphere/vmdk_plugin make --directory=../esx_service build make[1]: Entering directory/go/src/github.com/vmware/docker-volume-vsphere/esx_service'
cc -fPIC -m32 -shared -o ../build/libvmci_srv.so vmci/vmci_server.c
cc -fPIC -shared -o ../build/libvmci_srv.so.64 vmci/vmci_server.c
Staging in ../build/payloads
vibauthor --debug --compose --vib=../build/vmware-esx-vmdkops-0.7.06a14a5.vib --stage-dir ../build --offline-depot ../build/vmware-esx-vmdkops-0.7.06a14a5.zip --force
WARNING: a VIB file with "partner" acceptance level need to be signed
you can do it later using vibauthor with --sign option
Successfully created ../build/vmware-esx-vmdkops-0.7.06a14a5.vib.
Successfully created ../build/vmware-esx-vmdkops-0.7.06a14a5.zip.
make[1]: Leaving directory /go/src/github.com/vmware/docker-volume-vsphere/esx_service' make: Leaving directory/go/src/github.com/vmware/docker-volume-vsphere/vmdk_plugin'
../misc/scripts/build.sh deb
make: Entering directory '/go/src/github.com/vmware/docker-volume-vsphere/vmdk_plugin'
fpm --deb-no-default-config-files -p ../build -C package -s dir -n docker-volume-vsphere -v 0.7.06a14a5 --provides docker-volume-vsphere -m cna-storage@vmware.com --url https://github.com/vmware/docker-volume-vsphere --after-install ../misc/scripts/install/after-install.sh --before-remove ../misc/scripts/install/before-remove.sh --after-remove ../misc/scripts/install/after-remove.sh --description "Docker Volume Driver for vSphere" --architecture x86_64 --force -d 'docker-engine > 1.9' -t deb .
Created package {:path=>"../build/docker-volume-vsphere_0.7.06a14a5_amd64.deb"}
make: Leaving directory '/go/src/github.com/vmware/docker-volume-vsphere/vmdk_plugin'
../misc/scripts/build.sh rpm
make: Entering directory '/go/src/github.com/vmware/docker-volume-vsphere/vmdk_plugin'
#fpm --epoch 0 -p ../build -C package -s dir -n docker-volume-vsphere -v 0.7.06a14a5 --provides docker-volume-vsphere -m cna-storage@vmware.com --url https://github.com/vmware/docker-volume-vsphere --after-install ../misc/scripts/install/after-install.sh --before-remove ../misc/scripts/install/before-remove.sh --after-remove ../misc/scripts/install/after-remove.sh --description "Docker Volume Driver for vSphere" --architecture x86_64 --force -d 'docker > 1.9' -t rpm .
fpm --epoch 0 -p ../build -C package -s dir -n docker-volume-vsphere -v 0.7.06a14a5 --provides docker-volume-vsphere -m cna-storage@vmware.com --url https://github.com/vmware/docker-volume-vsphere --after-install ../misc/scripts/install/after-install.sh --before-remove ../misc/scripts/install/before-remove.sh --after-remove ../misc/scripts/install/after-remove.sh --description "Docker Volume Driver for vSphere" --architecture x86_64 --force -t rpm .
Created package {:path=>"../build/docker-volume-vsphere-0.7.06a14a5-1.x86_64.rpm"}
make: Leaving directory '/go/src/github.com/vmware/docker-volume-vsphere/vmdk_plugin'
../misc/scripts/deploy-tools.sh deployesx "10.110.48.29" "../build/vmware-esx-vmdkops-0.7.06a14a5.vib"

Files under build are owned by root


~/vpl-new/docker-volume-vsphere$ ls -lR build
build:
total 37692
-rw-r--r-- 1 root root 2503 Oct 26 03:26 descriptor.xml
-rwxr-xr-x 1 root root 11695217 Oct 26 03:26 docker-volume-vsphere
-rw-r--r-- 1 root root 3403107 Oct 26 03:26 docker-volume-vsphere-0.7.06a14a5-1.x86_64.rpm
-rw-r--r-- 1 root root 3436108 Oct 26 03:26 docker-volume-vsphere_0.7.06a14a5_amd64.deb
-rwxr-xr-x 1 root root 10685036 Oct 26 03:26 docker-volume-vsphere.test
-rwxr-xr-x 1 root root 8510 Oct 26 03:26 libvmci_srv.so
-rwxr-xr-x 1 root root 11217 Oct 26 03:26 libvmci_srv.so.64
drwxr-xr-x 3 root root 4096 Oct 26 03:26 payloads
-rwxr-xr-x 1 root root 9226420 Oct 26 03:26 vmdkops.test
-rw-r--r-- 1 root root 52514 Oct 26 03:26 vmware-esx-vmdkops-0.7.06a14a5.vib
-rw-r--r-- 1 root root 54803 Oct 26 03:26 vmware-esx-vmdkops-0.7.06a14a5.zip

@kerneltime
Copy link
Contributor

This change in PR #702 fixes this, clean is run inside docker runs.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

2 participants