boaviztapi
boaviztapi copied to clipboard
Document compilation or serverless deployment on MS WSL2 with Ubuntu 22.04
Problem
I struggled a little to compile / deploy application using a Windows 10. I am using Ubuntu 22.04 instance on WSL2.
It seems to be working now, but I had to perform some undocumented steps.
Solution
Update documentation with specific steps I had to do to compile / deploy the API (i.e. push my notes to the doc)
Alternatives
Additional context or elements
Did you use the docker image : https://github.com/Boavizta/boaviztapi/pkgs/container/boaviztapi ?
No problem to run the docker image, it works flawlessly.
I had some issues when trying to build a local version without docker (so that I can later deploy with serverless).
This related to doing it in WSL (Ubuntu in windows).
Mostly due to non compatible python versions that comes with this Ubuntu image, and some issues with corporate Certificates Authorities....
Nothing hard to fix I suppose for a experienced phytonista ;-) ... but I struggled a bit because I was not that familiar with python tooling ๐.
I have to organize this cleanly into the doc but for the record I leave my notes there:
Setting up Python / Pip (pyenv + pipenv) to supprt boavizta API and deploy on WSL2 (on Ubuntu 22.04)
- "pipenv" fails with AttributeError after upgrading from ubuntu 20.04 to 22.04? ยท Issue #5088 ยท pypa/pipenv
- Utilisation plusieurs versions de python avec Pyenv
# Follow up on installing inside WSL
# Remove defautl pip env (on Ubuntu 22.04)
sudo apt remove pipenv
# Install custom pipenv
# this fails (cert issue)
pip --cert <REDACTED> install pipenv
# ๐ดโโ ๏ธ WARING: it entirely skips ssl verification !!
pip --trusted-host pypi.org --trusted-host files.pythonhosted.org install pipenv
# Need python 3.6
# 1. install pyenv
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
# 2. Seems I need deps for building python
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python3-openssl
# 3. install python 3.6
# ๐ดโโ ๏ธ WARING: it entirely skips ssl verification !!
export PIP_TRUSTED_HOST=pypi.org
export PIP_TRUSTED_HOST_FILE=files.pythonhosted.org
export REQUESTS_CA_BUNDLE=<REDACTED>
pipenv --python 3.6
To be clear: the issue is fixed from my perspective. But I would like to contribute theses steps to the doc when time permit ;-)
I understand ! I work on the documentation of the v0.2 here : https://github.com/Boavizta/boaviztapi/tree/documentation/v0.2/docs