amundsen
amundsen copied to clipboard
Bug Report error in Dockerfile.frontend.local file build
Expected Behavior
i playing this command
docker-compose -f docker-amundsen-local.yml up
i want make image using local dockerfile in my host
Current Behavior
i got error
#22 1.984 Obtaining file:///app
#22 4.968 ERROR: Command errored out with exit status 1:
#22 4.968 command: /usr/local/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/app/setup.py'"'"'; __file__='"'"'/app/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exi
sts(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info
-cdo5u_mq
#22 4.968 cwd: /app/
#22 4.968 Complete output (10 lines):
#22 4.968 /bin/sh: 1: npm: not found
#22 4.968 ERROR:root:npm must be available
#22 4.968 /bin/sh: 1: npm: not found
#22 4.968 /app/setup.py:30: DeprecationWarning: The 'warn' function is deprecated, use 'warning' instead
#22 4.968 logging.warn('Installation of npm dependencies failed')
#22 4.968 WARNING:root:Installation of npm dependencies failed
#22 4.968 /app/setup.py:31: DeprecationWarning: The 'warn' function is deprecated, use 'warning' instead
#22 4.968 logging.warn(str(e))
#22 4.968 WARNING:root:Command '['npm install']' returned non-zero exit status 127.
#22 4.968 error in amundsen-frontend setup command: 'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.
#22 4.968 ----------------------------------------
#22 4.968 WARNING: Discarding file:///app. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
#22 4.968 ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
------
executor failed running [/bin/sh -c pip3 install -e .]: exit code: 1
ERROR: Service 'amundsenfrontend' failed to build : Build failed
Possible Solution
Steps to Reproduce
- git clone https://github.com/amundsen-io/amundsen.git
- git checkout -t main
3.
docker-compose -f docker-amundsen-local.yml up
Screenshots (if appropriate)
Context
Your Environment
- Amunsen version used:
- Data warehouse stores:
- Deployment (k8s or native):
- Link to your fork or repository:
Thanks for opening your first issue here!
i think Dockerfile.frontend.local base images "python:3.7-slim" and in frontend/setup.py source
def build_js() -> None:
if not is_npm_installed():
logging.error('npm must be available')
try:
subprocess.check_call(['npm install'], cwd=PACKAGE_DIR, shell=True)
subprocess.check_call(['npm run build'], cwd=PACKAGE_DIR, shell=True)
call npm install python:3.7-slim images has not npm (edited)
Have you tried any of the solutions listed here https://github.com/giampaolo/psutil/issues/1268 or here https://stackoverflow.com/questions/63687990/extras-require-must-be-a-dictionary-whose-values-are-strings-or-lists-of-strin?
@danlfels thank you for my issue
this error is npm : not found
frontend/setup.py
call build_js()
build js function are called "npm" command but npm binary was not install
setup.py was not check requirements file
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Faced the same issue. Didn't figure out the solution. Any requests?
I ran into this as well when I was trying to run the quickstart...
I know the issue has to do with the windows OS, I tested this with some colleagues who were running Macs and they didnt get the error. This was repeated on 3 Macs and 2 windows machines.
I have no clue how to fix it though.
Have you tried reinstaliing git on windows with symlinks enabled?
Have you tried reinstaliing git on windows with symlinks enabled?
I will try this now! Thanks
Alternatively, depending on what you want to achieve, you could try running ubuntu docker container on windows and git clone amundsen code inside the container. Just mount some volume externally so the artifacts are available on windows and build amundsen from within ubuntu container so symlinks and everything else works.
Yeah the symbolic links fix didnt work... Im going to see if I can get it to build it in WSL2
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Still have the same error:
Run on Windows machine.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
I am also having the issue.
I changed "FROM python:3.7-slim" to "FROM nikolaik/python-nodejs:python3.7-nodejs12-slim" and the build process goes on
but I get in another error and I can't find any reason
Thanks @fforever14, my problem with npm is resolved. Like you, I still have an error with: "error in amundsen-frontend setup command: 'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers."
A lot of moving targets here, but I'll show you a few situations were this fails:
- Run wsl, point to a windows mnt containing the amundsen source code
- Try to build a linux container from Windows
And what will work:
- run wsl and checkout the code to a folder in your unix filesystem
Demo of why 1 & 2 fails:
Remove RUN pip3 install -e .
from the file Dockerfile.frontend.local
then build it and run it:
docker build -f Dockerfile.frontend.local . --tag bug
docker run -it --entrypoint /bin/bash bug:latest
Then from inside the container, take a look at the requirements-dev file:
> cat requirements-dev.txt
../requirements-dev.txtroot@0361996aac5a:
The file is garbled, I think it has to do with the symlinks (the common requirements files are symlinked into the frontend folder).
If you checkout a clean repo inside the wsl dist, the requirements files are not garbage, and you will not get the
amundsen-frontend setup command: 'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers
This is the actual error, the "npm not installed" is a red herring, because if you look at the aforementioned dockerfile, you have already built the js dist, so no need to do that all over again in setup.py
I was having the same issue an after many attempts I've found this steps works for me
-
In the Dockerfile.frontend.local file:
- Replace ~~FROM node:12-slim as node-stage~~ with FROM node:12-alpine as node-stage
- Remove the istruction
FROM python:3.7-slim
- Add the install of python right after the line
COPY ./frontend /app
with the following directives:ENV PYTHONUNBUFFERED=1 RUN apk add --update --no-cache python3 && ln -sf python3 /usr/bin/python RUN python3 -m ensurepip RUN pip3 install --no-cache --upgrade pip setuptools
- Remove the istruction
COPY --from=node-stage /app /app
-
In docker-amundsen-local.yml:
- Change the ports of amundsearch service 5001:~~5001~~ with 5001:5000
- Change the ports of amundsenmetadata service 5002:~~5002~~ with 5002:5000
It can be improved for sure and I'm going to test other configurations in the meantime but for now it seems to work (i'm trying to follow a guide to make lineage visible and finally I can see it)
@silverik i did what you have mentioned, but facing same issue as you can see below
PS C:\Users\MG> docker-compose -f docker-amundsen-local.yml up [+] Building 0.1s (3/4) => [mg_amundsenfrontend internal] load build definition from Dockerfile.frontend.local 0.1s => => transferring dockerfile: 2B 0.0s => CANCELED [mg_amundsensearch internal] load build definition from Dockerfile.search.public 0.0s => => transferring dockerfile: 0.1s => CANCELED [mg_amundsenmetadata internal] load build definition from Dockerfile.metadata.public 0.0s failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount2077333692/Dockerfile.frontend.local: no such file or directory