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

Update Codespaces configuration #60900

Merged
merged 1 commit into from
Oct 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified .devcontainer/scripts/onCreateCommand.sh
100644 → 100755
Empty file.
6 changes: 3 additions & 3 deletions .github/workflows/create-codespaces-prebuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: github/codespaces-precache@v1.0.1
- uses: github/codespaces-precache@v1-stable
with:
regions: WestUs2
sku_name: standardLinux32gb
regions: WestUs2 EastUs WestEurope
Copy link
Member

Choose a reason for hiding this comment

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

I don't know which countries WestEurope include. One of the mono developers lives in Romania. Don't know that counts as WestEurope or EastEurope. What about Czech Republic (Prague)?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know where I could go to see the exact build commands for mono?

Here's the .sh script that runs during the pre-build process:

./build.sh libs+clr -rc Release

You can edit this script to build whatever we need.

I don't know which countries WestEurope include. One of the mono developers lives in Romania. Don't know that counts as WestEurope or EastEurope. What about Czech Republic (Prague)?

See #60900 (comment) for the available regions.

sku_name: premiumLinux
Copy link
Member

Choose a reason for hiding this comment

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

What are the implications of which regions we select and which sku we use?

Copy link
Member Author

Choose a reason for hiding this comment

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

which regions we select

Honestly this took the most time to track down. Which GH server your requests go to depends on your physical location. There are 4 available regions - WestUs2 EastUs WestEurope SouthEastAsia. When I (located in the middle of the US) created a new Codespace I wasn't getting a pre-built image. Instead it would create a new container from scratch. There was no indication of why. I needed to contact GH support, and they let me know that my requests were going to EastUs. So I added EastUs to cover the rest of the US, and WestEurope to cover the team members in Europe. We can add SouthEastAsia in the future, if necessary.

which sku we use

See https://github.com/github/codespaces-precache#valid-sku-names. I switched from 4-core to 8-core. This doubles the price of the machines, but also makes them faster. https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-codespaces#codespaces-pricing.

Originally I did this in order to speed up our build - the libs+clr -rc Release build was taking over 30 minutes on the 4-core machines. Maybe now since they are pre-built it might not matter as much. I figured the dev experience would be better on the 8-core machines. We can scale this back to 4-core (now or later), if we want.

I believe when a dev creates their codespace machine, they need to pick the same size as what is listed here in order to get the pre-built. I will test this out today to verify.

Looking around - Rails is using 16-core largePremiumLinux sku. VSCode is using 4-core.

Copy link
Contributor

@terrajobst terrajobst Oct 27, 2021

Choose a reason for hiding this comment

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

@eerhardt that makes sense. Do we know how this impacts billing?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know who gets the bill. @danmoseley ?

It will definitely make the bill go up.

Copy link
Contributor

Choose a reason for hiding this comment

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

I know who gets the bill (the dotnet org is part of the DNF enterprise account, so they are being billed). What I don't know is how your changes impact billing. Like, did we just make it 4x as expensive?

Copy link
Member

Choose a reason for hiding this comment

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

@eerhardt I tried a few difference sizes and settled on 8-core.

Copy link
Member

Choose a reason for hiding this comment

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

Just to note what Eric pointed out above -- if a dev picks up a pre-built, and then just iterates on a small part of the tree and running tests, they may not need such a beefy machine. @vcsjones I'm guessing you were building the whole tree.

Copy link
Member

Choose a reason for hiding this comment

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

@vcsjones I'm guessing you were building the whole tree.

Yeah, but I often end up doing a ./build.sh -clean anyway and rebuilding things from scratch. I probably don't need to as often as I do, but, it's usually the quickest way for me to get unstuck when I have angered all of the tools. Usually I end up doing this as a result of a branch switch (I don't use a codespace per-branch).

Copy link
Member

Choose a reason for hiding this comment

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

@terrajobst the cost is doubled per hour:

image

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe when a dev creates their codespace machine, they need to pick the same size as what is listed here in order to get the pre-built. I will test this out today to verify.

I tried this. The developer does in fact need to pick the same size machine as we pick here. I created a new 4-core Codespace, and it didn't use a pre-built. I created a new 8-core Codespace, and it did use a pre-built. I will give this feedback to the Codespaces team. It doesn't seem ideal that all the devs need to pick the same size machine.

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}