Giter Site home page Giter Site logo

aci-learning-labs-code-samples's Introduction

ACI Learning Labs Code Samples

This repository holds the code samples for the DevNet Learning Labs for Application Centric Infrastructure. This includes the following modules:

Local Workstation Requirements

The code samples in these labs all leverage Python as the programming language. In order to run the exercises and code, you'll need to meet the following requirements.

Full details on how to setup are included in the Learning Lab Setup Steps.

  1. Python 3.7.5 or higher
  2. ACI Cobra SDK for Python
  3. ACI Toolkit for Python

It is highly recommended to install all Python requirements within a virtual environment, and not the default Python environment on your workstation.

Sandbox Lab Infrastructure Setup

Also included in this repository are scripts to prepare the DevNet Always On Sandbox for ACI/APIC. These scripts initialize the APIC Simulator and deploy the tenants and application policy leveraged in the Learning Labs. To run the baselining scripts:

Details also included within the Learning Labs themselves

# Clone down this code repository & enter the setup directory
git clone https://github.com/CiscoDevNet/aci-learning-labs-code-samples
cd aci-learning-labs-code-samples/apic_fabric_setup

# Run the baseline scripts
python baseline.py
# Expected Output
Baselining APIC Simulator for Learning Labs
Setting up Fabric Nodes
Configuring Fabric Policies
Setting up Common Tenant
Setting up Heroes Tenant
Setting up SnV Tenant  

aci-learning-labs-code-samples's People

Contributors

agentlecisco avatar ciscohank avatar hpreston avatar klevenstein avatar movinalot avatar xanderstevenson avatar yawming avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aci-learning-labs-code-samples's Issues

Requests module is used before the import

Since there are no missions about this error I thought I should mention it.
In the file aci-learning-labs-code-samples/sbx-intro-aci/sbx-intro-aci-mission_toolkit/aci_critical_faults.py the disable_warnings() is called before the requests import. This is not part of any missions so guesing it is just an error in the code.

Unable to run starup baseline script

Traceback (most recent call last):
File "baseline.py", line 11, in
import startup_script
File "C:\Users\arjun\Desktop\dev\aci-learning-labs-code-samples\apic_fabric_setup\startup_script.py", line 225, in
md.commit(c)
File "C:\Users\arjun\Desktop\dev\aci-learning-labs-code-samples\venv\lib\site-packages\cobra\mit\access.py", line 66, in commit
return self._accessImpl.post(configObject)
File "C:\Users\arjun\Desktop\dev\aci-learning-labs-code-samples\venv\lib\site-packages\cobra\internal\rest\accessimpl.py", line 182, in post
return self.__parseError(rsp, CommitError, rsp.status_code)
File "C:\Users\arjun\Desktop\dev\aci-learning-labs-code-samples\venv\lib\site-packages\cobra\internal\rest\accessimpl.py", line 240, in __parseError
parseXMLError(rsp.text, errorClass, httpCode)
File "C:\Users\arjun\Desktop\dev\aci-learning-labs-code-samples\venv\lib\site-packages\cobra\mit\xmlcodec.py", line 20, in parseXMLError
raise errorClass(int(errorCode), errorStr, httpCode)
cobra.mit.request.CommitError: Validation failed: Validation failed for node: 101Overlapping interfaces. Last examined: uni/infra/accportprof-Heroes_server1

baseline.py not executable for me

python3 baseline.py

