Update test farm tests to stop using certbot-auto#8207
Conversation
|
I thought of an unfortunate interaction between this PR and #8206 dropping Python 3.5 support. This PR switches some of our tests to use the Python 3 packages provided by the OS, but some of those versions of Python are 3.5. Running the test farm tests on the combination of these two PRs, the images for Debian 9 and Ubuntu 16.04 are affected. See https://dev.azure.com/certbot/certbot/_build/results?buildId=2480&view=results. In the short term, I think we should continue with both PRs and stop running In the long term, I think we should continue not running It would be nice to run continue to run We could block one of our PRs on this if we want, but given how we have no work planned on our Apache plugin in the medium term, I think it's fine to go forward with these changes and add updating What do you think @ohemorange? |
|
I think we should go ahead and merge the other PR, first thing. It might not be too bad to install python3.6 on debian 9 from source? I can take a quick shot at that. Otherwise the plan sounds good. I think I prefer upgrading python to switching around the test order. |
OK. I realized our website builds will also break with that change, but I'm working on that now.
Thanks. Sorry I didn't anticipate the interactions here. Couple things:
It may be nice to always use an external Python version in Finally, in case it's useful, I got things to work on Ubuntu 20.04 with |
Probably not, though I can imagine theoretical other problems with deprecations if we go too new.
Depends on how debian 9 goes.
That might make this easier, actually.
That is useful, thanks! I'll give that a shot, getting the dependencies shouldn't be too bad. |
|
EDIT: nvm, I had the user wrong. |
…to_upgrades.sh and test_letsencrypt_auto_certonly_standalone.sh
6079fca to
7ab3d5f
Compare
|
Tests are passing after merging in |
Oh wait. I just realized. If we just use a new enough OS for our arm rep, we absolutely do not need to solve this. woo. |
|
Here's a passing test farm run with the deprecate py35 PR merged in: https://dev.azure.com/certbot/certbot/_build/results?buildId=2488&view=results |
bmw
left a comment
There was a problem hiding this comment.
To flag this again as part of the review as well to help us remember, we'll need to update the release instructions after this lands.
| # instance, Fedora uses Python 3 and Python 2 is not installed. | ||
| . tests/letstest/scripts/set_python_envvars.sh | ||
|
|
||
| "$VENV_SCRIPT" -e acme[dev] -e certbot[dev,docs] -e certbot-apache |
There was a problem hiding this comment.
Whoops. It looks like most of the rest of this script has been deleted or commented out.
There was a problem hiding this comment.
???????????????? oops
| #----------------------------------------------------------------------------- | ||
| #Ubuntu | ||
| - ami: ami-0758470213bdd23b1 | ||
| name: ubuntu20.04 |
There was a problem hiding this comment.
Nice! This PR basically resolves #7915 too.
In this or another PR, I'd kind of like to add this amd64 image to apache2_targets.yaml but otherwise it's resolved in my book.
tests/letstest/targets.yaml
Outdated
| userdata: | | ||
| #cloud-config | ||
| runcmd: | ||
| - yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional |
There was a problem hiding this comment.
Do you know if there's a potential race condition where our test farm test scripts start before this command is executed?
There was a problem hiding this comment.
we rely on runcmd elsewhere so I had assumed not, but that could explain the one spurious failure in azure that I obviously couldn't check the logs on.
There was a problem hiding this comment.
I'm not sure, but I suspect the other runcmd commands aren't really needed.
I personally think we should either convince ourselves we're not adding a race condition here or move this code to bootstrap_os_packages.sh. I think the latter shouldn't be too hard. I'm imagining something like:
BootstrapRpmPython3() {
InitializeRPMCommonBase
python_pkgs="python3
python3-devel
"
if ! $TOOL list python3-devel >/dev/null 2>&1; then
yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional
python_pkgs="$python_pkgs
python3-devel.x86_64
"
fi
BootstrapRpmCommonBase "$python_pkgs"
}
but I didn't test that code.
EDIT: Flipped logic so it hopefully works.
There was a problem hiding this comment.
I'm fine with just moving it there.
tests/letstest/targets.yaml
Outdated
| #cloud-config | ||
| runcmd: | ||
| - yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional | ||
| - yum install -y python3-devel.x86_64 |
There was a problem hiding this comment.
nit: Is this line needed with BootstrapRpmPython3 installing python3-devel? My understanding is the two package names are equivalent except this one hard codes the architecture while the other will just use the architecture of the machine its running on which should also be x86_64.
There was a problem hiding this comment.
It does seem to be required, yes. It couldn't find python3-devel, which is why I added this here. Various q&as I found all do seem to indicate you specifically need the architecture on this machine, as well.
There was a problem hiding this comment.
"elsewhere" being a few lines down, here: https://github.com/certbot/certbot/pull/8207/files#diff-776152681de94287606432a9922f03f8L81
There was a problem hiding this comment.
It couldn't find python3-devel even after you enabled the necessary repos? That surprises me but trying to install the package twice doesn't hurt anything.
There was a problem hiding this comment.
it's possibly that I didn't test that iteration! there were many things I tried. I'll double-check.
There was a problem hiding this comment.
you're right, we don't need to specify the arch
There was a problem hiding this comment.
ah, I've just remembered -- it's because python3-devel is neither necessary nor available on RHEL/centos8.
There was a problem hiding this comment.
yum install python3-devel seems to work on CentOS/RHEL 8, but yum list python3-devel does not.
I think we can fix the list command by changing the command to if ! $TOOL list 'python3*-devel' >/dev/null 2>&1; then.
The problem seems to be that python3-devel is an alias for python36-devel with the install subcommand on CentOS/RHEL 8, but not the list subcommand.
There was a problem hiding this comment.
oh, I like that better than how I have it.
|
Tests are failing after uncommenting apache2, oops, I'll look into that. |
…tential race condition
bmw
left a comment
There was a problem hiding this comment.
LGTM!
Thanks for doing this. I think this is a big step towards dropping certbot-auto and Python 2.7 which I'm personally pretty excited about.
Can you take care of updating the release instructions?
Yep, for sure.
Me too! |
Fixes #7955.
Fixes #7915.
auto_targets.yamlis just a copy of thetargets.yamlfrom before any changes made in this PR.bootstrap_os_packages.shis a copy ofcertbot-autowith many, many things removed. It only usespython3, and thepython3-devel.x86_64package is added for RHEL7.Python36SCL is enabled in the calling scripts by adding its location to
PATHfor centos6.The updated test scripts also only use Python3 now. We still need
set_python_envvars.shfortest_letsencrypt_auto_certonly_standalone.sh.The change to
targets.yamlis fortest_sdists.shon RHEL7 to installpython3-devel, since we don't use site packages and need headers available to compile.The commit history got a little messed up with which changes should go with which commit message, so it may be confusing to go commit by commit.
After this is merged, we should:
auto_targets.yamlfortest_leauto_upgrades.shandtest_letsencrypt_auto_certonly_standalone.sh.