You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: labs/00-labs-01-getting_started/1.md
+2-10Lines changed: 2 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,8 +4,6 @@ This lab shows you how to create a DevNet Learning Lab.
4
4
5
5
## Objectives ##
6
6
7
-
Completion Time: 45 minutes
8
-
9
7
* Understand the structure of a DevNet Learning Lab
10
8
* Learn how to set up your working directory and its contents
11
9
* Understand basic Markdown syntax
@@ -14,7 +12,6 @@ Completion Time: 45 minutes
14
12
* Set up and use the Learning Lab Previewer Tool
15
13
* Begin writing your own Learning Lab
16
14
17
-
18
15
## Prerequisites
19
16
20
17
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
30
27
***Markdown Editor (Recommended)**
31
28
32
29
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
-
38
30
39
31
## Step 1. Understanding the Structure of Learning Labs
40
32
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
***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
120
112
121
113
## About the Learning Lab Previewer
122
114
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.**
124
116
125
117
<b>Figure: Learning Lab Previewer tool output in browser</b>
## Step 8. Installing and Running the Learning Lab Previewer Tool in Docker
2
2
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.
4
4
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.
6
6
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).
9
8
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).
10
10
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.
12
12
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:
17
14
18
15
1. Download the [Ubuntu Desktop ISO image](https://www.ubuntu.com/download).
19
16
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
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.
132
129
<!-- 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 -->
135
132
136
133
<b>Figure: Verifying the contents of the shared folder</b>
* If the `labs` folder does not appear in this listing, correct your shared folder settings.
141
138
* If you cannot access the shared content, take the following steps:
142
139
1. Add your username to the `vboxsf` group:
143
140
`sudo adduser `_yourusername_` vboxsf`
144
-
1. Reboot the VM
141
+
1. Reboot the VM.
145
142
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.
146
143
<br/><br/>
147
144
<!-- 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 -->
<!-- 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
+

225
177
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:
227
179
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
+
```
229
182
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.
234
184
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.
237
186
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
+

239
188
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.
241
190
191
+

242
192
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.-->
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.
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.
<!-- 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.
263
194
>**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.
0 commit comments