Skip to content

Commit

Permalink
Lab optimizations - 04.10.24 (#46)
Browse files Browse the repository at this point in the history
various lab optimizations before the TechLib labs release
  • Loading branch information
ankudinov authored Oct 4, 2024
1 parent 4266596 commit cac1569
Show file tree
Hide file tree
Showing 59 changed files with 143 additions and 447 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/techlib-vxlan-domain-a/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"image": "ghcr.io/${localEnv:GITHUB_REPOSITORY}/lab-base:python3.11-avd-v4.10.2-clab0.57.5-rev9",
// "image": "ghcr.io/${localEnv:GITHUB_REPOSITORY}/lab-base:python3.11-avd-v4.10.2-clab0.57.5-rev9",
"image": "ghcr.io/${localEnv:GITHUB_REPOSITORY}/lab-base:python3.11-avd-v4.10.2-clab0.57.5-rev1.0",
// containerEnv set the variables applied to entire container
"containerEnv": {
"ARISTA_TOKEN": "${localEnv:ARTOKEN}",
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/techlib-vxlan-domain-b/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"image": "ghcr.io/${localEnv:GITHUB_REPOSITORY}/lab-base:python3.11-avd-v4.10.2-clab0.57.5-rev9",
"image": "ghcr.io/${localEnv:GITHUB_REPOSITORY}/lab-base:python3.11-avd-v4.10.2-clab0.57.5-rev1.0",
// containerEnv set the variables applied to entire container
"containerEnv": {
"ARISTA_TOKEN": "${localEnv:ARTOKEN}",
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/techlib-vxlan-domain-c/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"image": "ghcr.io/${localEnv:GITHUB_REPOSITORY}/lab-base:python3.11-avd-v4.10.2-clab0.57.5-rev9",
"image": "ghcr.io/${localEnv:GITHUB_REPOSITORY}/lab-base:python3.11-avd-v4.10.2-clab0.57.5-rev1.0",
// containerEnv set the variables applied to entire container
"containerEnv": {
"ARISTA_TOKEN": "${localEnv:ARTOKEN}",
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/techlib-vxlan-domain-d/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"image": "ghcr.io/${localEnv:GITHUB_REPOSITORY}/lab-base:python3.11-avd-v4.10.2-clab0.57.5-rev9",
"image": "ghcr.io/${localEnv:GITHUB_REPOSITORY}/lab-base:python3.11-avd-v4.10.2-clab0.57.5-rev1.0",
// containerEnv set the variables applied to entire container
"containerEnv": {
"ARISTA_TOKEN": "${localEnv:ARTOKEN}",
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/container_build_child.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,20 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Check if image already exists on container registry 🕵️
id: check-image
run: |
echo "exit_code=0" >> $GITHUB_OUTPUT
IFS=',' read -ra image_tags <<< ${{ steps.build-tags.outputs.image_tags }}
for image_tag in "${image_tags[@]}"; do
echo "Checking if ghcr.io/${{ steps.gh_repo.outputs.name_lowcase }}/${{ inputs.container_name }}:$image_tag already exists."
docker manifest inspect ghcr.io/${{ steps.gh_repo.outputs.name_lowcase }}/${{ inputs.container_name }}:$image_tag || echo "exit_code=1" >> $GITHUB_OUTPUT
done
- name: Pre-build dev container image 🔨
uses: devcontainers/[email protected]
# Only build and push the image if at least one of the image tags does not exist.
if: steps.check-image.outputs.exit_code != 0
env:
FROM_IMAGE: ${{ inputs.from_image }}
FROM_VARIANT: ${{ inputs.from_variant }}
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/container_build_host_alpine.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# stop building alpine host container image until testing is complete
# and fist labs using this image are ready

---
name: Create alpine host container image

on:
push:
branches: ['**'] # branches will be filtered in the jobs
paths:
- .github/workflows/container_build_host_alpine.yml
- .github/workflows/container_build_child.yml
- containers/host-alpine/**
# push:
# branches: ['**'] # branches will be filtered in the jobs
# paths:
# - .github/workflows/container_build_host_alpine.yml
# - .github/workflows/container_build_child.yml
# - containers/host-alpine/**
workflow_dispatch:
branches: ['**'] # branches will be filtered in the jobs

Expand All @@ -20,6 +23,6 @@ jobs:
with:
container_name: "host-alpine"
# the rev number will be updated with each run
image_tags: "latest,rev${{ github.run_number }}"
image_tags: "latest,rev1.0"
from_image: "alpine"
from_variant: "latest"
2 changes: 1 addition & 1 deletion .github/workflows/container_build_host_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
with:
container_name: "host-ubuntu"
# the rev number will be updated with each run
image_tags: "latest,rev${{ github.run_number }}"
image_tags: "latest,rev1.0"
from_image: "ubuntu"
from_variant: "24.04"
username: "admin"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/container_build_parent_matrix.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: build techlib-labs containers
name: build lab-base images

on:
push:
Expand Down Expand Up @@ -30,4 +30,4 @@ jobs:
from_variant: ${{ matrix.from_variant }}
clab_version: ${{ matrix.clab_version }}
# the rev number will be updated with each run
container_revision: "${{ github.run_number }}"
container_revision: "1.0"
9 changes: 1 addition & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# acLabs (Arista Community Labs)

> WARNING: Under Construction!
To start the lab for testing, please use following links:

- [EVPN, domain-A](https://codespaces.new/aristanetworks/aclabs/tree/main?quickstart=1&devcontainer_path=.devcontainer%2Ftechlib-vxlan-domain-a%2Fdevcontainer.json)
- [EVPN, domain-B](https://codespaces.new/aristanetworks/aclabs/tree/main?quickstart=1&devcontainer_path=.devcontainer%2Ftechlib-vxlan-domain-b%2Fdevcontainer.json)
- [EVPN, domain-C](https://codespaces.new/aristanetworks/aclabs/tree/main?quickstart=1&devcontainer_path=.devcontainer%2Ftechlib-vxlan-domain-c%2Fdevcontainer.json)
- [EVPN, domain-D](https://codespaces.new/aristanetworks/aclabs/tree/main?quickstart=1&devcontainer_path=.devcontainer%2Ftechlib-vxlan-domain-d%2Fdevcontainer.json)
Please check [acLabs Web page](https://aclabs.arista.com/) for detailed documentation.
1 change: 1 addition & 0 deletions containers/dev/.devcontainer/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ mkdocs-material
mkdocs-macros-plugin
mdx_truly_sane_lists
cookiecutter
mkdocs-glightbox
3 changes: 1 addition & 2 deletions containers/host-ubuntu/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
// "version": "latest"
// }
},

// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "${localEnv:USERNAME}"
}
}
16 changes: 8 additions & 8 deletions containers/host-ubuntu/.devcontainer/pingcheck
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ set +e

if [ -f "$1" ]; then

while true
do
echo "fpinging the targets..."
fping -f $1
sleep 2
clear
done
echo "fpinging the targets..."
watch -n 0.5 fping -f $1

elif [ -f "/workspace/ip-lists/$1" ]; then

echo "fpinging the targets..."
watch -n 0.5 fping -f "/workspace/ip-lists/$1"

else

echo "You must provide a valid filename with target IP address list."

fi
fi
2 changes: 2 additions & 0 deletions labs/techlib-vxlan-domain-a/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ To connect to any device use:
ssh admin@<a-lab-device-hostname>
```

To check connectivity, ssh to any host and use `pingcheck ipv4_vrf_prod` or `pingcheck ipv4_vrf_dev` to start fping to the lab hosts. You have to wait a few minutes after the lab start for ping to be successful.

Enjoy the lab!
22 changes: 7 additions & 15 deletions labs/techlib-vxlan-domain-a/clab/topology.clab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ topology:
ceos:
image: arista/ceos:latest
linux:
image: ghcr.io/aristanetworks/aclabs/host-ubuntu:rev3
image: ghcr.io/aristanetworks/aclabs/host-ubuntu:rev1.0
binds:
- /techlib-vxlan-domain-a:/workspace:ro

Expand Down Expand Up @@ -111,6 +111,7 @@ topology:
# DC "A" HostC6 #
#########################

# HostA1 is connected to LEAF1 eth7 and LEAF2 eth7
HostA1:
kind: linux
mgmt-ipv4: 172.100.100.201
Expand All @@ -120,9 +121,8 @@ topology:
STATIC_ROUTE: 10.0.0.0/8
GW: 10.10.10.1
IPV6: 2001:db8:10:10::101/64
# exec:
# - bash /usr/local/bin/hostnetconfig.sh -b -i4 10.10.10.101/24 -i6 2001:db8:10:10::101/64 -g 10.10.10.1

# HostA2 is connected to LEAF1 eth8 and LEAF2 eth8
HostA2:
kind: linux
mgmt-ipv4: 172.100.100.202
Expand All @@ -132,21 +132,18 @@ topology:
STATIC_ROUTE: 10.0.0.0/8
GW: 10.30.30.1
IPV6: 2001:db8:30:30::101/64
# exec:
# - bash /usr/local/bin/hostnetconfig.sh -b -i4 10.30.30.101/24 -i6 2001:db8:30:30::101/64 -g 10.30.30.1

# HostA3 is a Linux host with a single interface connected to LEAF3 eth7
HostA3:
kind: linux
mgmt-ipv4: 172.100.100.203
env:
TMODE: lacp
IPV4: 10.50.50.101/24
STATIC_ROUTE: 10.0.0.0/8
GW: 10.50.50.1
IPV6: 2001:db8:50:50::101/64
# exec:
# - bash /usr/local/bin/hostnetconfig.sh -i4 10.50.50.101/24 -i6 2001:db8:50:50::101/64 -g 10.50.50.1

# HostA4 is connected to LEAF3 eth8 and LEAF4 eth8
HostA4:
kind: linux
mgmt-ipv4: 172.100.100.204
Expand All @@ -156,21 +153,18 @@ topology:
STATIC_ROUTE: 10.0.0.0/8
GW: 10.10.10.1
IPV6: 2001:db8:10:10::102/64
# exec:
# - bash /usr/local/bin/hostnetconfig.sh -b -i4 10.10.10.102/24 -i6 2001:db8:10:10::102/64 -g 10.10.10.1

# HostA5 is connected to LEAF4 eth7
HostA5:
kind: linux
mgmt-ipv4: 172.100.100.205
env:
TMODE: lacp
IPV4: 10.30.30.102/24
STATIC_ROUTE: 10.0.0.0/8
GW: 10.30.30.1
IPV6: 2001:db8:30:30::102/64
# exec:
# - bash /usr/local/bin/hostnetconfig.sh -i4 10.30.30.102/24 -i6 2001:db8:30:30::102/64 -g 10.30.30.1

# HostA6 is connected to LEAF5 eth7 and LEAF6 eth7
HostA6:
kind: linux
mgmt-ipv4: 172.100.100.206
Expand All @@ -180,8 +174,6 @@ topology:
STATIC_ROUTE: 10.0.0.0/8
GW: 10.70.70.1
IPV6: 2001:db8:70:70::101/64
# exec:
# - bash /usr/local/bin/hostnetconfig.sh -b -i4 10.70.70.101/24 -i6 2001:db8:70:70::101/64 -g 10.70.70.1

links:
######################
Expand Down
2 changes: 2 additions & 0 deletions labs/techlib-vxlan-domain-a/ip-lists/ipv4_vrf_dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
10.50.50.101
10.70.70.101
4 changes: 4 additions & 0 deletions labs/techlib-vxlan-domain-a/ip-lists/ipv4_vrf_prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
10.10.10.101
10.30.30.101
10.10.10.102
10.30.30.102
24 changes: 0 additions & 24 deletions labs/techlib-vxlan-domain-a/pingcheck/dualstack_list_vrf_dev

This file was deleted.

26 changes: 0 additions & 26 deletions labs/techlib-vxlan-domain-a/pingcheck/dualstack_list_vrf_prod

This file was deleted.

12 changes: 0 additions & 12 deletions labs/techlib-vxlan-domain-a/pingcheck/ipv4_list_vrf_dev

This file was deleted.

13 changes: 0 additions & 13 deletions labs/techlib-vxlan-domain-a/pingcheck/ipv4_list_vrf_prod

This file was deleted.

7 changes: 0 additions & 7 deletions labs/techlib-vxlan-domain-a/pingcheck/ipv6_list_vrf_dev

This file was deleted.

2 changes: 2 additions & 0 deletions labs/techlib-vxlan-domain-b/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ To connect to any device use:
ssh admin@<a-lab-device-hostname>
```

To check connectivity, ssh to any host and use `pingcheck dualstack_vrf_prod` or `pingcheck dualstack_vrf_dev` to start fping to the lab hosts. You have to wait a few minutes after the lab start for ping to be successful.

Enjoy the lab!
Loading

0 comments on commit cac1569

Please sign in to comment.