Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python3Upgrade #155

Open
YufengXin opened this issue Jul 5, 2020 · 0 comments
Open

Python3Upgrade #155

YufengXin opened this issue Jul 5, 2020 · 0 comments

Comments

@YufengXin
Copy link
Contributor

YufengXin commented Jul 5, 2020

There are a number of things that need to be taken care of. (1) using the Futurize tool solved most of the syntax upgrade (print...); (2) byte and str compatibility, esp. in socket communication; (3) upgrade to python3, pip3, and future in the vagrant file (4) change in the Dockerfile (5) "relative import" doesn't work well, back to the "absolute import". (6) invoking "Ryu-manager" in the RyuControllerInterface.

### Automatic conversion to Py2/3
Futurize stage 1

futurize --stage1 -w /**/.py >future-step1-port.txt
Python2.7 unittest seem fine
conda activate python27
export PYTHONPATH=/Users/yxin/NSF/AW-SDX-Audit-Local/atlanticwave-proto
pip install --requirement requirements.txt
python -m unittest discover -v
conda deactivate

Python3 unittest causes multiple failures in dependencies so continue:

  • Futurize stage 2
    . futurize --stage2 /**/.py
  • Go through all the python modules to change:
    .metaclass
    .pickle (loads byte, no str; dump str to bytes)
    . list(dict.keys())
    . Modifying socket implementation due to the incompatibility between str and bytes.
    -update requirements.txt: ryu4.34, Flask
  • Making changes in vagrant, Docker-file, run_sdx.sh, run_lc.sh, and vendor-updates:
    . use python3 as the default python
    . use pip3
    . use Ubuntu 18.04 in docker and ryu4.34

Going through all the unittest.

./lib
./shared
./localctlr
./sdxctlr

Jenkins deployment in vagrant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant