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

Python 3 compatibility #3195

Closed
7 of 8 tasks
wido opened this issue Feb 26, 2019 · 20 comments
Closed
7 of 8 tasks

Python 3 compatibility #3195

wido opened this issue Feb 26, 2019 · 20 comments
Labels
Python Warning... Python code Ahead! python3

Comments

@wido
Copy link
Contributor

wido commented Feb 26, 2019

A lot of Python code inside CloudStack is still Python 2 and we have just 10 months left before Python 2 is no longer supported: https://pythonclock.org/

Various items need to be looked at and checked for Python 3 compatibility. A list, but probably not complete:

These are isolated projects and can usually be taken care of separately and also properly tested.

Creating this ticket so it can be referred to and also this is out there.

@wido wido added Python Warning... Python code Ahead! python3 labels Feb 26, 2019
@rohityadavcloud
Copy link
Member

Is there an argument to say, these may be implemented purely in Java (if possible)? Currently, many of these scripts esp on KVM are forked via the cloudstack-agent and called.
For VR, I played with GRPC and I think it can be secured against the current CA-framework introduced in 4.11; here's a PoC: shapeblue#44
I'll propose more details on dev@ once I can put together design/idea details.

@rohityadavcloud rohityadavcloud added this to the 4.14.0.0 milestone May 27, 2019
@falcon78921
Copy link

falcon78921 commented Jun 4, 2019

@rhtyd @wido I would love to help with moving over to Python 3, if that's still the plan.

@wido
Copy link
Contributor Author

wido commented Jun 5, 2019

Although I agree with @rhtyd that a lot can be done in Java, it's not always the easiest. Python is sometimes a lot easier to develop and talk directly with the system for executing commands.

We haven't started on this @falcon78921 , but any help is welcome! Just pick a Python script and start working on it.

@rohityadavcloud
Copy link
Member

@wido changing the env dependency is a big step, python3.x is not available on all distros by default. I think it's better to discuss on dev@ for future steps. In my proposal, for the VR for example I've proposed that we move to a lightweight agent and as PoC I've shared a Go-Java approach based on grpc.

I think the best time would be to discuss/start doing things after 4.13, as we've decided to deprecate CentOS6 after 4.13.

@wido
Copy link
Contributor Author

wido commented Jun 5, 2019

@rhtyd Python 3 is available on ALL distros. It has been for a very long time. It's on RHEL, CentOS, Debian and Ubuntu. No need to install anything :)

We can always talk about this, but the fact is that per January Python 2 is EOL and it's not so super difficult to write things in Python 3.

I'm not against an Agent in the VR for example, sounds like a good thing!

@PaulAngus
Copy link
Member

There are also knock-on effects, ie I suspect that the chances of running Python3 on XenServer 6.x is near zero.

@wido
Copy link
Contributor Author

wido commented Jun 5, 2019

@PaulAngus Python 2 is EOL in 2020, so any plans on what Xen is going to do?

But this doesn't stop us to fix other Python code before that time.

@rohityadavcloud
Copy link
Member

I think we'll need to deprecate all the XS 6.x, which we can discuss and aim to do in 4.14 and onwards. XS7 or xcp-ng 7.x with CentOS7 based dom0 may be more easy to support python3.

@wido wido mentioned this issue Sep 18, 2019
14 tasks
GabrielBrascher pushed a commit to CLDIN/cloudstack that referenced this issue Sep 19, 2019
One of the commits/PRs addressing
issue:apache#3195
GabrielBrascher pushed a commit to CLDIN/cloudstack that referenced this issue Sep 20, 2019
One of the commits/PRs addressing
issue:apache#3195
@andrijapanicsb
Copy link
Contributor

guys, any update on this one? I don't see it coming to 4.14 due to a needed effort?

@rohityadavcloud rohityadavcloud modified the milestones: 4.14.0.0, 4.15.0.0 Jan 14, 2020
@rohityadavcloud
Copy link
Member

Given the time it won't be possible to completely do it and test within 4.14, let's do it against 4.15.

@wido
Copy link
Contributor Author

wido commented Jan 14, 2020

@GabrielBrascher Has done work on this and he can comment on how far he got.

@GabrielBrascher
Copy link
Member

GabrielBrascher commented Jan 15, 2020

@rhtyd @andrijapanicsb I am testing and re-working with PR #3730 right now. However, considering the tight schedule, it might be better to keep such changes to the next release indeed.

@rohityadavcloud
Copy link
Member

@DaanHoogland can you review that's remaining and being targetted for 4.16; I suppose except for component tests and VR scripts all are 100% complete? Even component tests are all migrated to py3? cc @nvazquez @sureshanaparti

@DaanHoogland
Copy link
Contributor

yes, component tests are migrated and #5082 is open for fixing (some of) them. The VR is not done and there are some obscure tests in test/integration/testpaths and some in test/integration/plugins
nothing else that I know of.

@nvazquez
Copy link
Contributor

nvazquez commented Sep 7, 2021

Thanks @DaanHoogland - PR 5082 is merged but there are still some component tests to migrate?
@GabrielBrascher are you still working on this PR for VR code? #4807

@rohityadavcloud rohityadavcloud modified the milestones: 4.16.0.0, 4.17.0.0 Sep 8, 2021
@GabrielBrascher
Copy link
Member

@nvazquez I need to roll a couple more tests.
Let's have it in the next release, for 4.16 it might be risky to have it.
Thanks!

@DaanHoogland
Copy link
Contributor

Thanks @DaanHoogland - PR 5082 is merged but there are still some component tests to migrate?
@GabrielBrascher are you still working on this PR for VR code? #4807

not to migrate but to fix. component tests have been neglected way too long.

@DaanHoogland DaanHoogland modified the milestones: 4.17.0.0, 4.18.0.0 Oct 8, 2021
@DaanHoogland
Copy link
Contributor

DaanHoogland commented Oct 8, 2021

VR python scripts are not addressed and may not before 4.17. for now I'm keeping this open, just for the sake of the VR scripts.

@DaanHoogland
Copy link
Contributor

as there are no plans for doing this in 4.18 I'm moving this to 'unplanned'.

@rohityadavcloud
Copy link
Member

I think at some point our systemvmtemplate based OS (Debian 11) will EOL, so our runway may be limited by that. For this reason we may need to migrate the VR scripts to py3 or rework the VR agent approach.

Thanks @wido all, I think most of the items are done except migration of the VR scripts for which I've created a new ticket - #7500

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Python Warning... Python code Ahead! python3
Projects
None yet
Development

No branches or pull requests

8 participants