Skip to content

Commit

Permalink
Merge pull request #12 from VISIONAI/tagfix
Browse files Browse the repository at this point in the history
Tagfix
  • Loading branch information
quantombone committed Feb 1, 2015
2 parents 053d0c7 + b7b4890 commit 6c38c69
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 27 deletions.
33 changes: 23 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
VMX makes computer vision easy. Docker makes bundling complex
applications easy. The vmx-docker-manager lets you run the VMX
Object Detection server on a Linux computer, or a (Mac/Windows)
machine via boot2docker. [We also provide a non-docker native Mac
OS X build of VMX].
machine via boot2docker.

##Requirements
64 bit Linux and Docker >= 1.2
64 bit Linux and Docker >= 1.2, root permissions to run Docker
boot2docker for Mac or Windows

##Instructions
Expand All @@ -23,14 +22,14 @@ Or download the shell script directly: https://raw.githubusercontent.com/VISIONA
Commands:
start PORT: Start vmx on localhost:PORT
stop: Stop vmx
enter: Shell access to docker
enter: Shell access to a Docker container for inspecting volumes
init : Download and start the containers that have the pre-reqs, mcr, etc.
(This is done automatically the first time you start vmx)
update TAG: Update your vmx (will stop vmx first). TAG must be
"latest" or "dev", defaults to "latest"
backup BACKUP: Backup your vmx data (models, session logs,
config file) to folder BACKUP
"latest" or "dev", defaults to "latest" when TAG is empty
backup BACKUP: Backup your vmx data (models and config file) to folder BACKUP
restore BACKUP: Restore from a backup

##Example:
Run vmx on port 3000

Expand Down Expand Up @@ -61,7 +60,17 @@ or
$ ./vmx update dev


##Permissions

vmx-docker-manager uses Docker which requires permission to run as root, or the
user to be added to the `docker` group.

To make sure Docker is installed and running correctly on your machine, you can first
try a simple Docker command such as:

```
docker run -t -i --rm ubuntu echo "Docker runs"
```

##Explanation

Expand All @@ -73,9 +82,13 @@ general, VMX requires a few files/folder to be available:
- Local Model storage
- Certain open source libraries

The VMX Docker manager is a set of sane defaults and configurations that store user data (session and models) in seperate volumes at /vmx/sessions and /vmx/models; and loads the binaries into /vmx/build. Those mount points, along with the matlab MCR dependency are run within the context of an Ubuntu 14.04 with the required libraries.
The VMX Docker manager is a set of sane defaults and configurations
that store user data (session and models) in seperate volumes at
/vmx/sessions and /vmx/models; and loads the binaries into /vmx/build.
Those mount points, along with the matlab MCR dependency are run
within the context of an Ubuntu 14.04 with the required libraries.

The dockerfiles that build the referenced docker images can be found here:
The Dockerfiles that build the referenced Docker images can be found here:

- https://github.com/VISIONAI/docker-mcr-2014a
- https://github.com/VISIONAI/docker-vmx-userdata
Expand Down
38 changes: 21 additions & 17 deletions vmx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
# VMX Docker Manager by vision.ai
# Starts the vision.ai object recognition server
# Requires docker >= 1.2; and perms to run docker
# Requires docker >= 1.2; and permissions to run docker
# Visit us on the web:
# https://vision.ai
# Github repository for this file:
Expand All @@ -19,23 +19,20 @@ FOLDERNAME=`date +%Y%a%b%d_%H%M%S`

init () {
echo "Starting containers..."
if [ "$VMXTAG" = ""]; then
VMXTAG=":$VMXTAG"
fi

docker run -d --name vmx-mcr visionai/mcr-2014a 2>/dev/null
docker run -d --name vmx-userdata visionai/vmx-userdata 2>/dev/null
docker run -d --name vmx-middle:$VMXTAG visionai/vmx-middle 2>/dev/null
docker run -d --name vmx-server:$VMXTAG visionai/vmx-server 2>/dev/null
docker run -d --name vmx-appbuilder:$VMXTAG visionai/vmx-appbuilder 2>/dev/null
docker run -d --name vmx-middle$VMXTAG visionai/vmx-middle 2>/dev/null
docker run -d --name vmx-server$VMXTAG visionai/vmx-server 2>/dev/null
docker run -d --name vmx-appbuilder$VMXTAG visionai/vmx-appbuilder 2>/dev/null
touch .vmx-init
}


usage () {
echo "VMX Docker Manager by vision.ai"
echo "Version: " `git describe --tags --dirty 2>/dev/null || echo no-git`
echo "Requires docker >= 1.2; and perms to run docker"
echo "Requires docker >= 1.2; and permissions to run docker"
echo "==============================================="
echo "Usage: vmx COMMAND [OPTIONS]"
echo
Expand Down Expand Up @@ -236,15 +233,15 @@ update_vmx(){
docker rm vmx-server 2>/dev/null
docker rm vmx-appbuilder 2>/dev/null

docker pull visionai/vmx-middle:$VMXTAG
docker pull visionai/vmx-server:$VMXTAG
docker pull visionai/vmx-appbuilder:$VMXTAG
docker pull visionai/vmx-middle$VMXTAG
docker pull visionai/vmx-server$VMXTAG
docker pull visionai/vmx-appbuilder$VMXTAG

docker run --name vmx-middle visionai/vmx-middle:$VMXTAG
docker run --name vmx-middle visionai/vmx-middle$VMXTAG
A=$?
docker run --name vmx-server visionai/vmx-server:$VMXTAG
docker run --name vmx-server visionai/vmx-server$VMXTAG
B=$?
docker run --name vmx-appbuilder visionai/vmx-appbuilder:$VMXTAG
docker run --name vmx-appbuilder visionai/vmx-appbuilder$VMXTAG
C=$?

#make a temp container for copying
Expand Down Expand Up @@ -281,7 +278,6 @@ case "$cmd" in
init
fi
export VMXHOSTPORT=$2
export VMXTAG=$3
start_vmx
exit 0
;;
Expand All @@ -293,7 +289,13 @@ case "$cmd" in
;;

update)

#Keep an empty TAG empy, and turn "dev" into ":dev"
export VMXTAG=$2
if [ "$VMXTAG" != "" ]; then
VMXTAG=":$VMXTAG"
fi

update_vmx
init
echo "Updated vmx"
Expand All @@ -318,10 +320,12 @@ case "$cmd" in
if [ ! -d .vmx-backup ]; then
echo "No .vmx-backup found.. have you done any backups?"
else
echo "try one of "
echo "Try one of the following commands:"
for b in .vmx-backup/*
do
echo ./vmx restore $b "\n"
echo ./vmx restore $b
NMODELS=`ls $b/models 2>/dev/null | wc -l`
echo "Has ${NMODELS} models\n"
done

exit 1
Expand Down

0 comments on commit 6c38c69

Please sign in to comment.