Closed stephlocke closed 6 years ago
@stephlocke Thanks for opening this issue.
I agree that installation experience could be made a bit better on our part. Let me explain what I think about this cold start problem and onboarding of bits and pieces, such as volume drivers.
The problem with ("simple") bash scripts we provide is that they are often quite hard to maintain and support various distros (and their versions) simultaneously. Just to give an idea: https://get.docker.com/
The problem with Template deployments (what Flocker does) is, they often create a full solution (e.g. in Flocker case, it creates a Swarm cluster). We have a complete mix of users in orchestration layer who adopted Mesosphere DCOS and Kubernetes as well. It would be quite a hard solution to make and maintain a template that works for all. And, you may already have a cluster running, so deploying a new template is not going to update your existing cluster either.
For those reasons, I currently find it quite challenging to provide installation scripts that should work on multiple distros, platforms etc. If you are using only docker-machine, you can probably write down the installation commands as you execute and turn them into a bash script and feed to all your docker machines over "docker-machine ssh
Beyond that, I think any attempt to make simplifications to onboarding experience may actually come at the cost of creating more bugs and friction than we expected, so for now I think we will be keeping it as is (i.e. just have docs on the installation steps) ––but I am going to keep this issue open for future reference.
Thanks for getting back to me!
I agree it's not a trivial thing to achieve but it would be a useful template like the basic ubuntu docker template, or the wordpress & mysql one. These work on assuming a lot of default values - I think that's not an unreasonable decision given most devs will be concerned about running docker, not spinning up their machine.
Could this be part of a standard azure setup when the machine is provisioned with:
docker-machine create -d azure azure-machine-1
@buckett nope. docker-machine
is designed to do the same thing on all cloud providers and all distros.
Hi,
the next script (adapted from https://kvaes.wordpress.com/2016/03/23/docker-azure-testdriving-the-azure-file-storage-volume-driver/) and instructions will do the job.
the script
#!/bin/bash
STORAGEACCOUNT_NAME=$1
STORAGEACCOUNT_KEY=$2
if [ -z "$1" ]; then echo "Storage Account Name not set..." && exit 2 ; fi
if [ -z "$2" ]; then echo "Storage Account Key not set..." && exit 2 ; fi
echo "* Install Go / Cifs"
sudo apt-get install golang cifs-utils -y
echo "* Temp Structure"
TMP=/home/ops/tmp/azurefile
mkdir -p $TMP
cd $TMP
rm -rf $TMP/src
"echo* Get files"
cd $TMP
git clone --depth 1 https://github.com/Azure/azurefile-dockervolumedriver src/azurefile
export GOPATH=`pwd`
cd src/azurefile
go get github.com/tools/godep
$TMP/bin/godep restore
echo "* Build"
go build
echo "* Copy binary"
AZUREVD="/usr/bin/azurefile-dockervolumedriver"
sudo cp $TMP/src/azurefile/azurefile $AZUREVD
sudo chmod +x $AZUREVD
echo "* Setup Service"
cd $TMP/src/azurefile/contrib/init/systemd
# both the AF and the STORAGE variants have to be present 19/10/2016
sudo cp azurefile-dockervolumedriver.default /etc/default/azurefile-dockervolumedriver
sudo cp azurefile-dockervolumedriver.service /etc/systemd/system/azurefile-dockervolumedriver.service
echo "* Setting Storage Account Info"
sudo sed -i "s|youraccount|$1|g" /etc/default/azurefile-dockervolumedriver
sudo sed -i "s|yourkey|$2|g" /etc/default/azurefile-dockervolumedriver
echo "* Starting Services"
#sudo systemctl reload-configuration
#sudo systemctl start azurefile-dockervolumedriver
#.service file to /etc/systemd/system/azurefile-dockervolumedriver.service
sudo systemctl daemon-reload
sudo systemctl enable azurefile-dockervolumedriver
sudo systemctl start azurefile-dockervolumedrive
sudo systemctl status azurefile-dockervolumedriver
Mine was a lot simpler :/ https://gist.github.com/stephlocke/a02d7b8be42604e5b6bbd19d689ab28f
Although I didn't do any presetting of values on the basis that you would want to pass these per mounted directory
Protip: Don't forget set -e
and set -u
in your scripts. http://redsymbol.net/articles/unofficial-bash-strict-mode/
@ahmetalpbalkan on this - I was upgrading to 0.5.1 but the install process fails with a rather opaque error. It doesn't look like the install docs have changed - any ideas why it would fail from the different version?
config=$1
wget -qO /usr/bin/azurefile-dockervolumedriver https://github.com/Azure/azurefile-dockervolumedriver/releases/download/0.5.1/azurefile-dockervolumedriver
chmod +x /usr/bin/azurefile-dockervolumedriver
wget -qO /etc/systemd/system/azurefile-dockervolumedriver.service https://raw.githubusercontent.com/Azure/azurefile-dockervolumedriver/master/contrib/init/systemd/azurefile-dockervolumedriver.service
cp $config /etc/default/
systemctl daemon-reload
systemctl enable azurefile-dockervolumedriver
systemctl start azurefile-dockervolumedriver
systemctl status azurefile-dockervolumedriver
● azurefile-dockervolumedriver.service - Azure File Service Docker Volume Driver Loaded: loaded (/etc/systemd/system/azurefile-dockervolumedriver.service; enabled; vendor preset: enabled) Active: activating (auto-restart) (Result: exit-code) since Sun 2016-10-30 19:09:58 UTC; 9ms ago Docs: https://github.com/Azure/azurefile-dockervolumedriver/ Process: 5718 ExecStart=/usr/bin/azurefile-dockervolumedriver $AF_OPTS (code=exited, status=203/EXEC) Main PID: 5718 (code=exited, status=203/EXEC)
Oct 30 19:09:58 datadocker systemd[1]: azurefile-dockervolumedriver.service: Unit entered failed state. Oct 30 19:09:58 datadocker systemd[1]: azurefile-dockervolumedriver.service: Failed with result 'exit-code'. Created symlink from /etc/systemd/system/multi-user.target.wants/azurefile-dockervolumedriver.service to /etc/systemd/system/azurefile-dockervolumedriver.service. exit status 3
@stephlocke there should be more logs than this. Please look at journalctl.
If I run
systemctl daemon-reload
systemctl enable azurefile-dockervolumedriver
systemctl start azurefile-dockervolumedriver
systemctl status azurefile-dockervolumedriver
Config file being scp'd to machine. Key obfuscated, in zip for upload purposes. azurefile-dockervolumedriver.zip
Here are the outputs
Oct 31 18:08:25 datadocker systemd[1]: Started ACPI event daemon.
Oct 31 18:08:25 datadocker systemd[1]: Started Azure File Service Docker Volume Driver.
Oct 31 18:08:25 datadocker systemd[5903]: azurefile-dockervolumedriver.service: Failed at step EXEC spawning /usr/bin/azurefile-dockervolumedriver: Exec format errorOct 31 18:08:25 datadocker systemd[1]: azurefile-dockervolumedriver.service: Main process exited, code=exited, status=203/EXEC
Oct 31 18:08:25 datadocker systemd[1]: azurefile-dockervolumedriver.service: Unit entered failed state.
Oct 31 18:08:25 datadocker systemd[1]: azurefile-dockervolumedriver.service: Failed with result 'exit-code'.
Oct 31 18:08:25 datadocker systemd[1]: azurefile-dockervolumedriver.service: Service hold-off time over, scheduling restart.
Oct 31 18:08:25 datadocker systemd[1]: Stopped Azure File Service Docker Volume Driver.
Oct 31 18:08:25 datadocker systemd[1]: Started Azure File Service Docker Volume Driver.
Oct 31 18:08:25 datadocker systemd[5910]: azurefile-dockervolumedriver.service: Failed at step EXEC spawning /usr/bin/azurefile-dockervolumedriver: Exec format errorOct 31 18:08:25 datadocker systemd[1]: azurefile-dockervolumedriver.service: Main process exited, code=exited, status=203/EXEC
Oct 31 18:08:25 datadocker systemd[1]: azurefile-dockervolumedriver.service: Unit entered failed state.
Oct 31 18:08:25 datadocker systemd[1]: azurefile-dockervolumedriver.service: Failed with result 'exit-code'.
Oct 31 18:08:25 datadocker systemd[1]: azurefile-dockervolumedriver.service: Service hold-off time over, scheduling restart.
Oct 31 18:08:25 datadocker systemd[1]: Stopped Azure File Service Docker Volume Driver.
Oct 31 18:08:25 datadocker systemd[1]: Started Azure File Service Docker Volume Driver.
Oct 31 18:08:25 datadocker systemd[5914]: azurefile-dockervolumedriver.service: Failed at step EXEC spawning /usr/bin/azurefile-dockervolumedriver: Exec format errorOct 31 18:08:25 datadocker systemd[1]: azurefile-dockervolumedriver.service: Main process exited, code=exited, status=203/EXEC
Oct 31 18:08:25 datadocker systemd[1]: azurefile-dockervolumedriver.service: Unit entered failed state.
Oct 31 18:08:25 datadocker systemd[1]: azurefile-dockervolumedriver.service: Failed with result 'exit-code'.
Oct 31 18:08:25 datadocker systemd[1]: azurefile-dockervolumedriver.service: Service hold-off time over, scheduling restart.
Oct 31 18:08:25 datadocker systemd[1]: Stopped Azure File Service Docker Volume Driver.
Oct 31 18:08:25 datadocker systemd[1]: Started Azure File Service Docker Volume Driver.
Oct 31 18:08:25 datadocker systemd[5918]: azurefile-dockervolumedriver.service: Failed at step EXEC spawning /usr/bin/azurefile-dockervolumedriver: Exec format errorOct 31 18:08:25 datadocker systemd[1]: azurefile-dockervolumedriver.service: Main process exited, code=exited, status=203/EXEC
Oct 31 18:08:25 datadocker systemd[1]: azurefile-dockervolumedriver.service: Unit entered failed state.
Oct 31 18:08:25 datadocker systemd[1]: azurefile-dockervolumedriver.service: Failed with result 'exit-code'.
Oct 31 18:08:26 datadocker systemd[1]: azurefile-dockervolumedriver.service: Service hold-off time over, scheduling restart.
Oct 31 18:08:26 datadocker systemd[1]: Stopped Azure File Service Docker Volume Driver.
Oct 31 18:08:26 datadocker systemd[1]: Started Azure File Service Docker Volume Driver.
Oct 31 18:08:26 datadocker systemd[5923]: azurefile-dockervolumedriver.service: Failed at step EXEC spawning /usr/bin/azurefile-dockervolumedriver: Exec format errorOct 31 18:08:26 datadocker systemd[1]: azurefile-dockervolumedriver.service: Main process exited, code=exited, status=203/EXEC
Oct 31 18:08:26 datadocker systemd[1]: azurefile-dockervolumedriver.service: Unit entered failed state.
Oct 31 18:08:26 datadocker systemd[1]: azurefile-dockervolumedriver.service: Failed with result 'exit-code'.
Oct 31 18:08:26 datadocker systemd[1]: azurefile-dockervolumedriver.service: Service hold-off time over, scheduling restart.
Oct 31 18:08:26 datadocker systemd[1]: Stopped Azure File Service Docker Volume Driver.
Oct 31 18:08:26 datadocker systemd[1]: azurefile-dockervolumedriver.service: Start request repeated too quickly.
Oct 31 18:08:26 datadocker systemd[1]: Failed to start Azure File Service Docker Volume Driver.
@stephlocke it looks like the issue is Exec format error
. This would happen when the binary does not match the targeted OS/architecture. Are you sure you're downloading from releases tab and not compiling yourself? Is your machine running on intel 64-bit CPU architecture?
Ah, yes - I see, not the config file but the binary. I pull the 0.2.1 and 0.5.1 binary from the release page on here https://github.com/Azure/azurefile-dockervolumedriver/releases/download/[VERSION]/azurefile-dockervolumedriver
The only things I swap are 0.2.1 and 0.5.1 in the download URL. And d'oh I think it's PICNIC. Release tags went from a naked version number to being prefixed with a v. It'll probably work with the correct value. I'll let you know.
@stephlocke if you look a few comments above you'll see I suggested using set -e
which would've failed your script and prevented it from progressing in such failures. ;)
I tried that and it didn't error on it. Maybe because of nesting or something. sigh
So yep, PICNIC issue. v0.5.1 works
@stephlocke that's weird, can u try wget http://<bad-link>; echo ExitCode=$?
This driver is no longer supported and will not be maintained moving forward. We recommend users use CloudStor for Docker native solutions.
Thanks for your contribution, but to reduce confusion, we are closing issues, pull requests, and marking the repo as 'Archive' for the time being.
It would be super handy if there were simple bash scripts that could be executed to install the driver, especially on azure engine docker-machines
OR
Make a deploy to Azure button similar to how easy Flocker make it: https://docs.clusterhq.com/en/latest/docker-integration/