Download wp-calypso/packages/calypso-doctor/evaluations/docker-memory.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 676 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/calypso-doctor/evaluations/docker-memory.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/packages/calypso-doctor/evaluations/docker-memory.js
-
curl -L -o docker-memory.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/calypso-doctor/evaluations/docker-memory.js
676 Bytes
| const { getDockerConfig, isDockerInstalled } = require( '../lib' ); | |
| module.exports = { | |
| title: 'Memory allocated', | |
| group: 'Docker', | |
| description: 'Ensures Docker has enough memory 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' ); | |
| return; | |
| } | |
| const { memoryMiB } = await getDockerConfig(); | |
| if ( memoryMiB < 8192 ) { | |
| fail( 'Docker needs at least 8gb' ); | |
| return; | |
| } | |
| pass(); | |
| }, | |
| fix: () => { | |
| return `Edit Docker configuration and assign 8gb of memory`; | |
| }, | |
| }; | |