Git Product home page Git Product logo

voyant-docker's Introduction

voyant-docker

This contains everything you need to set up a Voyant server behind an SSL-enabled proxy, with corpora preloaded. (Well, sort of; see below.)

Setup

Warning: These instructions are incomplete. I need to add:

  • This assumes you're using a server with a domain name. You'll need to change a config file to use the correct domain name. If you don't have a domain name you'll need to make even more changes. I'll try to make that part easier, but can't right now.
  • This doesn't say how to access the "pre-loaded" corpora! Basically you just pass the path to the corpus to the input param in the url. I.e. '.../?input=.../corpora/my_corpus.zip' -- but that's pretty terse; I need to add more about that part.

This should work for any server running Ubuntu or Debian. Many of the details will be the same on other servers, but you may have to consult other sources for the docker and docker-compose installation processes. I assume you have admin access and, if necessary, know what sudo is and how to use it.

Install Docker

I've broken this down into invidual steps to explain what's going on, but you can just copy the shell commands and run them one-by-one. These steps are necessary to ensure that the most up-to-date version of Docker is being installed by the Ubuntu's package manager.

  1. First, we need to add the Docker repository key. This makes sure that the package manager knows to trust Docker's repository.

     curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    
  2. Next, we add the repository itself to the package manager's list of repositories:

     sudo add-apt-repository \
         "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    
  3. Having done so, we also have to tell the package manager to update its index of available packages:

     sudo apt-get update
    
  4. To confirm that we have done everything correctly, we run a quick check to see what versions of docker the package manager thinks are avaialble:

     apt-cache policy docker-ce
    

    If everything is working as expected, and assuming Docker isn't already installed, you should see something like this:

     terminal-prompt:~# apt-cache policy docker-ce
     docker-ce:
       Installed: (none)
       Candidate: 5:18.09.5~3-0~ubuntu-bionic
              ...
              ... more irrelevant lines ...
              ...
    
  5. Finally, we actually install Docker:

     sudo apt-get install -y docker-ce
    

Install Docker Compose

Installing Docker Compose is both more and less straightforward. More straightforward because we aren't using the package manager at all, and are just plunking a file down in one of the bin folders full of executable files. Less straightforward because, well, we are just plunking a file down, which means we don't get the network-of-trust guarantees that come from using a package manager.

Why don't we use a package manager? Because we need to install a more recent version of Docker Compose than is apparently available via any ordinary package manager setup.

Why is there not a way to install a recent-enough version using the package manager? I don't know. Hopefully that will change soon.

(By the way, these instructions are basically taken verbatim from the Digital Ocean docs.

  1. Download the docker-compose binary into /usr/local/bin:

     sudo curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
    
  2. Make the binary executable:

     sudo chmod +x /usr/local/bin/docker-compose
    
  3. Test to make sure the installation worked:

     sudo docker-compose --version
    

    If it worked, you should see something like this:

     docker-compose version 1.18.0, build 8dd22a9
     docker-py version: 2.6.1
     CPython version: 2.7.13
     OpenSSL version: OpenSSL 1.0.1t  3 May 2016
    

Set up the Voyant repository

  1. Make sure git is installed:

     sudo apt install git
    
  2. Clone (i.e. download) this repository:

     git clone https://github.com/senderle/voyant-docker
    
  3. Put your corpora in the corpora folder. Each corpus should be a single zip file containing text files (or any other kind of file that Voyant can load -- including word documents and html files). There is already one example corpus in the folder, called three-by-mary-shelley.zip.

Unfortunately this stage can't be condensed into a simple step. You will probably need to use a command like scp or set up sftp to do this. You could also fork this repository (if you do that kind of thing), add your corpora to the fork, and clone that instead in step 2.

  1. Build the docker images. To run this command, you'll need to move into the voyant-docker directory:

     cd voyant-docker
     sudo docker-compose build
    
  2. Run the server:

     sudo docker-compose up -d
    

    This runs the server in detatched mode, so you can log off and everything will keep working. To shut down the server, make sure you're in the voyant-docker folder and run this command:

     sudo docker-compose down
    

    Finally, if you think there are errors and want to see the messages, make sure you're in the `voyant-docker and run this command:

     sudo docker-compose up
    

    This attaches the server to your current terminal, so that you can't exit without shutting down the server. (There are ways to detatch again, but that's beyond the scope of this readme!)

voyant-docker's People

Contributors

senderle avatar mehimself avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.