NUMBER_OF_PROCESSORS not set on the windows workers #25133
-
Would it be possible to set NUMBER_OF_PROCESSORS on the Windows workers? I noticed it is not set because our builds takes long, this is normally set by Windows for the amount of processors available. |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments
-
Hi @jwillemsen , GitHub hosts Windows runners on Standard_DS2_v2 virtual machines in Microsoft Azure, more compute options may be added in the future but currently it’s not supported to set the number of the processors. The first offering here will be the ability to provide self-hosted runners, so you can bring your own compute needs to GitHub Actions. Thanks. |
Beta Was this translation helpful? Give feedback.
-
It would help when NUMBER_OF_PROCESSORS would be set by GitHub/azure, so that we can retrieve the number of processors available in our script |
Beta Was this translation helpful? Give feedback.
-
Thanks for your reply! @jwillemsen. According to the policy, it’s recommened to raise a ticket here where github product manager will take a review. |
Beta Was this translation helpful? Give feedback.
-
I’m a bit confused. If you run the following:
NUMBER_OF_PROCESSORS is set to 2? See any Windows job at https://github.com/MSP-Greg/actions-image-testing/actions |
Beta Was this translation helpful? Give feedback.
-
Thanks @msp-greg , you’re right, the ‘NUMBER_OF_PROCESSORS’ can be got from env. And the value can be set via ‘set-env’ command, code sample as below:
Hi @jwillemsen , sorry i misunderstood. No error reported if you change the value, but since the hosted runner is a 'Standard_DS2_v2 virtual machines in Microsoft Azure, i’m not sure if it works for you, could you please kindly check? Thanks. |
Beta Was this translation helpful? Give feedback.
-
Thanks, I will retest, one remark, instead of powershell I am using cmd as shell. |
Beta Was this translation helpful? Give feedback.
-
Can confirm that it is set, didn’t check the logs in enough detail |
Beta Was this translation helpful? Give feedback.
I’m a bit confused. If you run the following:
NUMBER_OF_PROCESSORS is set to 2?
See any Windows job at https://github.com/MSP-Greg/actions-image-testing/actions