Traceback (most recent call last):
File "/Users/alexstev/Documents/CiscoDevNet/code/aci-learning-labs-code-samples/apic_fabric_setup/baseline.py", line 11, in
import startup_script
File "/Users/alexstev/Documents/CiscoDevNet/code/aci-learning-labs-code-samples/apic_fabric_setup/startup_script.py", line 3, in
import cobra.mit.access
File "/Users/alexstev/Documents/CiscoDevNet/code/aci-learning-labs-code-samples/ven/lib/python3.9/site-packages/cobra/init.py", line 17, in
from cobra import io
File "/Users/alexstev/Documents/CiscoDevNet/code/aci-learning-labs-code-samples/ven/lib/python3.9/site-packages/cobra/io/init.py", line 4, in
from cobra.io.dict import model_from_dict, model_to_dict
File "/Users/alexstev/Documents/CiscoDevNet/code/aci-learning-labs-code-samples/ven/lib/python3.9/site-packages/cobra/io/dict.py", line 71, in
value: Union[str, np.float, np.bool, Set, Dict]
File "/Users/alexstev/Documents/CiscoDevNet/code/aci-learning-labs-code-samples/ven/lib/python3.9/site-packages/numpy/init.py", line 284, in getattr
raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'float'

I tried updating numpy but that didn't help

Unable to start the lab

Hi, I'm a first time user and I'm getting this error, thus not being able to continue.

(venv) C:\Users\aegia\Documents\aci-learning-labs-code-samples>python apic_fabric_setup\baseline.py
Baselining APIC Simulator for Learning Labs
Setting up Fabric Nodes
Traceback (most recent call last):
File "apic_fabric_setup\baseline.py", line 11, in
import startup_script
File "C:\Users\aegia\Documents\aci-learning-labs-code-samples\apic_fabric_setup\startup_script.py", line 43, in
md.commit(c)
File "C:\Users\aegia\Documents\aci-learning-labs-code-samples\venv\lib\site-packages\cobra\mit\access.py", line 66, in commit
return self._accessImpl.post(configObject)
File "C:\Users\aegia\Documents\aci-learning-labs-code-samples\venv\lib\site-packages\cobra\internal\rest\accessimpl.py", line 182, in post
return self.__parseError(rsp, CommitError, rsp.status_code)
File "C:\Users\aegia\Documents\aci-learning-labs-code-samples\venv\lib\site-packages\cobra\internal\rest\accessimpl.py", line 240, in __parseError
parseXMLError(rsp.text, errorClass, httpCode)
File "C:\Users\aegia\Documents\aci-learning-labs-code-samples\venv\lib\site-packages\cobra\mit\xmlcodec.py", line 20, in parseXMLError
raise errorClass(int(errorCode), errorStr, httpCode)
cobra.mit.request.CommitError: Duplicate Node-Id 201

ImportError: cannot import name 'Sequence' from 'collections' (C:\Program Files\Python3\lib\collections\__init__.py) (venv)

There seems to be this error even on the solution file. The full output is:
F:\Other\DevNet\aci-learning-labs-code-samples\venv\lib\site-packages\acitoolkit-0.4-py3.10.egg\acitoolkit\acitoolkit.py:5207: SyntaxWarning: "is not" with a literal. Did you mean "!="?
F:\Other\DevNet\aci-learning-labs-code-samples\venv\lib\site-packages\acitoolkit-0.4-py3.10.egg\acitoolkit\acitoolkit.py:5207: SyntaxWarning: "is not" with a literal. Did you mean "!="?
Traceback (most recent call last):
File "F:\Other\DevNet\aci-learning-labs-code-samples\sbx-intro-aci\sbx-intro-aci-mission_toolkit\aci_critical_faults_SOLUTION.py", line 9, in
from acitoolkit.acitoolkit import Session
File "F:\Other\DevNet\aci-learning-labs-code-samples\venv\lib\site-packages\acitoolkit-0.4-py3.10.egg\acitoolkit_init_.py", line 35, in
File "F:\Other\DevNet\aci-learning-labs-code-samples\venv\lib\site-packages\acitoolkit-0.4-py3.10.egg\acitoolkit\acitoolkit.py", line 33, in

ImportError: cannot import name 'Sequence' from 'collections' (C:\Program Files\Python3\lib\collections_init_.py)
(venv)

I ran in the venv created for this lab only. Does anybody have an idea what the issue might be?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.