Hi I am deploy an EB Python Web Application to a private VPC without internet access. I will install python dependency packages offline.
I have all the packages ready together with application file.
application.py
packages/*.whl
packages/requirements.txt (CONTENT will be those whl packages name)
.ebextensions/python_packages.config
...
OTHER_VENV_RELATED_FOLDERS
The ebextensions/python_packages.config
content:
commands:
use_python_venv:
command: source /opt/elasticbeanstalk/deployment/env
install_python_requirements:
command: pip install --no-index --find-links /var/app/current/packages -r /var/app/current/packages/requirements.txt
The application tested working on my local computer and I zipped application.py
, ebextensions
and packages
folder into one zip file and upload and deploy into one single instance with EIP.
it gets the below failed message in /var/log/cfn-init-cmd.log
on the AMI EC2 instance. (python3.8 runtime)
022-03-25 06:59:11,289 P3318 [INFO] ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2022-03-25 06:59:11,289 P3318 [INFO] Config prebuild_0_test_xl
2022-03-25 06:59:11,289 P3318 [INFO] ============================================================
2022-03-25 06:59:11,289 P3318 [INFO] Command install_python_requirements
2022-03-25 06:59:12,675 P3318 [INFO] -----------------------Command Output-----------------------
2022-03-25 06:59:12,675 P3318 [INFO] ERROR: Could not open requirements file: [Errno 2] No such file or directory: '/var/app/current/packages/requirements.txt'
2022-03-25 06:59:12,675 P3318 [INFO] ------------------------------------------------------------
2022-03-25 06:59:12,675 P3318 [ERROR] Exited with error code 1
I checked the path of the requirements.txt
file and it is not there and here is the directory and files under that /var/app
directory:
staging/Pipfile
venv
It means the /var/app/current
directory not get created so my command failed. Where is my package file during the staging process?
How can I install offline python dependency packages on ElasticBeanstalk EC2 instance without internet access? Edit Pipfile
instead? Thank you