Docker image guide
Added steps for setting up and running spyglass in Docker image Change-Id: Ib168c12306608d19df66fc7961d1ceb28d46f5f1
This commit is contained in:
parent
261b064b65
commit
e431be4217
15
README.rst
15
README.rst
|
@ -1,3 +1,18 @@
|
|||
..
|
||||
Copyright 2019 AT&T Intellectual Property.
|
||||
All Rights Reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
not use this file except in compliance with the License. You may obtain
|
||||
a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
License for the specific language governing permissions and limitations
|
||||
under the License.
|
||||
|
||||
What is Spyglass?
|
||||
-----------------
|
||||
|
|
|
@ -0,0 +1,86 @@
|
|||
..
|
||||
Copyright 2019 AT&T Intellectual Property.
|
||||
All Rights Reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
not use this file except in compliance with the License. You may obtain
|
||||
a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
License for the specific language governing permissions and limitations
|
||||
under the License.
|
||||
|
||||
==================================
|
||||
Running Spyglass in a Docker Image
|
||||
==================================
|
||||
|
||||
This is a guide to creating a docker image locally and running spyglass in the
|
||||
docker image.
|
||||
|
||||
1.) Before creating the spyglass image, insure you have cloned Spyglass_,
|
||||
`Spyglass Excel plugin`_, and that you have installed `Docker CE`_.
|
||||
|
||||
2.) Update the MakeFile with desired Linux distribution::
|
||||
|
||||
DISTRO=(ubuntu_xenial or ubuntu_bionic or opensuse_15)
|
||||
|
||||
3.) If necessary, change the PROXY variable to your proxy and change the
|
||||
USE_PROXY to true in the Makefile.
|
||||
|
||||
4.) Go to the spyglass directory in Terminal and run ``make images``. When the
|
||||
build is done, you will see ``Successfully built <DOCKER_IMAGE>``
|
||||
|
||||
5.) From your home directory, create a new directory to store the output from
|
||||
docker with the following command:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
mkdir tmp/ && mkdir tmp/spyglass
|
||||
|
||||
6.) Run Spyglass with the following command. The -v tag is used to mount the
|
||||
necessary local folders to the docker image. You must use the full path to the
|
||||
local folders you are mounting to. The path following the ':' is a path inside
|
||||
the docker container. These folders will be made automatically by docker.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
docker run -v /path/to/input/files:/mnt/input \
|
||||
-v /path/to/tmp/spyglass:/mnt/output_d \
|
||||
-v /path/to/tmp/spyglass:/mnt/output_m \
|
||||
<DOCKER_IMAGE> spyglass excel documents -i \
|
||||
-x /mnt/input/<excel_file_name> \
|
||||
-e /mnt/input/<excel_spec_name> \
|
||||
-c /mnt/input/<site_config_name> \
|
||||
-s <site_name> -t /mnt/input/<templates_folder> \
|
||||
-d /mnt/output_d -m /mnt/output_m
|
||||
|
||||
Example
|
||||
^^^^^^^
|
||||
The following shows the command used to create the site manifest and
|
||||
intermediary in the docker container using the example files provided in
|
||||
Spyglass and the Spyglass Excel Plugin. (``/root/path/`` is the path to
|
||||
spyglass in your directory)
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
docker run \
|
||||
-v /root/path/spyglass/spyglass/examples/:/mnt/examples \
|
||||
-v /root/path/spyglass-plugin-xls/spyglass_plugin_xls/examples:/mnt/examples_xls \
|
||||
-v /root/path/tmp/spyglass:/mnt/output_i \
|
||||
-v /root/path/tmp/spyglass:/mnt/output_m \
|
||||
<DOCKER_IMAGE> spyglass excel documents -i \
|
||||
-x /mnt/examples_xls/SiteDesignSpec_v0.1.xlsx \
|
||||
-e /mnt/examples_xls/excel_spec.yaml \
|
||||
-c /mnt/examples/site_config.yaml \
|
||||
-s airship-seaworthy \
|
||||
-t /mnt/examples/templates \
|
||||
-d /mnt/output_i/ \
|
||||
-m /mnt/output_m/
|
||||
|
||||
.. _Spyglass: getting_started.html#basic-usage
|
||||
.. _`Spyglass Excel Plugin`: https://opendev.org/airship/spyglass-plugin-xls/src/branch/master/doc/source/getting_started.rst
|
||||
.. _`Docker CE`: https://docs.docker.com/install/
|
|
@ -65,7 +65,7 @@ Architecture
|
|||
|
||||
Supported Features
|
||||
------------------
|
||||
1. Spyglass XLS Plugin: https://opendev.org/airship/spyglass-plugin-xls
|
||||
1. `Spyglass XLS Plugin <https://opendev.org/airship/spyglass-plugin-xls>`_
|
||||
|
||||
Future Work
|
||||
-----------
|
||||
|
@ -120,14 +120,18 @@ Basic Usage
|
|||
Before using Spyglass you must:
|
||||
|
||||
|
||||
1. Clone the Spyglass repository:
|
||||
1.) Clone the Spyglass repository::
|
||||
|
||||
.. code-block:: console
|
||||
git clone https://opendev.org/airship/spyglass.git
|
||||
|
||||
git clone https://opendev.org/airship/spyglass.git
|
||||
2.) Install the required packages in spyglass::
|
||||
|
||||
2. Install the required packages in spyglass:
|
||||
pip3 install pipenv && pipenv install
|
||||
|
||||
.. code-block:: console
|
||||
3.) Launch the pipenv from your spyglass directory::
|
||||
|
||||
pip3 install pipenv && pipenv install
|
||||
pipenv shell
|
||||
|
||||
4.) Install Spyglass into the pipenv::
|
||||
|
||||
pip3 install .
|
||||
|
|
|
@ -34,3 +34,4 @@ fed to Shipyard for site deployment / updates.
|
|||
getting_started
|
||||
developer_quickstart
|
||||
cli
|
||||
docker_guide.rst
|
||||
|
|
Loading…
Reference in New Issue