cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
777
Views
1
Helpful
1
Replies

NSO in docker and python venv

stask
Level 1
Level 1

Team,

Need help with understaning how NSO in docker loads Python libraries (especially from pyvenv inside packages). Documentation stated that NSO in docker should automatically detect & load pyvenv inside packages. Or is it only for non-Cisco NSO docker images? 

What I have:

1. Official Cisco NSO docker PROD image 6.4.6 running inside docker-ce in Oracle Linux 9 

2. Docker container started as part of docker-compose. Container has persistent volume connected as /nso/run/packages

3. Example cisco-nso-ldap-auth package copied to /nso/run/packages. With BUILD image I did: make all && make pyvenv 

4. Package loaded in NSO & has up state

5. While trying to do LDAP auth I see in log - " package authentication using cisco-nso-ldap-auth program ret bad output: ModuleNotFoundError: No module named 'ldap'"

6. In ncs-python-vm.log - "ncs[24]: <<"cisco-nso-ldap-auth">> has no runnable component"

7. In non-docker environment it works fine because I can install python3-ldap package & solve the dependencies. 

Thank you.

1 Accepted Solution

Accepted Solutions

stask
Level 1
Level 1

Team, 

Solved the issue following way:

1. With build nso container created pyvenv under /nso/run

2. installed python-ldap module from requirements file with venv pip

3. updated authenticate script (replaced "#!/usr/bin/env python3" with "#!/nso/run/pyvenv/bin/python3")

View solution in original post

1 Reply 1

stask
Level 1
Level 1

Team, 

Solved the issue following way:

1. With build nso container created pyvenv under /nso/run

2. installed python-ldap module from requirements file with venv pip

3. updated authenticate script (replaced "#!/usr/bin/env python3" with "#!/nso/run/pyvenv/bin/python3")

Polls
AI-powered tools for network troubleshooting are likely to be part of everyone’s workflow sooner or later. What is the single biggest challenge or concern you see with adopting these tools in your organization?