Skip to content

Commit

Permalink
add cvurl support to evpn aa demo
Browse files Browse the repository at this point in the history
  • Loading branch information
ankudinov committed Jun 18, 2024
1 parent 50b0c03 commit b7b8cb5
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,22 @@
},
"secrets": {
"CV_API_TOKEN": {
"description": "CVaaS service account token."
"description": "(Optional) CVaaS service account token. Required only if CVaaS will be part of the demo."
// "documentationUrl": "https://example.com/link/to/info"
},
"ARTOKEN": {
"description": "token to auto-download EOS images from arista.com."
// "documentationUrl": "https://example.com/link/to/info"
},
"CVURL": {
"description": "(Optional) URL to be used to access CVaaS. Default is `cv-staging.corp.arista.io`"
// "documentationUrl": "https://example.com/link/to/info"
}
},
"hostRequirements": {
"cpus": 4,
"memory": "16gb",
"storage": "32gb"
"cpus": 8,
"memory": "32gb",
"storage": "64gb"
},
"postCreateCommand": "postCreate.sh",
"workspaceMount": "source=${localWorkspaceFolder}/demos/${containerWorkspaceFolder},target=/${containerWorkspaceFolder},type=bind",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cvaas-cvaas-and-avd-demo--evpn-aa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ jobs:
from_variant: "python3.11-avd-v4.7.1"
username: "avd"
clab_version: "0.54.2"
ceos_lab_version: "4.30.6M"
ceos_lab_version: "4.32.1F"
git_init: True
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,16 @@ set +e
grep -rl '{{gh.repo_name}}' . --exclude-dir .git | xargs sed -i 's/{{gh.repo_name}}/'"${GITHUB_REPOSITORY##*/}"'/g'
grep -rl '{{gh.org_name}}' . --exclude-dir .git | xargs sed -i 's/{{gh.org_name}}/'"${GITHUB_REPOSITORY%%/*}"'/g'
grep -rl '{{gh.repository}}' . --exclude-dir .git | xargs sed -i 's@{{gh.repository}}@'"${GITHUB_REPOSITORY}"'@g'
# update URL in clab init configs if set
if [ "${CVURL}" ]; then
grep -rl 'cv-staging.corp.arista.io' . --exclude-dir .git | xargs sed -i '[email protected]@'"${CVURL}"'@g'
fi

CVTOKEN=$(curl -H "Authorization: Bearer ${CV_API_TOKEN}" "https://www.cv-staging.corp.arista.io/api/v3/services/admin.Enrollment/AddEnrollmentToken" -d '{"enrollmentToken":{"reenrollDevices":["*"],"validFor":"24h"}}' | sed -n 's|.*"token":"\([^"]*\)".*|\1|p')
if [ "${CVURL}" ]; then
CVTOKEN=$(curl -H "Authorization: Bearer ${CV_API_TOKEN}" "https://www.${CVURL}/api/v3/services/admin.Enrollment/AddEnrollmentToken" -d '{"enrollmentToken":{"reenrollDevices":["*"],"validFor":"24h"}}' | sed -n 's|.*"token":"\([^"]*\)".*|\1|p')
else
CVTOKEN=$(curl -H "Authorization: Bearer ${CV_API_TOKEN}" "https://www.cv-staging.corp.arista.io/api/v3/services/admin.Enrollment/AddEnrollmentToken" -d '{"enrollmentToken":{"reenrollDevices":["*"],"validFor":"24h"}}' | sed -n 's|.*"token":"\([^"]*\)".*|\1|p')
fi
echo "$CVTOKEN" > ${CONTAINERWSF}/clab/cv-onboarding-token
ardl get eos --image-type cEOS --version ${CEOS_LAB_VERSION} --import-docker

Expand Down
10 changes: 5 additions & 5 deletions demos/cvaas-cvaas-and-avd-demo--evpn-aa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

This lab is tested for:

cEOS-lab version: 4.30.6M
cEOS-lab version: 4.32.1F
Containerlab Version: 0.54.2
Codespace Container Size
CPUs: 4
memory: 16 GB
storage: 32 GB
CPUs: 8
memory: 32 GB
storage: 64 GB

Last reviewed: 02/05/2024
Last reviewed: 18/06/2024

Please check the lab materials:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[defaults]
forks = 1
forks = 5
inventory = inventory.yml
jinja2_extensions = jinja2.ext.loopcontrols,jinja2.ext.do,jinja2.ext.i18n
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ avd_data_validation_mode: error

daemon_terminattr:
cvaddrs:
- "{{ lookup('ansible.builtin.env', 'CVURL', default='apiserver.cv-staging.corp.arista.io') }}:443"
- "apiserver.cv-staging.corp.arista.io:443"
cvauth:
method: token-secure
token_file: "/mnt/flash/cv-onboarding-token"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ all:
CV_SERVERS:
hosts:
lab_cv_instance:
ansible_host: "{{ lookup('ansible.builtin.env', 'CVURL', default='www.cv-staging.corp.arista.io') }}"
ansible_host: "www.cv-staging.corp.arista.io"

AVD_FABRIC:
children:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ topology:
kinds:
ceos:
enforce-startup-config: true
image: arista/ceos:4.30.6M
image: arista/ceos:4.32.1F
defaults:
kind: ceos
extras:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,20 @@

## Demo Details

!!! Success "Container Requirements"
!!! Warning "Container Requirements"

CPUs: 4
Memory: 16 GB
Storage: 32 GB
CPUs: 8
Memory: 32 GB
Storage: 64 GB

:material-checkbox-marked-outline: Works with default Codespaces sizing!

!!! Warning "WARNING!"

While the lab is tested and works well on 4 CPUs, it is very close to the limit.
That means lab can take longer time to start and Codespaces can become unstable during some high CPU activities.
For this reason the number of Ansible forks was decreased to 1 and it is recommended to watch CPU utilization (bottom of Codespace window) and wait for it to settle before starting the next CPU intensive task.
Alternatively you can click `Change options` button when starting the Codespace and pick 8-core machine type or higher for better performance and stability. In that case you can also increase the number of Ansible forks in `ansible.cfg` to the default 5.
:material-alert-circle-outline:{ .heartbeat } Please request high spec Codespace machines from [Github support](https://support.github.com/) first!

[Start "CVaaS and AVD Demo, EVPN AA" in Codespace](https://codespaces.new/{{gh.repository}}?quickstart=1&devcontainer_path=.devcontainer%2Fcvaas-cvaas-and-avd-demo--evpn-aa%2Fdevcontainer.json){ .md-button .md-button--primary target=_blank}

[Slides](https://{{gh.org_name}}.github.io/{{gh.repo_name}}/slides/cvaas-cvaas-and-avd-demo--evpn-aa.html){ target=_blank }
[PDF Slides](https://{{gh.org_name}}.github.io/{{gh.repo_name}}/pdfs/cvaas-cvaas-and-avd-demo--evpn-aa.pdf){ target=_blank }

!!! Info "Last reviewed: 02/05/2024"
!!! Info "Last reviewed: 18/06/2024"

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
[Slides](https://{{gh.org_name}}.github.io/{{gh.repo_name}}/slides/cvaas-cvaas-and-avd-demo--evpn-mlag.html){ target=_blank }
[PDF Slides](https://{{gh.org_name}}.github.io/{{gh.repo_name}}/pdfs/cvaas-cvaas-and-avd-demo--evpn-mlag.pdf){ target=_blank }

!!! Info "Last reviewed: 01/05/2024"
!!! Info "Last reviewed: 18/06/2024"

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

Expand Down

0 comments on commit b7b8cb5

Please sign in to comment.