aws-samples / conversational-ai-llms-with-amazon-lex-and-sagemaker

MIT No Attribution
30 stars 11 forks source link

Docker build with issues #5

Open reziakk opened 1 year ago

reziakk commented 1 year ago

When executing the command: docker run --platform linux/amd64 \ -v "$PWD"/..:/conversational-ai-llms-with-amazon-lex-and-sagemaker \ -it lambda-build-langchain

It throw erros and doesn't generates the .zip

Issues: : No such file or directory.sh: line 6: .venv/bin/activate : No such file or directory line 9: cd: package Zipping into lambda layer zip warning: name not matched: .

). -i .or: Nothing to do! (try: zip -v -r9 langchain_layer.zip mv: cannot stat ‘langchain_layer.zip\r’: No such file or directory : No such file or directory line 13: cd: .. ./build_langchain_layer.sh: line 15: deactivate: command not found

rgomes1220 commented 1 year ago

I'm unable to replicate. Make sure the first command builds the image successfully docker build -t lambda-build-langchain . Afterwards you should see the image in terminal with docker images Then do

docker run --platform linux/amd64 \
-v "$PWD"/..:/conversational-ai-llms-with-amazon-lex-and-sagemaker \
-it lambda-build-langchain

Note both commands are run from the src directory. Also, depending on your system you may not need the flag --platform linux/amd64 in the second command and may need to remove it from line 1 in src/Dockerfile for the image to build properly.

I was just able to do these steps properly on a Mac M1 running Monterey. Hope this helps

reziakk commented 1 year ago

Did what you suggested, running it directly in gitbash using Windows, and this is what is happening:

docker run --platform linux/amd64 -v "$PWD"/..:/conversational-ai-llms-with-amazon-lex-and-sagemaker -it lambda-build-langchain
./build_langchain_layer.sh: line 2: $'\r': command not found
Create Virtual env
: No such file or directory line 6: .venv/bin/activate
Activated Virtual Env. Installing requirements
Collecting langchain==0.0.161
  Downloading langchain-0.0.161-py3-none-any.whl (758 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 759.0/759.0 KB 2.0 MB/s eta 0:00:00
Collecting pydantic==1.10.7
  Downloading pydantic-1.10.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.2/3.2 MB 4.8 MB/s eta 0:00:00
Collecting boto3==1.26.91
  Downloading boto3-1.26.91-py3-none-any.whl (134 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 134.7/134.7 KB 6.8 MB/s eta 0:00:00
Collecting aws-requests-auth==0.4.3
  Downloading aws_requests_auth-0.4.3-py2.py3-none-any.whl (6.8 kB)
Collecting tqdm>=4.48.0
  Downloading tqdm-4.66.1-py3-none-any.whl (78 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.3/78.3 KB 5.4 MB/s eta 0:00:00
Collecting openapi-schema-pydantic<2.0,>=1.2
  Downloading openapi_schema_pydantic-1.2.4-py3-none-any.whl (90 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 90.0/90.0 KB 3.4 MB/s eta 0:00:00
Collecting numpy<2,>=1
  Downloading numpy-1.25.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 18.3/18.3 MB 12.6 MB/s eta 0:00:00
Collecting async-timeout<5.0.0,>=4.0.0
  Downloading async_timeout-4.0.3-py3-none-any.whl (5.7 kB)
Collecting requests<3,>=2
  Downloading requests-2.31.0-py3-none-any.whl (62 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.6/62.6 KB 9.7 MB/s eta 0:00:00
Collecting tenacity<9.0.0,>=8.1.0
  Downloading tenacity-8.2.3-py3-none-any.whl (24 kB)
Collecting SQLAlchemy<3,>=1.4
  Downloading SQLAlchemy-2.0.20-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.0/3.0 MB 16.8 MB/s eta 0:00:00
Collecting aiohttp<4.0.0,>=3.8.3
  Downloading aiohttp-3.8.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 20.6 MB/s eta 0:00:00
Collecting dataclasses-json<0.6.0,>=0.5.7
  Downloading dataclasses_json-0.5.14-py3-none-any.whl (26 kB)
Collecting PyYAML>=5.4.1
  Downloading PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (738 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 738.9/738.9 KB 19.7 MB/s eta 0:00:00
Collecting numexpr<3.0.0,>=2.8.4
  Downloading numexpr-2.8.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (382 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 382.8/382.8 KB 9.0 MB/s eta 0:00:00
Collecting typing-extensions>=4.2.0
  Downloading typing_extensions-4.7.1-py3-none-any.whl (33 kB)
Collecting jmespath<2.0.0,>=0.7.1
  Downloading jmespath-1.0.1-py3-none-any.whl (20 kB)
Collecting s3transfer<0.7.0,>=0.6.0
  Downloading s3transfer-0.6.2-py3-none-any.whl (79 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 79.8/79.8 KB 12.1 MB/s eta 0:00:00
Collecting botocore<1.30.0,>=1.29.91
  Downloading botocore-1.29.165-py3-none-any.whl (11.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 11.0/11.0 MB 20.2 MB/s eta 0:00:00
Collecting attrs>=17.3.0
  Downloading attrs-23.1.0-py3-none-any.whl (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.2/61.2 KB 7.9 MB/s eta 0:00:00
Collecting frozenlist>=1.1.1
  Downloading frozenlist-1.4.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (228 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 228.0/228.0 KB 17.9 MB/s eta 0:00:00
Collecting multidict<7.0,>=4.5
  Downloading multidict-6.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (114 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 114.2/114.2 KB 12.6 MB/s eta 0:00:00
Collecting yarl<2.0,>=1.0
  Downloading yarl-1.9.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (269 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 269.4/269.4 KB 16.2 MB/s eta 0:00:00
Collecting charset-normalizer<4.0,>=2.0
  Downloading charset_normalizer-3.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (202 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 202.1/202.1 KB 11.1 MB/s eta 0:00:00
Collecting aiosignal>=1.1.2
  Downloading aiosignal-1.3.1-py3-none-any.whl (7.6 kB)
Collecting urllib3<1.27,>=1.25.4
  Downloading urllib3-1.26.16-py2.py3-none-any.whl (143 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 143.1/143.1 KB 10.6 MB/s eta 0:00:00
Collecting python-dateutil<3.0.0,>=2.1
  Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 247.7/247.7 KB 19.1 MB/s eta 0:00:00
Collecting marshmallow<4.0.0,>=3.18.0
  Downloading marshmallow-3.20.1-py3-none-any.whl (49 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 49.4/49.4 KB 3.7 MB/s eta 0:00:00
Collecting typing-inspect<1,>=0.4.0
  Downloading typing_inspect-0.9.0-py3-none-any.whl (8.8 kB)
Collecting idna<4,>=2.5
  Downloading idna-3.4-py3-none-any.whl (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.5/61.5 KB 6.5 MB/s eta 0:00:00
Collecting certifi>=2017.4.17
  Downloading certifi-2023.7.22-py3-none-any.whl (158 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 158.3/158.3 KB 7.2 MB/s eta 0:00:00
Collecting greenlet!=0.4.17
  Downloading greenlet-2.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (610 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 610.9/610.9 KB 20.4 MB/s eta 0:00:00
Collecting packaging>=17.0
  Downloading packaging-23.1-py3-none-any.whl (48 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.9/48.9 KB 3.7 MB/s eta 0:00:00
Collecting six>=1.5
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting mypy-extensions>=0.3.0
  Downloading mypy_extensions-1.0.0-py3-none-any.whl (4.7 kB)
Installing collected packages: urllib3, typing-extensions, tqdm, tenacity, six, PyYAML, packaging, numpy, mypy-extensions, multidict, jmespath, idna, greenlet, frozenlist, charset-normalizer, certifi, attrs, async-timeout, yarl, typing-inspect, SQLAlchemy, requests, python-dateutil, pydantic, numexpr, marshmallow, aiosignal, openapi-schema-pydantic, dataclasses-json, botocore, aws-requests-auth, aiohttp, s3transfer, langchain, boto3
Successfully installed PyYAML-6.0.1 SQLAlchemy-2.0.20 aiohttp-3.8.5 aiosignal-1.3.1 async-timeout-4.0.3 attrs-23.1.0 aws-requests-auth-0.4.3 boto3-1.26.91 botocore-1.29.165 certifi-2023.7.22 charset-normalizer-3.2.0 dataclasses-json-0.5.14 frozenlist-1.4.0 greenlet-2.0.2 idna-3.4 jmespath-1.0.1 langchain-0.0.161 marshmallow-3.20.1 multidict-6.0.4 mypy-extensions-1.0.0 numexpr-2.8.5 numpy-1.25.2 openapi-schema-pydantic-1.2.4 packaging-23.1 pydantic-1.10.7 python-dateutil-2.8.2 requests-2.31.0 s3transfer-0.6.2 six-1.16.0 tenacity-8.2.3 tqdm-4.66.1 typing-extensions-4.7.1 typing-inspect-0.9.0 urllib3-1.26.16 yarl-1.9.2
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
WARNING: You are using pip version 22.0.4; however, version 23.2.1 is available.
You should consider upgrading via the '/var/lang/bin/python3.9 -m pip install --upgrade pip' command.
: No such file or directory line 9: cd: package
Zipping into lambda layer
        zip warning: name not matched: .

). -i .or: Nothing to do! (try: zip -v -r9 langchain_layer.zip
mv: cannot stat ‘langchain_layer.zip\r’: No such file or directory
: No such file or directory line 13: cd: ..
./build_langchain_layer.sh: line 15: deactivate: command not found