lucidworks/fusion-doc-builder

Name: fusion-doc-builder

Owner: Lucidworks

Description: Docker container for building docs

Created: 2015-09-14 08:40:29.0

Updated: 2018-05-15 09:47:59.0

Pushed: 2018-05-15 09:47:58.0

Homepage: null

Size: 17

Language: Shell

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

fusion-doc-builder

Docker container for building Lucidworks Fusion docs.

NOTE: This is a public repo.

Docker for Mac / Docker for Windows

Download and install the appropriate flavor of the Docker tools for your machine:

Details on this toolset are found in this Docker blogpost

Set up .ssh id files for GitHub

This docker container will be used to build the Fusion documentation from the Lucidworks GitHub repo Lucidworks/Fusion-docs. GitHub provides two ways to clone a directory: Clone with SSH or Clone with HTTPS.

Clone with HTTPS

If you clone with HTTPS, git will prompt you for you GitHub login and password.

Clone with SSH

Cloning with SSH uses the SSH authentication agent, name ssh-agent which uses the file ~/.ssh/id_rsa.

  1. To create an id_rsa file, run the command: ssh-keygen -t rsa -b 4096.
  2. Make sure that your GitHub account settings include this public key: go to https://github.com/settings/ssh, click the “New SSH Key” button in the top-right, and paste your rsa_id.pub into the “Key” area.
  3. Finally, make these available to the SSH authentication agent via command: ssh-add.
Run Docker/Kitematic
Mac

On the MacOS, when the Docker app is running, the docker whale icon will be present in the top toolbar. If it isn't running, launch the Docker app from the Applications folder. Clicking on this icon opens the drop-down menu, choose “Open Kitematic”

Note: if Kitematic is not already installed, the Docker app will provide a download link. Use this to download the .zip file which contains the app. The Mac OS security won't allow this app run and it will fail with message that the download is corrupt. There is a workaround described here

Windows

Launch Docker, launch Kitematic.

Create fusion-doc-builder, login to container, checkout Fusion-docs repo
  1. In the search field, enter fusion-doc-builder.
  2. In the search results, click Create on fusion-doc-builder.
  3. Once the fusion-doc-builder container is running, Kitematic displays the access URLs for all open ports. Find the access URL for port 22, the port reserved for ssh access. e.g., Docker port 22/tcp, access URL localhost:32769.
  4. Launch the Docker CLI.
  5. Run ssh-add.
  6. Log in to the container as the “jenkins” user, using the access URL port and IP address for port 22: ssh -p <port> jenkins@<IP-address>. The user “jenkins” has password “jenkins”.
  7. Clone the Fusion-docs repo (it's a private repo, hence the need for GitHub SSH key):
    clone git@github.com:Lucidworks/Fusion-docs.git
    
Build the Fusion documentation site
  1. Choose the version of the documentation to build:
  2. cd Fusion-docs
  3. git checkout <version-to-build>
  4. Run the build script: ./build.sh.
Test the build using jekyll serve

Jekyll is a Ruby application and uses the following environment variable to locate jekyll and its components: PATH, GEM_HOME, GEM_PATHS The following command sequence will set up the jekyll server in the docker container and serve the generated site in directory Fusion-docs/jekyll/_site:

ekyll
rt PATH=/usr/local/bundle/bin:$PATH
rt GEM_HOME=/usr/local/bundle
rt GEM_PATHS=/usr/local/bundle:/usr/local/lib/ruby/gems/2.3.0
ll serve --host 0.0.0.0  --skip-initial-build --no-watch

The Jekyll server runs on port 4000 by default. In Kitematic, find the access URL for the container's 4000/tcp port. For example if Kitematic lists localhost:32771 as the access URL, to browse the documentation the browser request URL would be: http://<container port access url 32771/index.html.

Build the Fusion documentation pdfs
  1. Run the script ./build-print.sh to generate the set of pdfs.
  2. Copy these back to your host machine using docker cp

from your host machine command line:

er cp fusion-doc-builder:/home/jenkins/Fusion-docs/pdfs/Fusion_Documentation_3_0.pdf .

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.