microsoft / Oryx

Build your repo automatically.
Other
751 stars 173 forks source link

Oryx build successful but package not found #2524

Open orgads opened 1 week ago

orgads commented 1 week ago

Bug Report

.deployment:

[config]
SCM_DO_BUILD_DURING_DEPLOYMENT=true

requirements.txt:

botbuilder-integration-aiohttp>=4.16.2

default_scm_docker:

2024-09-16T13:44:59.4696724Z Downloading and extracting 'python' version '3.12.2' to '/tmp/oryx/platforms/python/3.12.2'...
2024-09-16T13:44:59.4875531Z Detected image debian flavor: bullseye.
2024-09-16T13:45:09.6502631Z ......
2024-09-16T13:45:09.6592542Z Downloaded in 10 sec(s).
2024-09-16T13:45:09.6943319Z Verifying checksum...
2024-09-16T13:45:09.7603349Z Extracting contents...
2024-09-16T13:45:55.5820356Z .........................................
2024-09-16T13:45:55.5832175Z performing sha512 checksum for: python...
2024-09-16T13:46:03.3135665Z ...
2024-09-16T13:46:04.3044355Z Done in 64 sec(s).
2024-09-16T13:46:04.3044607Z 
2024-09-16T13:46:04.3044698Z image detector file exists, platform is python..
2024-09-16T13:46:04.3044722Z OS detector file exists, OS is bullseye..
2024-09-16T13:46:04.3603669Z Python Version: /tmp/oryx/platforms/python/3.12.2/bin/python3.12
2024-09-16T13:46:04.3896387Z Creating directory for command manifest file if it does not exist
2024-09-16T13:46:04.4645664Z Removing existing manifest file
2024-09-16T13:46:04.5230419Z Python Virtual Environment: antenv
2024-09-16T13:46:04.5528493Z Creating virtual environment...
2024-09-16T13:46:40.1091007Z ..............................
2024-09-16T13:46:40.1106342Z Activating virtual environment...
2024-09-16T13:46:40.1858999Z Running pip install...
2024-09-16T13:47:52.1666423Z ..................................................................

default_docker:

2024-09-16T14:00:04.078916861Z    _____                               
2024-09-16T14:00:04.078977261Z   /  _  \ __________ _________   ____  
2024-09-16T14:00:04.078983461Z  /  /_\  \\___   /  |  \_  __ \_/ __ \ 
2024-09-16T14:00:04.078987461Z /    |    \/    /|  |  /|  | \/\  ___/ 
2024-09-16T14:00:04.078991061Z \____|__  /_____ \____/ |__|    \___  >
2024-09-16T14:00:04.078995861Z         \/      \/                  \/ 
2024-09-16T14:00:04.078999561Z A P P   S E R V I C E   O N   L I N U X
2024-09-16T14:00:04.079003161Z 
2024-09-16T14:00:04.079006561Z Documentation: http://aka.ms/webapp-linux
2024-09-16T14:00:04.079009961Z Python 3.11.8
2024-09-16T14:00:04.079013461Z Note: Any data outside '/home' is not persisted
2024-09-16T14:00:10.946111742Z Starting OpenBSD Secure Shell server: sshd.
2024-09-16T14:00:11.513891487Z WEBSITES_INCLUDE_CLOUD_CERTS is not set to true.
2024-09-16T14:00:12.591846039Z Site's appCommandLine: python -m aiohttp.web -H 0.0.0.0 -P 8000 app:init_func
2024-09-16T14:00:12.790178758Z Launching oryx with: create-script -appPath /home/site/wwwroot -output /opt/startup/startup.sh -virtualEnvName antenv -defaultApp /opt/defaultsite -userStartupCommand 'python -m aiohttp.web -H 0.0.0.0 -P 8000 app:init_func'
2024-09-16T14:00:13.283084794Z Could not find build manifest file at '/home/site/wwwroot/oryx-manifest.toml'
2024-09-16T14:00:13.283205994Z Could not find operation ID in manifest. Generating an operation id...
2024-09-16T14:00:13.283217694Z Build Operation ID: bbe30999-bade-4a24-ae64-aa6e85a724cf
2024-09-16T14:00:17.620445494Z Oryx Version: 0.2.20240501.1, Commit: f83f88d3cfb8bb6d3e2765e1dcd218eb0814a095, ReleaseTagName: 20240501.1
2024-09-16T14:00:17.620491496Z Writing output script to '/opt/startup/startup.sh'
2024-09-16T14:00:18.206909128Z WARNING: Could not find virtual environment directory /home/site/wwwroot/antenv.
2024-09-16T14:00:18.209087815Z WARNING: Could not find package directory /home/site/wwwroot/__oryx_packages__.
2024-09-16T14:00:20.717470356Z /opt/python/3/bin/python: Error while finding module specification for 'aiohttp.web' (ModuleNotFoundError: No module named 'aiohttp')

Notice "Could not find virtual environment directory /home/site/wwwroot/antenv"

This looks similar to #675 and also this answer.

The answer suggested creating the venv locally, and running pip install, then deploy with the venv.

This indeed works, but is a real bad solution.

  1. My host is Windows, and the target is Linux. Python version is not necessarily the same. It still works, but I doubt it is reliable, especially in case I add packages that have pre-built binaries.
  2. Obviously the venv should not be committed to Git, so we need a manual deployment step.
orgads commented 1 week ago

@kumaraksh1