Skip to content

Commit

Permalink
update clab
Browse files Browse the repository at this point in the history
  • Loading branch information
ankudinov committed May 30, 2024
1 parent 1914059 commit daa1e75
Show file tree
Hide file tree
Showing 9 changed files with 118 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/clab-build-containerlab-with-ceos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ jobs:
from_image: "ghcr.io/aristanetworks/avd/base"
from_variant: "python3.11"
username: "avd"
clab_version: "0.54.2"
ceos_lab_version: "4.30.6M"
git_init: True
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
"br",
"sup"
]
}
},
// disable as MD046 is not behaving correctly with Mkdocs
"MD046": false
},
"markdown.marp.enableHtml": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ USER ${USERNAME}
RUN /bin/addAliases.sh

# install the latest yamllint and eos-downloader
RUN pip3 install --user yamllint \
RUN bash -c "$(curl -sL https://get.containerlab.dev)" -- -v ${CLAB_VERSION} \
&& pip3 install --user yamllint \
&& pip install --user "eos-downloader>=0.10.1"
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"FROM_IMAGE": "${localEnv:FROM_IMAGE}",
"FROM_VARIANT": "${localEnv:FROM_VARIANT}",
"USERNAME": "${localEnv:USERNAME}",
"CLAB_VERSION": "${localEnv:CLAB_VERSION}",
"CEOS_LAB_VERSION_ARG": "${localEnv:CEOS_LAB_VERSION_ARG}",
"GIT_INIT_ARG": "${localEnv:GIT_INIT_ARG}"
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
113 changes: 107 additions & 6 deletions docs/clab-build-containerlab-with-ceos.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Build Containerlab with cEOS

!!! Info "What is this workshop about"

