Skip to content

Commit eb680e1

Browse files
authored
Merge pull request #26 from CiscoDevNet/images-missing
Revise with the maintained docker image
2 parents 641f595 + 44e60c0 commit eb680e1

2 files changed

Lines changed: 27 additions & 106 deletions

File tree

labs/00-labs-01-getting_started/1.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ This lab shows you how to create a DevNet Learning Lab.
44

55
## Objectives ##
66

7-
Completion Time: 45 minutes
8-
97
* Understand the structure of a DevNet Learning Lab
108
* Learn how to set up your working directory and its contents
119
* Understand basic Markdown syntax
@@ -14,7 +12,6 @@ Completion Time: 45 minutes
1412
* Set up and use the Learning Lab Previewer Tool
1513
* Begin writing your own Learning Lab
1614

17-
1815
## Prerequisites
1916

2017
To write a DevNet Learning Lab, you'll need a basic understanding of `git` workflows. Optionally, you can [install a local git client](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git), a repository browser (such as [Atlassian SourceTree](https://www.sourcetreeapp.com)) and a specialized markdown editor (such as [Atom](https://atom.io/)).
@@ -30,11 +27,6 @@ To write a DevNet Learning Lab, you'll need a basic understanding of `git` workf
3027
* **Markdown Editor (Recommended)**
3128

