Skip to content
This repository was archived by the owner on Nov 30, 2022. It is now read-only.

Fix Dockerfile importlib.metadata.PackageNotFoundError: fidesops [#23]#48

Merged
eastandwestwind merged 1 commit into
mainfrom
fidesops-23-fidesopsnotfound
Nov 8, 2021
Merged

Fix Dockerfile importlib.metadata.PackageNotFoundError: fidesops [#23]#48
eastandwestwind merged 1 commit into
mainfrom
fidesops-23-fidesopsnotfound

Conversation

@pattisdr
Copy link
Copy Markdown
Contributor

@pattisdr pattisdr commented Nov 8, 2021

Purpose

Fix fidesops not getting installed with make server:

fidesops    | Traceback (most recent call last):
fidesops    |   File "/usr/local/bin/fidesops", line 33, in <module>
fidesops    |     sys.exit(load_entry_point('fidesops', 'console_scripts', 'fidesops')())
fidesops    |   File "/usr/local/bin/fidesops", line 22, in importlib_load_entry_point
fidesops    |     for entry_point in distribution(dist_name).entry_points
fidesops    |   File "/usr/local/lib/python3.9/importlib/metadata.py", line 524, in distribution
fidesops    |     return Distribution.from_name(distribution_name)
fidesops    |   File "/usr/local/lib/python3.9/importlib/metadata.py", line 187, in from_name
fidesops    |     raise PackageNotFoundError(name)
fidesops    | importlib.metadata.PackageNotFoundError: fidesops

The culprit appears to be the bind mount in docker-compose.yml:

    fidesops:
      ...
      volumes:
        - type: bind
          source: ./
          target: /fidesops
          read_only: False

Changes

Set the working directory to fidesops after it installed. It seems like docker-compose is bind mounting a local directory to /fidesops which is useful for reloading, but then we can't find the package source when we're trying to install.

Ticket

Fixes #23

…docker-compose is bind mounting a volume to /fidesops, it is overriding the /fideops directory and my installed fidesops can't be found.
Copy link
Copy Markdown
Contributor

@eastandwestwind eastandwestwind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great, and works on my end as well

@eastandwestwind eastandwestwind merged commit ac39913 into main Nov 8, 2021
@eastandwestwind eastandwestwind deleted the fidesops-23-fidesopsnotfound branch November 8, 2021 17:46
@pattisdr pattisdr mentioned this pull request Nov 10, 2021
sanders41 pushed a commit that referenced this pull request Sep 22, 2022
…docker-compose is bind mounting a volume to /fidesops, it is overriding the /fideops directory and my installed fidesops can't be found. (#48)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix PackageNotFoundError: fidesops

2 participants