Download wp-calypso/packages/calypso-doctor/evaluations/docker-cpu.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 644 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/calypso-doctor/evaluations/docker-cpu.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/packages/calypso-doctor/evaluations/docker-cpu.js
-
curl -L -o docker-cpu.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/calypso-doctor/evaluations/docker-cpu.js
644 Bytes
| const { getDockerConfig, isDockerInstalled } = require( '../lib' ); | |
| module.exports = { | |
| title: 'CPUs allocated', | |
| group: 'Docker', | |
| description: 'Ensures Docker has enough CPUs allocated', | |
| test: async ( { pass, fail, ignore } ) => { | |
| if ( process.platform !== 'darwin' ) { | |
| ignore( 'This evaluation only works in OSX' ); | |
| return; | |
| } | |
| if ( ! ( await isDockerInstalled() ) ) { | |
| ignore( 'Docker is not installed' ); | |
| } | |
| const { cpus } = await getDockerConfig(); | |
| if ( cpus < 4 ) { | |
| fail( 'Docker needs at least 4 CPUs' ); | |
| return; | |
| } | |
| pass(); | |
| }, | |
| fix: () => { | |
| return `Edit Docker configuration and assign 4 CPUs`; | |
| }, | |
| }; | |