3229
You can write a DevNet Learning Lab entirely in the Web-based GUI to the DevNet repository or you can use any text editor that you prefer. However, a specialized Markdown editor can simplify the job. We recommend the [Atom text editor](https://atom.io/) because it provides syntax highlighting for Markdown, JSON and HTML, as well as an interactive Markdown previewer and other handy features.
33-
<!--
34-
It's a good idea to associate your markdown files such as 1.md with your markdown editor to make file access easier.
35-
-->
36-
37-
3830

3931
## Step 1. Understanding the Structure of Learning Labs
4032
To help users learn more easily, all Learning Labs provide a consistent structure and format. To make it easier for other DevNet members to contribute to Learning Lab projects, all files in the repository observe certain conventions for naming and placement.
@@ -74,7 +66,7 @@ Each page in the end-user navigable lab corresponds to a single markdown file in
7466

7567
<b>Figure: Numeric filenames</b>
7668
<br/> <br/>
77-
![](assets/images/md_files.png)
69+
![](posts/files/00-labs-01-getting_start/assets/images/md_files.png | width=200)
7870
<br/><br/>
7971

8072
* **Image files must meet the following specification**
@@ -120,7 +112,7 @@ Each page in the end-user navigable lab corresponds to a single markdown file in
120112

121113
## About the Learning Lab Previewer
122114

123-
Use of the Learning Lab Previewer tool is essential, as it provides the only way to preview the lab outside of the the Production DevNet environment. **All learning lab authors must preview their work with the Learning Lab Previewer tool and make corrections before requesting publishing.**
115+
The Learning Lab Previewer tool provides a way to preview the lab outside of the Production DevNet environment. **All learning lab authors must preview their work with the Learning Lab Previewer tool and make corrections before requesting publishing.**
124116

125117
<b>Figure: Learning Lab Previewer tool output in browser</b>
126118
<br/><br/>
Lines changed: 25 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
## Step 8. Installing and Running the Learning Lab Previewer Tool in Docker
22

3-
Markdown previewers vary in their rendering capabilities as well as in their interpretations of various flavors of Markdown. To preview your lab content as it will appear on the DevNet site, you must install the __Learning Lab Previewer (LLP)__ tool on your computer.
3+
Markdown previewers vary in their rendering capabilities as well as in their interpretations of various flavors of Markdown. To preview your lab content, run a Docker container with a previewer tool.
44

5-
If your installation of the LLP tool on other platforms is unsuccessful, you can install [Docker](https://www.docker.com/products/overview), which provides a container in which to install the LLP tool. To download and install the LLP tool inside a Docker container with Ubuntu as the operating system in a Virtual Box virtual machine, follow these instructions. To use a different environment, see either of the following:
5+
To run the previewer within a Docker container with Ubuntu as the operating system in a Virtual Box virtual machine, follow these instructions.
66

7-
* [Installing and Running the Learning Lab Previewer Tool on Windows 7]()
8-
* [Installing and Running the Learning Lab Previewer Tool in Ubuntu]()
7+
> **Note:** Although it is possible to install Docker on the Windows operating system (OS), certain requirements (must be Pro or higher version) and bugs may prevent the previewer from working properly. As a workaround, we recommend that Windows users install Docker Container on a [Ubuntu 16.04 LTS](https://www.ubuntu.com/download/server) virtual machine that runs on [Virtual Box](https://www.virtualbox.org/wiki/Downloads).
98
9+
DevNet has created a Dockerfile that containerizes the previewer. For instructions on how to install the previewer on a Unix-based operating system, see the [BitBucket Repository](https://bitbucket-eng-sjc1.cisco.com/bitbucket/projects/DLL/repos/learning-labs-previewer/browse/README.md).
1010

11-
> **Note:** Although it is possible to install Docker on the Windows operating system (OS), certain requirements (must be Pro or higher version) and bugs may prevent the LLP from working properly. As a workaround, we recommend that Windows users install Docker Container on a [Ubuntu 16.04 LTS](https://www.ubuntu.com/download/server) virtual machine that runs on [Virtual Box](https://www.virtualbox.org/wiki/Downloads).
11+
>**Note:** To access the Docker image stored on containers.cisco.com, you must be on a Cisco trusted network or you must establish a VPN connection to the Cisco network.
1212
13-
DevNet has created a Dockerfile that containerizes the LLP application. For instructions on how to install the LLP on a Unix-based operating system, see the [LLP GitHub Repository](https://github.com/CiscoDevNet/llp) and [video instructions](https://cisco.jiveon.com/videos/38761).
14-
>**Note:** To create the docker image you must be on a Cisco trusted network or you must establish a VPN connection to the Cisco network. Alternatively, you can [download the prebuilt docker image](https://cisco.box.com/s/05kjlvobv2jf3lz23ozz9gg66cfdcs3b) and load it to your local repository by using the `docker load < llp.tar` command.
15-
16-
To use LLP in a Docker container that runs on an Ubuntu virtual machine, take the following steps:
13+
To use the previewer in a Docker container that runs on an Ubuntu virtual machine, take the following steps:
1714

1815
1. Download the [Ubuntu Desktop ISO image](https://www.ubuntu.com/download).
1916
Be sure that you choose a "desktop" version, which provides the GNOME GUI and support for Web browsers that run in GNOME.
@@ -110,23 +107,23 @@ To use LLP in a Docker container that runs on an Ubuntu virtual machine, take th
110107

111108
<b>Figure: Installing updates</b>
112109
<br/><br/>
113-
![](posts/files/00-labs-01-getting_started/assets/images/ubuntu_5.png)
110+
![](assets/images/ubuntu_5.png)
114111

115112
8. After the update completes, issue the following command to install all necessary dependencies:
116113

117114
`sudo apt install -y dkms build-essential linux-headers-generic linux-headers-$(uname -r)`
118115

119116
<b>Figure: Installing dependencies</b>
120117
<br/><br/>
121-
![](posts/files/00-labs-01-getting_started/assets/images/ubuntu_6.png)
118+
![](assets/images/ubuntu_6.png)
122119

123120
9. Finally, issue the following command to make everything you just installed ready for use.
124121

125122
`sudo mount /dev/sr0/ /media/cdrom/; sudo /media/cdrom/VBoxLinuxAdditions.run; sudo reboot`
126123

127124
<b>Figure: Mounting the shared disk and rebooting the VM</b>
128125
<br/><br/>
129-
![](posts/files/00-labs-01-getting_started/assets/images/ubuntu_7.png)
126+
![](assets/images/ubuntu_7.png)
130127

131128
10. When the machine comes back online, authenticate and issue the `ls /media/sf_*` command. It should display the contents of your working directory in the VM.
132129
<!-- I recall a lot of screwing around to get this to work. Had to add a command to .bash_profile or something. That was actually on a
@@ -135,13 +132,13 @@ LL setup file for that step. e.g. it might be in 7.md in this lab // jp -->
135132

136133
<b>Figure: Verifying the contents of the shared folder</b>
137134
<br/><br/>
138-
![](posts/files/00-labs-01-getting_started/assets/images/ubuntu_8.png)
135+
![](assets/images/ubuntu_8.png)
139136

140137
* If the `labs` folder does not appear in this listing, correct your shared folder settings.
141138
* If you cannot access the shared content, take the following steps:
142139
1. Add your username to the `vboxsf` group:
143140
`sudo adduser `_yourusername_` vboxsf`
144-
1. Reboot the VM
141+
1. Reboot the VM.
145142
1. Recheck your access to the shared folder by issuing `ls /media/sf_*` or by using your graphical desktop environment to look inside the `Computer/Media/sf_labs` folder.
146143
<br/><br/>
147144
<!-- at this point can we unmount the VBOXADDITIONS cd-rom? otherwise it always gets mounted (from my shared mac folder) -->
@@ -152,118 +149,50 @@ LL setup file for that step. e.g. it might be in 7.md in this lab // jp -->
152149

153150
<b>Figure: Updating the `apt` source list</b>
154151
<br/><br/>
155-
  ![](posts/files/00-labs-01-getting_started/assets/images/ubuntu_9.png)
152+
  ![](assets/images/ubuntu_9.png)
156153

157154
12. To add a new GNU Privacy Guard (GPG) key, issue the following command in the terminal window:
158155

159156
`sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D`
160157

161158
<b>Figure: Adding a GNU Privacy Guard key</b>
162159
<br/><br/>
163-
![](posts/files/00-labs-01-getting_started/assets/images/ubuntu_10.png)
160+
![](assets/images/ubuntu_10.png)
164161

165162
13. To add a new repository for `apt` search, issue the following command in your terminal window:
166163

167164
`echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list`
168165

169166
<b>Figure: Adding a new repository for `apt` search</b>
170167
<br/><br/>
171-
![](posts/files/00-labs-01-getting_started/assets/images/ubuntu_11.png)
168+
![](assets/images/ubuntu_11.png)
172169

173170
14. Now, you are ready to install Docker; to do so, issue the following command in your terminal window:
174171

175172
`sudo apt update ; sudo apt install -y linux-image-extra-$(uname -r) linux-image-extra-virtual docker-engine; sudo service docker start`
176173

177174
<b>Figure: Installing Docker</b>
178175
<br/><br/>
179-
![](posts/files/00-labs-01-getting_started/assets/images/ubuntu_12.png)
180-
181-
15. After the installation process completes, download the Docker image to your home directory by issuing the following command:
182-
183-
`wget https://cisco.box.com/shared/static/05kjlvobv2jf3lz23ozz9gg66cfdcs3b.tar`
184-
<!-- you might need anyconnect for this: download from https://developer.cisco.com/site/devnet/sandbox/anyconnect/
185-
install guide https://devnetsandbox.cisco.com/Docs/VPN_Access/AnyConnect_Installation_Guide.pdf
186-
you will need this info too https://technicalsanctuary.wordpress.com/2016/05/28/installing-cisco-anyconnect-vpn-on-ubuntu-16-04/
187-
It appears you can just use wget or curl for the actual download, but you need the VPN connection to reach the box server
188-
Not sure whether that is true, either. I killed the VPN connection and actually did resolve cisco.box.com and began downloading from
189-
the stock ubuntu install without a vpn connection. IDK whether the download would complete or verify without that. Ask Armen.
190-
In the meantime, I went ahead and used the docker image that I had previously downloaded for a previous version of these instructions.
191-
wget is not a native tool on mac os. curl syntax is tricky. To do this on mac, execute
192-
curl -L -o 'your_name_for_tarfile.tar' 'https://cisco.box.com/shared/static/05kjlvobv2jf3lz23ozz9gg66cfdcs3b.tar'
193-
the -L follows redirects and the -o writes to a file instead of to the screen; note that the order of the paths is different on mac!aaaargh
194-
article that solved my curl problem on mac is https://www.cyberciti.biz/faq/mac-os-x-terminal-download-file/
195-
-->
196-
<b>Figure: Downloading the Docker image</b>
197-
<br/><br/>
198-
![](posts/files/00-labs-01-getting_started/assets/images/ubuntu_13.png)
199-
200-
16. To load the docker image to docker's local repository, issue the following command:
201-
`sudo docker load < 05kjlvobv2jf3lz23ozz9gg66cfdcs3b.tar`
202-
<!-- assumes you did not rename the file, which may have been the case if you used curl or some other tool-->
203-
204-
![](posts/files/00-labs-01-getting_started/assets/images/ubuntu_14.png)
205-
206-
17. To verify that image was loaded successfully, issue the `sudo docker images` command; it should produce a listing like the following:
207-
208-
![](posts/files/00-labs-01-getting_started/assets/images/ubuntu_15.png)
209-
210-
11. In your home directory create a `config.json` file that specifies the local filesystem path to the labs to be previewed.
211-
<!-- jwp to do: if I get this thing working, update this path to /media/sf_LearningLabs"
212-
For example, if your labs are in the `/media/sf_labs/` folder, create a file named `config.json` that contains the following:
213-
`{"labPath":"/media/sf_labs/"}`
214-
215-
To create this file from the terminal window, issue the following command:
216-
`echo '{"labPath":"/media/sf_labs/"}' > config.json`
217-
218-
<!-- NOW is a good time to back up your machine or your VM because I've yet to recover successfully from a mistake in the next step!!!! -->
219-
220-
18. You are now ready to start the Learning Lab Previewer (LLP) application.
221-
222-
<!-- unfortunately there is a critical error in the original learning lab or the docker image. When I start the llp with incorrect syntax as below, it runs but it looks in the wrong place (/data/labs). Creating /data/labs does not help.
223-
224-
sudo docker run -p9000:9000 --name llp -v /media/sf_LearningLabs:/data -d cisco/llp
176+
![](assets/images/ubuntu_12.png)
225177

226-
This seems to mean that i should share the parent (so that labs/ appears in the bound volume) and maybe name the mount point for the shared folder sf_LearningLabs (for now at least). if that works, then i can see whether config.json even matters (it seems not to, as it has an incorrect path now that does not appear in the LLP). Another thing to try is just skipping the shared volume and putting labs somewhere locally till I can get that working, then revisit the shared folder
178+
15. After the installation process completes, run:
227179

228-
-->
180+
```docker run -p "9000:9000" -p "35729:35729" -v "{full path to labs directory}/labs:/opt/labs" containers.cisco.com/asroach/learning-labs-previewer:latest
181+
```
229182

230-
<div>
231-
**IMPORTANT**
232-
Before issuing the following command **CHECK the value of _pathToYourLabs_ CAREFULLY!** If it is incorrect, recovery may not be trivial. In particular, the directory name MUST end with a forward slash (/\).
233-
<div>
183+
To stop the container runtime, type ctrl-C.
234184

235-
To start the LLP tool, issue the following command:
236-
`sudo docker run -p9000:9000 --name llp -v` _pathToYourLabs_`:/data -d cisco/llp`
185+
19. To access the previewer, you need the IP address of the ubuntu VM. Issue `ifconfig` command and note the inet addr value associated with the physical Ethernet interface. For example, in the following figure, this interface is `enp0s3` and `192.168.0.16` is its IP address.
237186

238-
For example, if `/media/sf_labs/` is the path to the folder that your host machine shared with the ubuntu VM, then this command would be as follows; if you shared a different folder, update the path appropriately:
187+
![](assets/images/ubuntu_17.png)
239188

240-
`sudo docker run -p9000:9000 --name llp -v /media/sf_labs/:/data -d cisco/llp`
189+
20. On the machine that hosts Docker (for example, your Windows machine, or the Ubuntu VM into which you installed Docker), use your preferred Web browser to view port 9000 at the IP address you identified in the previous step. For example, in the following figure, the URL to browse is `http://192.168.0.16:9000`. If everything is working correctly, you should see the **Learning Labs Previewer** web page; under the **lab** column, you will find the lab that you created during this tutorial. Click **Preview** to view a rendition of this content.
241190

191+
![](assets/images/llp_1.png)
242192

243-
<!-- at least, that's how things went for me. I need to follow up with Armen. My experience was that any mistakes in this command are the kiss of death. The point of no return. Even uninstalling and reinstalling docker does not solve it. I did manage to get the LLP running (but not showing any labs) the first time I did this, so I know that these directions are close to correct but not quite there. We should include a recovery procedure for mistakes in this command, because it is not realistic to expect people to reinstall docker. I happened to have saved off a VM that had most of the work done so it wasn't too bad, but it was still more fooling around than should be required for one typo.-->
244-
245-
![](posts/files/00-labs-01-getting_started/assets/images/ubuntu_16.png)
246-
247-
19. To access the LLP application, you need the IP address of the ubuntu VM. Issue `ifconfig` command and note the inet addr value associated with the physical Ethernet interface. For example, in the following figure, this interface is `enp0s3` and `192.168.0.16` is its IP address.
248-
249-
![](posts/files/00-labs-01-getting_started/assets/images/ubuntu_17.png)
250-
251-
20. On the machine that hosts Docker (for example, your Windows machine, or the Ubuntu VM into which you installed Docker), use your preferred Web browser to view port 9000 at the IP address you identified in the previous step. For example, in the following figure, the URL to browse is `http://192.168.0.16:9000`. If everything is working correctly, you should see the **Learning Labs Previewer** web page; under the **lab** column, you will find the lab that you created during this tutorial. Click **Preview** to view the LLP rendition of this content.
252-
253-
![](posts/files/00-labs-01-getting_started/assets/images/llp_1.png)
254-
255-
<!-- THE FOLLOWING HIDDEN BECAUSE I'M NOT SURE IT'S TRUE. There was no config.json file in my llp, and IDK whether it's because i forgot to create it or for some other reason. Creating one did not enable LLP to find my labs, possibly because I used the wrong path when starting up LLP in Docker.
256-
257-
If you don't see the labs, you probably specified the path incorrectly in your `config.json` file. Revise the path then reload the browser page the displays the previewer. If you need to restart the previewer, use the following command:
258-
`sudo docker restart llp`
259-
260-
-->
261-
262-
21. After you click the **Preview** button, the contents of `1.md` file will be displayed. Verify that everything works and check next pages if you have them. The most important things to look for is missing images. As you can see the page is broken up into two sections; the upper section shows converted markdown file and the lower section shows original code. This feature helps you to find and identify the issue in the code right away.
193+
21. Click the **Preview** button to display the `1.md` file. Verify that everything works and check next pages if you have them. The most important thing to look for is missing images. As you can see the page is broken up into two sections; the upper section shows converted markdown file and the lower section shows original code. This feature helps you to find and identify the issue in the code right away.
263194
>**Note:** If you received an error after click **Preview** button it means there is a syntax error in the `.json` file. The error should point where the problem is.
264195
265-
![](posts/files/00-labs-01-getting_started/assets/images/llp_2.png)
266-
267-
196+
![](assets/images/llp_2.png)
268197

269198
#### Next Step: Take the Next Step Toward Writing Learning Labs

0 commit comments

Comments
 (0)