1

我正在使用Bluemix ToolChain 服务,即CI 服务。

部署暂存失败,因为no space left to device.

我使用 manifest.yml 将 disk_quota 设置默认更改为 1024M 和 2048MB,但两个结果都与默认 disk_quota 相同。

我还尝试将 buildpack 设置为sdk-for-nodejs默认值,因为如果我使用默认值,它将下载许多不必要的 buildpack 文件(例如 java 相关的 buildpack)。我以为它会带来节省空间,但结果又是一样的。

我怎样才能解决这个问题?你有什么想法?

这是错误日志。(日志太长,我把部分日志换成“:”)

Target: https://api.ng.bluemix.net
Using manifest file /home/pipeline/aafdbd4d-c22d-4fee-ae34-8d1146cacb56/manifest.yml

:
:
Uploading 101M, 117985 files


Done uploading
OK

:
:
Downloading sdk-for-nodejs...
Downloaded sdk-for-nodejs
Creating container
Successfully created container
Downloading app package...
Downloaded app package (107.3M)
Downloading build artifacts cache...
Downloaded build artifacts cache (6M)
Staging...
-----> IBM SDK for Node.js Buildpack v3.10-20170119-1146
       Based on Cloud Foundry Node.js Buildpack v1.5.24
-----> Creating runtime environment

       NPM_CONFIG_LOGLEVEL=error
       NODE_MODULES_CACHE=true
-----> Installing binaries
       engines.node (package.json):  unspecified
       engines.npm (package.json):   unspecified (use default)

       Resolving node version (latest stable) via 'node-version-resolver'
       Installing IBM SDK for Node.js (4.7.2) from cache
-----> Restoring cache
-----> Checking and configuring service extensions before installing dependencies
-----> Building dependencies
       Prebuild detected (node_modules already exists)
       Rebuilding any native modules
       Skipping cache restore (new runtime signature)
       body-parser@1.17.1 /tmp/app/node_modules/body-parser
       :
       :
       core-util-is@1.0.2 /tmp/app/node_modules/webpack/node_modules/memory-fs/node_modules/readable-stream/node_modules/core-util-is
-----> Installing App Management
-----> Caching build
       Saving 2 cacheDirectories (default):
       Clearing previous node cache
       - node_modules
-----> Build succeeded!
       ├── body-parser@1.17.1
       ├── bootstrap@3.3.7
       ├── config@1.25.1
       ├── express@4.15.2
       ├── jquery@3.1.1
       ├── react@15.4.2
       ├── react-dom@15.4.2
       ├── react-redux@4.4.6
       ├── redux@3.6.0
       ├── redux-thunk@2.2.0
       ├── request@2.80.0
       └── request-promise@4.1.1

cp: cannot create regular file ‘/tmp/contents666597699/app/node_modules/babel-core/node_modules/babel-register/node_modules/core-js/library/modules/_date-to-primitive.js’: No space left on device
:
:
cp: cannot create regular file ‘/tmp/contents666597699/app/node_modules/babel-core/node_modules/babel-register/node_modules/core-js/library/modules/es6.regexp.search.js’: No space left on device
cp: : No space left on device
Exit status 1
Staging failed: Exited with status 1
Destroying container
cp: cannot create regular file ‘/tmp/contents666597699/app/node_modules/babel-core/node_modules/babel-register/node_modules/core-js/library/modules/_wks.js’: No space left on device
Successfully destroyed container

FAILED
Error restarting application: StagingError

TIP: use 'cf logs kcuc-web --recent' for more information

Finished: FAILED

这也是我的 manifest.yml 文件。

applications:
- path: .
  memory: 256M
  instances: 1
  domain: mybluemix.net
  name: xxxxx
  host: xxxxx
  disk_quota: 1024M
  buildpack: sdk-for-nodejs
  env:
    DEBUG: 'false'
    API_PROTOCOL: https
    API_HOST: xxxxx.mybluemix.net
    API_PORT: '443'
    CLIENT_PORT: '443'
4

1 回答 1

3

我在 developerWorks 上得到了答案。(谢谢你,托德·卡普林格。)

在部署阶段复制不必要的 node_modules 目录是根本原因。所以,我必须添加.cfignore和添加node_modules/. (语法类似于.gitignore

(为什么不需要?因为 build -> deploy 是链式过程,所以 build 已经完成。在这种情况下, node_modules 目录在 deploy 阶段是不必要的。)

之后,下载应用程序包大小变为 1MB 以下,消除了不必要的复制任务。结果,不仅部署成功,而且部署登台速度变得更快。

于 2017-03-09T03:19:29.350 回答