Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin / App Installation README improvement #96

Open
jabelk opened this issue Nov 27, 2024 · 0 comments
Open

Plugin / App Installation README improvement #96

jabelk opened this issue Nov 27, 2024 · 0 comments

Comments

@jabelk
Copy link

jabelk commented Nov 27, 2024

When I was following along on the installation process of installing the Golden Config App I had two areas of clarification that could be improved. I am still learning the Application, so there might other ways of solving it, but it was confusing as I was going through the docs here:
https://github.com/nautobot/nautobot-docker-compose/blob/main/docs/plugins.md#adding-apps-using-pypi
and here:
https://docs.nautobot.com/projects/golden-config/en/latest/admin/install/#install-guide
Regarding installing the Golden Config app.

I followed the directions while having successfully gotten the Nautobot instance up and running, and then updated the config file per the example to add the Golden Config app. I also tried both using pip and poetry to install the pypi package, but it only installed it in my virtual environment outside the app, and every time I invoke build --no-cache and then invoke stop start the golden config app dependencies were not installed within the container.

Here is some sample output

Starting Nautobot in debug mode...
Running docker compose command "up"
 Network nautobot-docker-compose_default  Creating
 Network nautobot-docker-compose_default  Created
 Container nautobot-docker-compose-redis-1  Creating
 Container nautobot-docker-compose-db-1  Creating
 Container nautobot-docker-compose-db-1  Created
 Container nautobot-docker-compose-redis-1  Created
 Container nautobot-docker-compose-nautobot-1  Creating
 Container nautobot-docker-compose-nautobot-1  Created
 Container nautobot-docker-compose-celery_beat-1  Creating
 Container nautobot-docker-compose-celery_worker-1  Creating
 Container nautobot-docker-compose-celery_beat-1  Created
 Container nautobot-docker-compose-celery_worker-1  Created
Attaching to celery_beat-1, celery_worker-1, db-1, nautobot-1, redis-1
redis-1          | 1:C 27 Nov 2024 03:00:14.135 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis-1          | 1:C 27 Nov 2024 03:00:14.135 # Redis version=6.2.16, bits=64, commit=00000000, modified=0, pid=1, just started
redis-1          | 1:C 27 Nov 2024 03:00:14.135 # Configuration loaded
redis-1          | 1:M 27 Nov 2024 03:00:14.135 * monotonic clock: POSIX clock_gettime
redis-1          | 1:M 27 Nov 2024 03:00:14.136 * Running mode=standalone, port=6379.
redis-1          | 1:M 27 Nov 2024 03:00:14.136 # Server initialized
redis-1          | 1:M 27 Nov 2024 03:00:14.139 * Ready to accept connections
db-1             |
db-1             | PostgreSQL Database directory appears to contain a database; Skipping initialization
db-1             |
db-1             | 2024-11-27 03:00:14.275 UTC [1] LOG:  starting PostgreSQL 13.18 on aarch64-unknown-linux-musl, compiled by gcc (Alpine 13.2.1_git20240309) 13.2.1 20240309, 64-bit
db-1             | 2024-11-27 03:00:14.275 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
db-1             | 2024-11-27 03:00:14.275 UTC [1] LOG:  listening on IPv6 address "::", port 5432
db-1             | 2024-11-27 03:00:14.279 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db-1             | 2024-11-27 03:00:14.282 UTC [26] LOG:  database system was shut down at 2024-11-27 02:50:23 UTC
db-1             | 2024-11-27 03:00:14.294 UTC [1] LOG:  database system is ready to accept connections
nautobot-1       | Traceback (most recent call last):
nautobot-1       |   File "/usr/local/lib/python3.12/site-packages/nautobot/extras/plugins/utils.py", line 65, in load_plugin
nautobot-1       |     plugin = importlib.import_module(plugin_name)
nautobot-1       |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
nautobot-1       |   File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
nautobot-1       |     return _bootstrap._gcd_import(name[level:], package, level)
nautobot-1       |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
nautobot-1       |   File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
nautobot-1       |   File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
nautobot-1       |   File "<frozen importlib._bootstrap>", line 1324, in _find_and_load_unlocked
nautobot-1       | ModuleNotFoundError: No module named 'nautobot_golden_config'

This was after I also followed the instructions to add it to the requirements file echo nautobot-golden-config >> local_requirements.txt, but there didn't seem to be any connection between running the app and using that requirements file to install them into the container.

I ended up getting it working by editing the Dockerfile by adding the poetry install steps in there poetry add nautobot-golden-config && \:

RUN cd /source && \
    poetry install --no-interaction --no-ansi && \
    poetry add nautobot-golden-config && \
    mkdir /tmp/dist && \
    poetry export --without-hashes -o /tmp/dist/requirements.txt

Though I imagine editing the Dockerfile is not a scalable solution. My main point is that if someone is looking to install an app / plugin while testing the Docker Compose process, the requirements are not being installed within the app as things are, and there should either be some comments about how to mitigate that in the documentation or a process that reads in the requirements file to bring in the necessary dependencies for the plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant