Getting started with Arista Community Labs
This guide is intended for individuals looking to familiarize themselves with the steps necessary to get started with Arista Community Labs, powered by GitHub Codespaces.
Pre-Requisites
Before launching an Arista Community Lab, the following pre-requisites must be met:
- Arista account(1) with the ability to download cEOS-lab via Software Downloads
- GitHub account
- GitHub Codespaces Access(2)
- Arista user token
-
Need an account? Register here! Arista account registration.
The email address used for the account must be associated with a corporate email domain (no Gmail, Yahoo, etc.).
-
For those that have never used Codespaces before, no worries! There is a quick primer on Codespaces included below!
We can find the user token by logging into arista.com and selecting My Profile
.
The tabs below illustrate the steps needed to locate and copy the token:
What's with the token?
When an Arista Community Lab is started, the user token will be used to automatically download and import the necessary cEOS-lab image into the lab environment.
GitHub Codespaces Primer
Overview
GitHub Codespaces can instantiate a fully configured development or lab environment hosted entirely on GitHub's cloud infrastructure with a simple click of a button, on any machine. Making the environments incredibly portable!
In the Arista Community Labs, we pre-package these Codespaces with the tools necessary to interact with the nodes within the lab. Quick examples are Python, Ansible, and Ansible Galaxy collections such as AVD, CVP, and EOS.
Docker in Docker in alignment with the Dev Container Specification makes this possible in Codespaces.
Costs
GitHub Codespaces is a commercial offering from GitHub. As of October 2024, all GitHub users have 120 hours of Codespace time available for free each month.
By default, if all 120 hours are consumed and the Spending Limit for Codespaces is $0, then Codespace usage cannot continue until the hours are replenished the following month.
When and how would GitHub charge me for this?💰
A GitHub user will never be charged for Codespace usage by default. The feature will stop working until the hours are renewed the next month.
Users can define a Payment Method and Spending Limit for Codespaces. Once defined, usage beyond 120 hours can continue as long as the spending limit is not exceeded. Once a defined spending limit has been reached, Codespace usage cannot continue until the next month.
Additional information can be found in GitHub's Codespaces Billing Overivew Page
What if I forget about my Codespace?
Don't worry! It won't run forever, at least not by default.
The Default idle timeout
and Default retention period
values can be modified within GitHub Codespaces Settings.
These parameters can be changed at any time, and should be defined with values that make the most sense for your usage patterns.
A general recommendation for these values is provided below:
- Default idle timeout:
30 Minutes
- Default retention period:
1 Day
Codespaces can be deleted at anytime from the Codespaces section of GitHub.
Machine Types
Different machine types are available within Codespaces. As a general rule, the greater the number of CPU cores, the greater number of hours that will be consumed during a Codespace's runtime.
GitHub's Pricing for Paid Usage chart provides the details of the usage multiplier
for each available machine type.
For example, as of the writing of this guide:
-
2 Core
Machine Types will consume2
hours for every hour of runtime -
8 Core
Machine Types will consume8
hours for every hour of runtime -
16 Core
Machine Types will consume16
hours for every hour of runtime
Some Arista Community Labs make use of larger machine types, such as the 16 Core
option.
My GitHub Account doesn't have access to a larger 8 Core
or 16 Core
machine types?
By default, some larger machine types may not be available for use. In order to resolve this, a ticket can be opened via GitHub support requesting access to these larger machine types.
Listed below is a template that can be used for this request:
Hello - Can the 8-core and 16-core codespace machine types please be enabled for my account?
The default 2-core and 4-core machines lack the necessary resources for my use cases.
A payment method has been added to my account. If additional information is needed, please let me know.
Thanks!
Once completed, select Create a Ticket
Starting the Lab
Note
All community labs hosted via Codespaces will follow a similar process to the one defined below. Labs that contain exceptions to the process below will have this specifically called out via a note associated with the lab launch button.
Once a lab has been launched via it's respective 'Start Lab' button, a Create Codespace
window will be opened via a web browser:
In the ARTOKEN
field, paste the user token copied from the arista.com user profile. This is a one time requirement, and will be saved for all subsequent Arista Community Lab deployments.
Where is the token saved?
Once entered, the token is saved as a GitHub Codespaces Secret
. This can be viewed via the Codespaces section of GitHub account settings.
Watch the expiration date!
User tokens on arista.com have an expiration date listed in the Token Valid Till
field in the Portal Access
section of the user profile.
If the token has expired, click Regenerate Token to create a new one. A token expires one year after it was generated; the user cannot modify this value.
Once the token has been entered, and Create new Codespace
has been selected, a new tab will open in the browser containing the codespace
Wait...the codespace opened in my local VS Code!
Not a problem - this just means that VS Code is locally installed and Visual Studio Code
is selected in the Editor preference
section of the GitHub account's Codespaces settings.
In the newly launched Codespace, a tab is opened displaying an overview of the lab.
The Post Deploy Script
can be seen running in the terminal, and will take a few minutes to complete.
Grab a coffee!
The post deployment script can take a few minutes to run. Grab a coffee while the lab environment is being created.
Once the post deployment script has completed, the terminal prompt will change to the GitHub username followed by the name of the lab.
In the screenshot below, the GitHub username is MitchV85
and the lab is techlib-vxlan-domain-a
.
At this point, the lab is ready to go! Running the following command in the terminal will provide an overview and status of all deployed nodes:
make inspect
Interacting with the Lab
Once the lab is up and running, we can interact with the topology nodes.
Both SSH and API access to the nodes are available via the Codespace. Lab environments are pre-packaged with tools like Python and the Arista AVD, CVP, and EOS Ansible Galaxy collections.
Labs that leverage tools such as AVD for configuration, documentation, and testing will provide the instructions in their lab guide.
Accessing the environment via SSH is detailed below:
SSH
More real estate for those SSH sessions 🏠
Increase the size of the terminal by selecting the Maximize Panel Size
button to the right of the terminal:
A list of Lab Hosts
that are accessible via SSH
from within the codespace can be viewed at any time from the terminal by entering the following command:
make inspect
To access a node, use the ssh
command followed by admin@hostname
as shown in the example below
ssh admin@A-SPINE1
What's the password?
The credentials used to access nodes within an Arista Community Lab environment will always be listed in the lab's documentation.
Use tabs 📑
Create a new tab for an SSH session by selecting New Terminal
to the right of the terminal.
Alternatively, the following keyboard shortcut can be used to open a new tab on both Windows and macOS: Ctrl+Shift+'
Once opened, the new terminal tab can be renamed by right-clicking on the tab and selecting Rename
Stopping the Lab
When you're finished with the lab, simply close the codespace by exiting the browser window. By default, a GitHub Codespace is stopped after 45 minutes of idleness and deleted after 30 days of inactivity.
Conserve those hours and save some money! 💵💷💶💴
The Default idle timeout
and Default retention period
values can be modified within GitHub Codespaces Settings.
These parameters can be changed at any time, and should be defined with values that make the most sense for your usage patterns.
A general recommendation for these values is provided below:
- Default idle timeout:
30 Minutes
- Default retention period:
1 Day
A list of all codespaces can be found in the Codespaces section of GitHub. From here, a codespace can be resumed, stopped, deleted, renamed, and more!
Happy labbing!