Skip to content

Switch Centos 7 build of azure-cli to use Python 3#11235

Merged
fengzhou-msft merged 1 commit intoAzure:devfrom
rodrigc:centos-python3
Nov 20, 2019
Merged

Switch Centos 7 build of azure-cli to use Python 3#11235
fengzhou-msft merged 1 commit intoAzure:devfrom
rodrigc:centos-python3

Conversation

@rodrigc
Copy link
Copy Markdown
Contributor

@rodrigc rodrigc commented Nov 14, 2019

Fixes #11234 #11206


This checklist is used to make sure that common guidelines for a pull request are followed.

  • The PR has modified HISTORY.rst describing any customer-facing, functional changes. Note that this does not include changes only to help content. (see Modifying change log).

  • I adhere to the Command Guidelines.

@rodrigc rodrigc requested a review from zikalino as a code owner November 14, 2019 20:29
@rodrigc rodrigc changed the title Switch Centos build azure-cli with Python 3 Switch Centos 7 build of azure-cli to use Python 3 Nov 14, 2019
@fengzhou-msft fengzhou-msft self-requested a review November 15, 2019 04:20
@fengzhou-msft fengzhou-msft self-assigned this Nov 15, 2019
@fengzhou-msft
Copy link
Copy Markdown
Member

Hi @rodrigc, thanks for submitting this PR. Since our el7 rpm package is also targeting RHEL 7, will the package built with Python 3 work on RHEL 7 as well? As far as I know, RHEL 7 does not support Python 3 officially.

@rodrigc
Copy link
Copy Markdown
Contributor Author

rodrigc commented Nov 15, 2019

@fengzhou-msft from my branch with this PR, I was able to successfully build following these instructions:

https://github.com/Azure/azure-cli/blob/dev/scripts/release/rpm/README.md

docker build --target build-env -f ./scripts/release/rpm/Dockerfile.centos -t mcr.microsoft.com/azure-cli:centos7-builder .

I was then also able to successfully yum install this package in a Centos 7 environment
and run it.

@rodrigc
Copy link
Copy Markdown
Contributor Author

rodrigc commented Nov 15, 2019

If you want to double check, you can follow the instructions at to create a clean centos/7 environment: https://app.vagrantup.com/centos/boxes/7

  1. Create a directory:
mkdir centos-7-clean
cd centos-7-clean
  1. In this directory:

Create a file:

Vagrant.configure("2") do |config|
  config.vm.box = "centos/7"
end
  1. In the same directory, create the VM:
vagrant up
  1. When VM is created, log into it:
vagrant ssh

Then in that clean Centos7 environment, you can build the Centos7 azure-cli rpm package and run it.

I am running the Centos7 package built from my branch in a Centos7 environment used in my automation testing.

@rodrigc
Copy link
Copy Markdown
Contributor Author

rodrigc commented Nov 15, 2019

@fengzhou-msft
Copy link
Copy Markdown
Member

@rodrigc Your changes work perfectly with Cento 7. I will try to install Python 3 on RHEL 7 according to your link and see how the package works on RHEL 7.

@fengzhou-msft fengzhou-msft added this to the S162 milestone Nov 17, 2019
@fengzhou-msft
Copy link
Copy Markdown
Member

@fengzhou-msft fengzhou-msft merged commit ddd648a into Azure:dev Nov 20, 2019
@rodrigc rodrigc deleted the centos-python3 branch November 21, 2019 06:38
@rodrigc
Copy link
Copy Markdown
Contributor Author

rodrigc commented Nov 21, 2019

@fengzhou-msft thanks for accepting my patch.

One question, will Azure-cli drop support for Python 2.7? Maybe that can be done in 2020

@fengzhou-msft
Copy link
Copy Markdown
Member

We've planned that in S163, first release in 2020.

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

Successfully merging this pull request may close these issues.

azure-cli yum package is using Python 2.7, should use Python 3.6

2 participants