Skip to content

Conversation

@cognifloyd
Copy link
Member

@cognifloyd cognifloyd commented Feb 11, 2020

Switches travis to use Bionic with Mongo 4.0

Mongo 3.4 is not available in Bionic, so 4.0 is required.
Also, the test thresholds were increased to account for increased test times due to the mongo update.

@pull-request-size pull-request-size bot added the size/XS PR that changes 0-9 lines. Quick fix/merge. label Feb 11, 2020
@cognifloyd cognifloyd force-pushed the travis-bionic branch 8 times, most recently from e8ba30d to 85262da Compare February 13, 2020 06:50
Copy link
Contributor

@blag blag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review while WIP to point out alternative changes that should hopefully make your life easier.

@cognifloyd cognifloyd force-pushed the travis-bionic branch 2 times, most recently from 6d7c8d3 to 86e229a Compare February 13, 2020 17:16
@blag blag added this to the 3.2.0 milestone Feb 13, 2020
@pull-request-size pull-request-size bot added size/L PR that changes 100-499 lines. Requires some effort to review. and removed size/XS PR that changes 0-9 lines. Quick fix/merge. labels Feb 13, 2020
@cognifloyd cognifloyd force-pushed the travis-bionic branch 2 times, most recently from bb47419 to 2863e4b Compare February 14, 2020 01:21
@cognifloyd cognifloyd changed the title WIP switch travis to bionic switch travis to bionic Feb 14, 2020
@cognifloyd
Copy link
Member Author

Mongo 4.0 significantly changes the test runtimes. 2x was too much of a
jump, so this is approximately 60s more than the last successful run
time. That comes out to (test time used to calculate in parentheses):

24% increase for "Unit Tests (Python 2.7 MongoDB 4.0)" (812s)
37% increase for "Integration Tests (Python 2.7)" (903s)
95% increase for "Lint Checks, Packs Tests (Python 2.7)" (490s)
71% increase for "Unit Tests, Pack Tests (Python 3.6)" (1101s)
252% increase for "Integration Tests (Python 3.6)" (1031s)

Note that this PR also fixes the Python 3.6 integration tests to
actually run in python 3.6 instead of 2.7, so that might account for
some of the significant test time increase.

When we move to python 3.7 that will probably decrease the py3 times.

@cognifloyd cognifloyd changed the title switch travis to bionic Switch travis to use Bionic, Mongo 4.0, and RabbitMQ 3.8 Feb 14, 2020
@cognifloyd cognifloyd requested a review from blag February 14, 2020 03:41
@cognifloyd
Copy link
Member Author

This is ready. I updated the PR description to better cover the updates required in moving to Bionic.

@arm4b arm4b removed this from the 3.2.0 milestone Feb 16, 2020
Copy link
Member

@arm4b arm4b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to timing stats you provided, we'd likely go with the #4863 Xenial + Mongo 3.4 for the st2 Unit + Integration tests.

It's really good to have the choice here, so thanks for the extended testing and timing breakdown! 👍

Copy link
Contributor

@blag blag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still have some questions.

if [ "${TASK}" = 'compilepy3 ci-py3-unit' ] || [ "${TASK}" = 'ci-py3-integration' ]; then
pip install "tox==3.8.6"

# cleanup any invalid python2 cache
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whitespace issues here - using tabs when the rest of the file uses spaces.

if [ "${UBUNTU_VERSION}" == "xenial" ]; then
echo "Applying workaround for stanley user permissions issue to /home/travis on Xenial"
chmod 777 -R /home/travis
if [ "${UBUNTU_VERSION}" == "xenial" ] || [ "${UBUNTU_VERSION}" == "bionic" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you duplicated this logic into the new scripts/travis/permissions-workaround.sh, then I would remove this code here, and simply call that script here. Alternatively, you could use make magic to build both targets.

# code and runs tests under a different system user).
if [ "${UBUNTU_VERSION}" == "xenial" ] || [ "${UBUNTU_VERSION}" == "bionic" ]; then
echo "Applying workaround for stanley user permissions issue to /home/travis on Xenial/Bionic"
chmod -R a+rwX /home/travis
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make more sense to change the ownership of some of the files in /home/travis to stanley instead of trying to chmod them to the appropriate settings?

And even if it still makes sense to use chmod, we still should not be setting all of the bits. We should be as selective as possible.

No longer needed without the old xenial permissions workaround that set
the entire /home/travis with 777 perms.
The Makefile defaults PYTHON_VERSION to python2.7 so the virtualenv was
building with python2.7 even in the 3.6 tests, and then it was cached
for future test runs with python2.7. This resolves both of those issues.
The .circle/add-itest-user.sh was actually running for all tasks, so
this removes the if statement.

The permissions workaround needed to run for packs-tests and integration
tests, but there was no easy way to target those unless we separate the
py3 packs-tests from the py3 unit tests. That also makes it much easier
to reason about the different travis environments to understand how they
map to make targets and tox envs.

That also made it clear that one of the tox envs was not getting
pre-built, so this adjusts install-requirements.sh to account for it.
The timing of several make targets is higher than the threshold. For
ci-py3-integration, it looks like that threshold is far too short for
what the tests regularly take. So, this adjust the thresholds to be
about 60s more than the last successful build in travis.

make target: orig threshold=>new threshold (reference duration)

ci-unit:                    700=>740 (686)
ci-integration:             700=>740 (683)
ci-checks ci-packs-tests:   280=>440 (381)
...-py3-unit ci-py3-pac...: 680=>740 (689)
ci-py3-integration:         310=>720 (660)
Mongo 4.0 significantly changes the test runtimes. 2x was too much of a
jump, so this is approximately 60s more than the last successful run
time. That comes out to (test time used to calculate in parentheses):

24% increase for "Unit Tests (Python 2.7 MongoDB 4.0)" (812s)
37% increase for "Integration Tests (Python 2.7)" (903s)
95% increase for "Lint Checks, Packs Tests (Python 2.7)" (490s)
71% increase for "Unit Tests, Pack Tests (Python 3.6)" (1101s)
252% increase for "Integration Tests (Python 3.6)" (1031s)

Note that this PR also fixes the Python 3.6 integration tests to
actually run in python 3.6 instead of 2.7, so that might account for
some of the significant test time increase.

When we move to python 3.7 that will probably decrease the py3 times.
@blag blag closed this in #4863 Feb 21, 2020
@cognifloyd cognifloyd changed the title Switch travis to use Bionic, Mongo 4.0, and RabbitMQ 3.8 Switch travis to use Bionic, Mongo 4.0 Feb 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement infrastructure: ci/cd size/L PR that changes 100-499 lines. Requires some effort to review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants