posit-dev / posit-dev/rsconnect-python

`rsconnect deploy` fails with hierarchical `requirements.txt`

Đang mở
#348 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
Python
Star
37
Fork
28
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
7

Mô tả

Issue

In our environment rsconnect deploy fails when requirements.txt refers to other requirement files as described in Referring to other requirements files.

Steps to reproduce

Sorry, I currently can't think of a better way to give you an easily reproducable example than describing the case.

The following command is run by an AWS CodeBuild step:

rsconnect deploy streamlit -n server -a $APP_ID -e 0_Übersicht.py app

The streamlit app has some sub-packages with their own requirement files:

app/
   data_pipelines/
      requirements.txt
      ...
   pages/
      ...
   0_Übersicht.py
   requirements.txt
   ...

with app/requirements.txt looking like

-r data_pipelines/requirements.txt

streamlit
...

Outcome

The deployment fails with the following output:

Command Line Output ``` [Container] 2023/02/07 13:29:21 Running command rsconnect deploy streamlit -n server -a $APP_ID -e 0_Übersicht.py app -- 240 | Validating server... [OK] 241 | Validating app mode... [OK] 242 | Making bundle ... [OK] 243 | Deploying bundle ... [OK] 244 | Saving deployed information... [OK] 245 | Building Streamlit application... 246 | Bundle created with Python version 3.8.13 is compatible with environment Local with Python version 3.8.15 from /opt/Python/3.8.15/bin/python3.8 247 | Bundle requested Python version 3.8.13; using /opt/Python/3.8.15/bin/python3.8 which has version 3.8.15 248 | 2023/02/07 13:29:24.159151565 Running on host: XXXXXXXXXXXXXXXXXXXXX.net 249 | 2023/02/07 13:29:24.159170675 Working directory: /opt/rstudio-connect/mnt/app 250 | 2023/02/07 13:29:24.159310919 Environment will be built with Python "3.8.15 \| packaged by conda-forge \| (default, Nov 22 2022, 08:49:35) [GCC 10.4.0]" at /opt/Python/3.8.15/bin/python3.8 251 | 2023/02/07 13:29:24.159509893 Running as user: rstudio-connect 252 | 2023/02/07 13:29:24.168868650 Creating environment: XXXXXXXXXXXXXXXXXXXXX 253 | 2023/02/07 13:29:35.189960015 Requirement already satisfied: pip in /opt/rstudio-connect/mnt/python-environments/pip/3.8.15/XXXXXXXXXXXXXXXXXXXXX/lib/python3.8/site-packages (22.0.4) 254 | 2023/02/07 13:29:35.379102213 Collecting pip 255 | 2023/02/07 13:29:35.385750069 Using cached pip-23.0-py3-none-any.whl (2.1 MB) 256 | 2023/02/07 13:29:35.398696114 Requirement already satisfied: setuptools in /opt/rstudio-connect/mnt/python-environments/pip/3.8.15/XXXXXXXXXXXXXXXXXXXXX/lib/python3.8/site-packages (56.0.0) 257 | 2023/02/07 13:29:35.809980556 Collecting setuptools 258 | 2023/02/07 13:29:35.813819766 Using cached setuptools-67.2.0-py3-none-any.whl (1.1 MB) 259 | 2023/02/07 13:29:35.821113679 Requirement already satisfied: wheel in /opt/Python/3.8.15/lib/python3.8/site-packages (0.38.4) 260 | 2023/02/07 13:29:36.108930301 Installing collected packages: setuptools, pip 261 | 2023/02/07 13:29:36.109176616 Attempting uninstall: setuptools 262 | 2023/02/07 13:29:36.110090958 Found existing installation: setuptools 56.0.0 263 | 2023/02/07 13:29:36.322191486 Uninstalling setuptools-56.0.0: 264 | 2023/02/07 13:29:36.455759023 Successfully uninstalled setuptools-56.0.0 265 | 2023/02/07 13:29:39.576955975 Attempting uninstall: pip 266 | 2023/02/07 13:29:39.578055351 Found existing installation: pip 22.0.4 267 | 2023/02/07 13:29:40.463374479 Uninstalling pip-22.0.4: 268 | 2023/02/07 13:29:40.539092543 Successfully uninstalled pip-22.0.4 269 | 2023/02/07 13:29:48.092566342 Successfully installed pip-23.0 setuptools-67.2.0 270 | 2023/02/07 13:29:48.945320724 ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'python/data_pipelines/requirements.txt' 271 | 2023/02/07 13:29:50.834363210 pip install failed with exit code 1 ```

Most notably is

270 | 2023/02/07 13:29:48.945320724 ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'python/data_pipelines/requirements.txt'

Expected outcome

All referred requirements files are traversed and the listed requirements installed.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện lệnh rsconnect deploy streamlit với bố cục app/requirements.txtdata_pipelines/requirements.txt như đã nêu, sau đó theo dõi cách deployment bundle xử lý các tệp requirements được tham chiếu. Việc sửa lỗi hoàn tất khi -r data_pipelines/requirements.txt được phân giải trong app được đóng gói và tất cả requirements được tham chiếu đều được cài đặt thành công.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
cli
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.