This workshop is a step-by-step guide explaining how to build a lab environment with [Containerlab](https://containerlab.srlinux.dev/) and Arista cEOS-lab. It is focusing on essential and cEOS-lab specific features. Please check [Containerlab documentation](https://containerlab.srlinux.dev/) for more details.

!!! Warning "Lab Documents Not Finished"

DO NOT ENTER! :skull_and_crossbones:{ .heartbeat }
Expand All @@ -25,7 +29,7 @@
[Slides](https://{{gh.org_name}}.github.io/{{gh.repo_name}}/slides/clab-build-containerlab-with-ceos.html){ target=_blank }
[PDF Slides](https://{{gh.org_name}}.github.io/{{gh.repo_name}}/pdfs/clab-build-containerlab-with-ceos.pdf){ target=_blank }

!!! Info "Last reviewed: 02/05/2024"
!!! Info "Last reviewed: 30/05/2024"

Demos and labs reviewed over 6 month age may be outdated.

Expand All @@ -39,7 +43,7 @@ It is possible to run the lab on your local machine (or any server) instead of u
You can [download all required lab files here](https://arista-netdevops-community.github.io/one-click-se-demos/lab_archives/clab-build-containerlab-with-ceos.tar.gz).
However you must take care of you VSCode setup and setting up environment variables. Also keep in mind that auto-downloaded image will not work on ARM-based MacBooks.

## How To Run The Demo
## How To Run The Workshop

???+ Tip "Wait until cEOS-lab image will be imported"

Expand All @@ -48,11 +52,108 @@ However you must take care of you VSCode setup and setting up environment variab
For example due to incorrecte token or other API failure on arista.com.
In that case you can upload the image manually by right-clicking the Explorer tab of the VSCode interface.

To run the labs in this workshop, you can use one of the following options:

- Build you own Ubuntu VM from scratch. (Recommended!)
- This option will allow you to experience the entire cLab enviroment build process from the very start, without any pre-installed dependancies
- Requirements
- Ubuntu LTS 22.04 or later
- 8 GB RAM and 4 vCPUs
- Start the [Github Codespace](https://codespaces.new/{{gh.repository}}?quickstart=1&devcontainer_path=.devcontainer%2Fclab-build-containerlab-with-ceos%2Fdevcontainer.json) from this repository. (Fastest!)
- Open the lab dev container locally on your laptop with Docker Desktop or sever with Docker CE:
- you can [download required files here](https://arista-netdevops-community.github.io/one-click-se-demos/lab_archives/clab-build-containerlab-with-ceos.tar.gz) and open them in VSCode
- when running the lab locally, you must set all required environment variables on your machine

## CPU Architechture

- Only x86 CPU architecture is supported!
- It is technically possible to [run Container lab on ARM](https://containerlab.dev/install/#containerlab-on-arm-based-macs), but there are no network device images available for ARM as of May 2024.

## Setup Docker on the Host

> Check if Docker is already installed. In this case you can skip the steps below.
1. Install Docker on the host. The detailed instructions are available [here](https://docs.docker.com/engine/install/ubuntu/). You can used one-liner script for that.
2. Add your user to the `docker` group.
3. Logout and login again to apply the changes.
4. Check the Docker version and run `hello-world` container to test functionality.
5. You must be able to run `docker` commands without `sudo` if it was installed correctly.

```bash
# install Docker
sudo curl -fsSL https://get.docker.com | sh
# add user to the docker group
sudo usermod -aG docker ${USER}
# test docker
docker --version
docker run hello-world
```

> **NOTE**: If you are running this workshop in Codespace or provided dev container, Docker is pre-installed. As the workshop magic happens inside a container in this case, we rely on Docker-in-Docker concept to provide required functionality.
## Setup Git (Optional)

- Git must be pre-installed on a Linux system. Otherwise you are in a wrong place. Escape! 👾 🚀
- Setup your name and email address:

```bash
git config --global user.name "<first-and-2nd-name>"
git config --global user.email "<your-email>"
```

- Check the current configuration:

```bash
git config --list
```

> **NOTE**: On Codespace Git is pre-installed and pre-configured.
## Download cEOS-lab Image

1. Login to [Arista Software Download](https://www.arista.com/en/support/software-download) portal. You need to have an account to download the image.
2. Select `EOS > Active Releases > 4.30 > EOS-4.30.6M > cEOS-lab`.
3. Download `cEOS-lab-4.30.6M.tar.xz` image.
4. Upload the image to your lab VM. For example, you can use SFTP to transfer the image:

```bash
sftp ${REMOTE_USER}@${UBUNTU_VM_IP}:/home/${REMOTE_USER}/${IMAGE_DIR} <<< $'put cEOS-lab-4.30.6M.tar*'
# for example:
# sftp [email protected]:/home/user/images <<< $'put cEOS-lab-4.30.6M.tar*'
```
> If Github Codespace or provided Dev Container is used and the Arista token is set, the image will be pulled from arista.com automatically.
![bg right 80%](assets/img/clab-build-containerlab-with-ceos/ceos-download.png)
## Import cEOS-lab Image
1. Go to the directory with the uploaded image and import the image:
```bash
docker import cEOS-lab-4.30.6M.tar.xz arista/ceos:4.30.6M
```
> NOTE: you can also import the image with the tag latest to allow quick "upgrade" of those lab where specific version is not required: `docker tag arista/ceos:4.30.6M arista/ceos:latest`
2. Confirm that the image was imported successfully:
```console
$ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
arista/ceos 4.30.6M 21b540a4a343 45 minutes ago 1.95GB
arista/ceos latest 21b540a4a343 45 minutes ago 1.95GB
hello-world latest b038788ddb22 3 months ago 9.14kB
```
## Install Containerlab
It's just a one-liner:

```bash
# 1. start cLab
make start
bash -c "$(curl -sL https://get.containerlab.dev)"
```

???+ Tip "Wait until all devices will start streaming to CVaaS."
Refer to the [Containerlab quick start documentation](https://containerlab.dev/quickstart/) for the details.

This may take a while.
> Containerlab is pre-installed if you are using Codespaces.
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ markdown_extensions:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
# allows list ident with 2 spaces
- mdx_truly_sane_lists

copyright: >
&nbsp;&#x1F36A;&nbsp;<a href="#__consent">Change cookie settings</a>
Expand Down
1 change: 1 addition & 0 deletions slides/clab-build-containerlab-with-ceos.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ docker run hello-world
```

- Refer to the [Containerlab quick start documentation](https://containerlab.dev/quickstart/) for the details.
- Containerlab is pre-installed if you are using Codespaces.

---

Expand Down

0 comments on commit daa1e75

Please sign in to comment.