Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Mar 26, 2021

Changes:

  • Disable HardSource, Terser, type checking, and linting in CircleCI
  • Increase # parallel instances in CircleCI from 10 to 20 — time spent running the tests is now an actual bottleneck
  • In Cypress, spread out streamlit hello and component-template tests across instances
  • Turn on caching for babel-loader
  • Remove no_credentials parameter in run_test() in run_e2e_scripts.py as it was not being used
  • Parallelize our Python integration tests
  • Parallelize frontend tests

An entire CircleCI build now takes about 5 minutes, down from 8-15. (This is assuming a warm CircleCI cache. It invalidates at midnight UTC, in which case creating the virtualenv takes an extra 2-3 minutes, and saving it to cache takes an extra 1-2 minutes. I don't know why.)

@ghost ghost changed the title Try speeding up CircleCI more Speed up CircleCI more Mar 26, 2021
@ghost ghost marked this pull request as ready for review March 29, 2021 20:05
@ghost ghost self-requested a review March 29, 2021 20:05
Comment on lines 45 to 52
// end-to-end tests, as well as our production builds, so adding an
// environment variable to disable it
if (!process.env.BUILD_AS_FAST_AS_POSSIBLE) {
// HardSourceWebpackPlugin adds aggressive build caching
// to speed up our slow builds.
// https://github.com/mzgoddard/hard-source-webpack-plugin
webpackConfig.plugins.unshift(new HardSourceWebpackPlugin())
}
Copy link
Collaborator

@vdonato vdonato Mar 29, 2021

Choose a reason for hiding this comment

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

Am I right in guessing that hardsource slows down builds initially, but we get the benefits later when we actually get to utilize the cache (which is why it's useful in dev mode but not when building wheels since in that case things are only built once)?

If this isn't the case then I think we can probably just get rid of it judging from what the comment here says it's added for

Copy link
Author

@ghost ghost Mar 30, 2021

Choose a reason for hiding this comment

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

Am I right in guessing that hardsource slows down builds initially, but ...

Yes, exactly.

Truthfully, I also find the claim that it speeds up dev builds to be kind of dubious — I've turned it off and not noticed any difference — but that's a different beast to tame.

I've added a more concise and explanatory comment.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@bh-streamlit, I'm +1 on removing it completely. I haven't noticed any difference with it being turned off.

command: |
cd frontend
TEST=$(circleci tests glob ../e2e/specs/*.spec.js | circleci tests split --total=9 --split-by=timings)
TEST=$(circleci tests glob ../e2e/specs/*.spec.js | circleci tests split --split-by=timings)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just checking, but does the --total flag here get to be removed due to the change to no longer always assign the hello / component-template tests to a single instance?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, before we had some asinine logic (written by me) that explicitly set --total to the number of instances minus 1. That way one instance wouldn't receive any tests, and that was its cue to just run the hello/component-template tests.

@ghost ghost merged commit 846190f into streamlit:develop Mar 30, 2021
@ghost ghost deleted the speedup-circleci-more branch March 30, 2021 02:36
tconkling added a commit that referenced this pull request Mar 30, 2021
* develop:
  Set baseUrl to .
  Speed up CircleCI more (#3025)
  Add events to keep track of theme changes and other theme stats (#3012)
  Have MetricsManager enqueue events when disconnected (#3011)
  Fix for query param issue with base url (#2894)
  Add fuzzy search to selectbox (#2933)
  Informative repr methods for our python classes (#3027)
  ComponentInstance: handle iframe changes (#3015)
tconkling added a commit to tconkling/streamlit that referenced this pull request Mar 30, 2021
* st_form:
  Set baseUrl to .
  Speed up CircleCI more (streamlit#3025)
  Add events to keep track of theme changes and other theme stats (streamlit#3012)
  Have MetricsManager enqueue events when disconnected (streamlit#3011)
  Fix for query param issue with base url (streamlit#2894)
  Add fuzzy search to selectbox (streamlit#2933)
  Informative repr methods for our python classes (streamlit#3027)
  ComponentInstance: handle iframe changes (streamlit#3015)
This pull request was closed.
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.

2 participants