-
Notifications
You must be signed in to change notification settings - Fork 37
Plugins on Docker Hub
We publish official Overview plugins on Docker Hub. That means end users (and we) can install all plugins exactly the same way.
As an end user, how do you run a plugin? We'll assume you're running Overview on your own machine. To make that happen, see Setting up a development environment.
Is Overview running on your machine now? Great. Here's what you do.
-
Run Overview. It should be running at
http://localhost:9000
. -
Install Docker. The official Docker website has complete installation instructions: https://docs.docker.com/installation/.
-
Find a project. The full list is at https://registry.hub.docker.com/repos/overview/. A project might be named, say,
overview/overview-word-cloud
. -
Open a command prompt. The Docker instructions tell you how to do it on your operating system.
-
Run the project with a single command:
docker run -d -p 3000:3000 --name=overview-word-cloud overview/overview-word-cloud
. -
Figure out Docker's IP address. On Linux, you can use
localhost
. On Mac and Windows, it's almost certainly192.168.59.103
. -
Figure out your IP address -- anything that doesn't look like
localhost
,127.x.x.x
or::1
. Use172.17.42.1
on Linux and192.168.59.3
on Mac and Windows. -
Browse to Overview using your IP address (not
localhost
). For instance, http://172.17.42.1:9000 (Linux) or http://192.168.59.3:9000 (Mac and Windows). If that doesn't work, check our troubleshooting section. -
Use the plugin. Open a document set in Overview. Click on
Add view
->Custom…
. Enter any name, and choosehttp://[Docker IP]:3000
. (That'shttp://localhost:3000
on Linux,http://192.168.59.103:3000
on Mac and Windows.) Click through the SSL warning, then chooseCreate Visualization
. -
(optional) Register the plugin. If you plan on using this visualization a lot, you can set up a shortcut for it. From Overview's main page, go to
Admin
->Plugins
. Enter a name and description, and use the Docker URL from the previous step. (That'shttp://localhost:3000
on Linux,http://192.168.59.103:3000
on Mac and Windows.) -
Run more plugins! You can run lots and lots of plugins at the same time. Just repeat the "Find a project" and "Run the project" commands as above. But instead of
-p 3000:3000
, use-p 3001:3000
. When you use your plugin in Overview, use:3001
instead of:3000
in the plugin URL. (With plugin number three, use3002:3000
and:3002
. Et cetera.)
Whew! Now, here are some commands that will prove useful:
-
List running plugins:
docker ps
-
Read plugin logs.
docker logs overview-word-cloud
. To show new log messages as they appear, rundocker logs -f overview-word-cloud
. -
Shut down a plugin.
docker rm -f overview-word-cloud
My browser shows Connection refused
when I try to open Overview at http://172.17.42.1:9000
(Linux) or http://192.168.59.3:9000
(Mac/Windows).
Check that you can see Overview at http://localhost:9000
. If you can't, Overview isn't set up properly; go to Setting up a development environment.
If localhost
works and the other address we supplied doesn't, that's because we were lazy: we just guessed what the IP address would be, and we guessed wrong. You can find an address like so:
-
Linux: Find the address by running
ip -o addr show docker0 | cut -d'/' -f1
. -
Mac OS: Find the address by running
ifconfig | grep 'Link\|inet'
. Try out the "inet addr" values whose names start withvboxnet
first; otherwise, any other address (except127.0.0.1
) will work. -
Windows: Run
ipconfig
. If you can spot avboxnet
in the noise, try out the associated address; but really, any address (except127.0.0.1
) will work.
The above-mentioned commands might list several IP addresses; there's no harm in trying them all. Type each into your browser bar: http://[ip address]:9000
. Use whichever address works.
First, check that the plugin is running. You should see it when you run docker ps
.
If the plugin isn't running, then try running the docker run
command from above again. If it still doesn't work, the plugin code might be faulty. Please contact us ... and maybe try out a second plugin, to be sure.
If the plugin is running, then please excuse our laziness: we guessed at an IP address, and we were wrong. Find Docker's IP address like so:
-
Linux: Find the address by running
ip -o addr show docker0 | cut -d'/' -f1
. -
Mac/Windows: Find the address by running
boot2docker ip
.
Plug that IP address into Overview: that is, http://[ip address]:3000
.
Docker Hub automatically rebuilds each plugin we've registered, so you need only follow these steps once:
- Add a
Dockerfile
to the project. Also add a.dockerignore
, which should probably be very similar to.gitignore
. The.dockerignore
can save a lot of time when building images. - Run
docker build -t test-app .
to ensure the Dockerfile is correct. - Run
docker run -t -i -p 3000:3000 --name=test-app test-app
(or pick a different port: say,3005:3000
) and ensure you can use the plugin correctly from within Overview. Make sure you're using the correct IP addresses and ports, as specified above. When you're done testing, kill it withdocker rm -f test-app
. - Commit the Dockerfile and push it to GitHub.
- Register the plugin: From https://registry.hub.docker.com/repos/ go to
Add Repository
->Automated Build
. ChooseGitHub
(you're sharing private repositories, right?) and thenSelect
the repository you want. Change theNamespace
tooverview
, and clickCreate Repository
. - Wait until the build completes.
- Rejoice.
-
Create a VPC named
plugins
, at10.10.0.0/16
. -
Create a subnet named
plugins
, on VPCplugins
at10.10.10.0/24
. Ensure the subnet has a route table with an internet gateway. - Go to AWS web console ->
EC2
->Load Balancers
->Create Load Balancer
- Name it
plugins
and put it in theplugins
VPC. (It should not be an "internal load balancer".) - Choose HTTPS (443) to port 80. (This won't point to anything, but we need it to continue.) Choose the
plugins
subnet. - In
Step 2: Assign Security Groups
, create a new security group calledplugins-load-balancer
that allows access to ports3000-3999
from anywhere. - Upload the
*.overviewdocs.com
SSL certificate: the private key, public certificate, and certificate chain. Name itSTAR.overviewdocs.com
. Use thePredefined Security Policy
to select a cipher suite. - Leave the
Health Check
defaults. Don't add anyEC2 Instances
. Add a tag,Name
=plugins
. -
Create an ECS cluster.
aws ecs create-cluster --cluster-name plugins
-
Create ecsInstanceRole: iAM ->
Roles
->Create New Role
->ecsInstanceRole
and attach the policyAmazonEC2ContainerServiceforEC2Role
. -
Create ecsServiceRole: iAM ->
Roles
->Create New Role
->ecsServiceRole
and attach the policyAmazonEC2ContainerServiceRole
. -
Launch an instance as specified at http://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_container_instance.html. Use instance type
t2.large
. Ensure the instance has a public IP. Do choseAdvanced Details
to setECS_CLUSTER=plugins
as explained in the guide. Choose a30GB
gp2 volume, tagName=plugins
, a newplugins
security group that allows access to ports3000-3999
fromplugins-load-balancer
. Choose whatever keypair -- we should never need to connect to this instance via SSH. - Register an elastic IP for the load balancer.
- Point plugins.overviewdocs.com to the elastic IP.
- Ensure the plugin is registered on Docker Hub under the
overview
organization. - Clone https://github.com/overview/overview-plugins
- Pick a port, by looking in
plugins.txt
- Run
./register.sh [plugin name] [port] [memory]
- Commit and push
- Run `./deploy.sh [plugin name]