boaviztapi icon indicating copy to clipboard operation
boaviztapi copied to clipboard

Document compilation or serverless deployment on MS WSL2 with Ubuntu 22.04

Open demeringo opened this issue 2 years ago โ€ข 4 comments

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

demeringo avatar Sep 15 '22 14:09 demeringo

Did you use the docker image : https://github.com/Boavizta/boaviztapi/pkgs/container/boaviztapi ?

da-ekchajzer avatar Sep 16 '22 09:09 da-ekchajzer

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)

# 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


demeringo avatar Sep 16 '22 10:09 demeringo

To be clear: the issue is fixed from my perspective. But I would like to contribute theses steps to the doc when time permit ;-)

demeringo avatar Sep 16 '22 10:09 demeringo

I understand ! I work on the documentation of the v0.2 here : https://github.com/Boavizta/boaviztapi/tree/documentation/v0.2/docs

da-ekchajzer avatar Sep 16 '22 11:09 da-ekchajzer