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

Chore: Faster devcontainer start #671

Merged
merged 2 commits into from
Jun 13, 2022
Merged

Conversation

afeld
Copy link
Contributor

@afeld afeld commented Jun 13, 2022

Punchline up front: This speeds up devcontainer start time by around five minutes on my machine.

The start time of a devcontainer was becoming a regular annoyance for me, enough so that I was finding myself working outside of it, which kinda defeats the purpose. I spent a bit of time to improve a couple of things that would make a big difference:

  • Install pre-commit dependencies at dev image build time, which is infrequent/cached
  • Don't bother installing Cypress in the devcontainer, since it wasn't being used (and maybe wasn't even working?) in there anyway. @machikoyasuda Can you confirm?

While it doesn't complete all the tasks listed, I'm going to say this closes #495 as being "good enough."

afeld added 2 commits June 13, 2022 05:22
The pre-commit "environments" (dependencies) now get installed during image build rather than devcontainer start. This shaves a minute off the start time on my machine.
It didn't sound like anyone (including GitHub Actions) was using Cypress in the devcontainer, so this skips that installation to speed up the devcontainer start time.
@afeld afeld requested a review from a team as a code owner June 13, 2022 13:58
@github-actions github-actions bot added the documentation [auto] Improvements or additions to documentation label Jun 13, 2022
Copy link
Member

@thekaveman thekaveman left a comment

Choose a reason for hiding this comment

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

Looks good to me. I do think we should have an alternative to running Cypress locally - maybe another container (though I think there are some challenges there).

I would like @machikoyasuda to weigh in especially from the Cypress POV.

@thekaveman thekaveman requested a review from machikoyasuda June 13, 2022 15:08
Copy link
Member

@machikoyasuda machikoyasuda left a comment

Choose a reason for hiding this comment

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

Good for me 👍

I confirmed that Cypress runs correctly with the existing Documentation instructions:
image

The one thing is that everyone now must be able to run Cypress locally - @angela-tran @thekaveman @afeld -- can y'all run the Cypress specs locally?

@afeld
Copy link
Contributor Author

afeld commented Jun 13, 2022

I do think we should have an alternative to running Cypress locally - maybe another container

Cypress does support Docker Compose, though any time X11 is involved, I think it may be more trouble than it's worth 🙃

@thekaveman
Copy link
Member

any time X11 is involved, I think it may be more trouble than it's worth 🙃

Oh goodness yes! I meant a container to run the CLI-based tests, not the UI!

@afeld
Copy link
Contributor Author

afeld commented Jun 13, 2022

can y'all run the Cypress specs locally?

I can run it, though I get some failures. Might be worth a screen share to troubleshoot at some point, since I feel like I've heard others say the same.

I meant a container to run the CLI-based tests, not the UI

Since we're already going to recommend people install Cypress locally and GitHub Actions runs it directly in the runner, not sure there's a ton of value. We can re-add later if needed.

@afeld afeld merged commit 5f6c16a into dev Jun 13, 2022
@afeld afeld deleted the chore/faster-devcontainer-start branch June 13, 2022 17:17
@angela-tran
Copy link
Member

I realize I'm a bit late to this convo and that the branch has already been merged, which is totally fine.

I just wanted to echo @thekaveman 's preference for having an alternative to running Cypress locally. I would use Cypress in the devcontainer to run tests with the CLI. The thing that didn't work from the devcontainer was launching the test runner UI. Hopefully we have some time in the future to look into defining a separate container.

@thekaveman
Copy link
Member

Also a late realization: this PR did not remove any of the node/npm installation steps that were only required because Cypress was installed in there too! Building the devcontainer from scratch still takes a while with all these steps... will post a quick follow-up.

thekaveman added a commit that referenced this pull request Jun 13, 2022
since Cypress was removed from the devcontainer install in #671
we don't need all the node/npm bits in there anymore
thekaveman added a commit that referenced this pull request Jun 13, 2022
since Cypress was removed from the devcontainer install in #671
we don't need all the node/npm bits in there anymore
@thekaveman thekaveman added this to the Dev environment cleanups milestone Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation [auto] Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Speed up time to development environment
4 participants