Openshift3构建意外失败

时间:2017-10-02 18:10:54

标签: node.js openshift node-sass

我有一个我试图部署到Openshift Online 3的node.js项目。我的项目有几个依赖项,我认为node-sass库可能是问题。通常,在尝试从github下载二进制文件或成功下载后,构建失败。

这是我得到的详细日志

Cloning "https://github.com/csutorasa/UI-toolkit" ...
I1002 17:46:11.413243       1 source.go:240] Cloning source from 
https://github.com/csutorasa/UI-toolkit
    Commit: 177c8bde324d9dcd07270caa11c2bdc1138bf332 (Build script fix)
Author: Ármin Csutorás <csutorasa@gmail.com>
Date:   Mon Oct 2 00:00:54 2017 +0200
I1002 17:46:12.028219       1 cfg.go:39] Locating docker auth for image registry.access.redhat.com/rhscl/nodejs-6-rhel7@sha256:b0b80d7bb0a1d69ef513a063c5fb3b074b02f699fd5437051233932dae7c864a and type PULL_DOCKERCFG_PATH
I1002 17:46:12.028246       1 cfg.go:49] Getting docker auth in paths : []
I1002 17:46:12.028316       1 cfg.go:39] Locating docker auth for image docker-registry.default.svc:5000/wizyx/wizyx:latest and type PUSH_DOCKERCFG_PATH
I1002 17:46:12.028332       1 cfg.go:49] Getting docker auth in paths : [/var/run/secrets/openshift.io/push]
I1002 17:46:12.028612       1 cfg.go:62] Using serviceaccount user for Docker authentication for image docker-registry.default.svc:5000/wizyx/wizyx:latest
I1002 17:46:12.028665       1 util.go:222] Pulling image "registry.access.redhat.com/rhscl/nodejs-6-rhel7@sha256:b0b80d7bb0a1d69ef513a063c5fb3b074b02f699fd5437051233932dae7c864a" ...
I1002 17:46:14.379461       1 docker.go:503] Using locally available image "registry.access.redhat.com/rhscl/nodejs-6-rhel7@sha256:b0b80d7bb0a..."
I1002 17:46:14.379501       1 docker.go:734] Image sha256:fba56b5381b7cca1dce7c50bf46ad62a3f22fac4eb051058025d541fe29b6324 contains io.openshift.s2i.scripts-url set to "image:///usr/libexec/s2i"
I1002 17:46:14.379692       1 sti.go:199] Preparing to build wizyx/wizyx-20:e9a4d396
I1002 17:46:14.379891       1 download.go:30] Copying sources from "/tmp/s2i-build073171127/upload/src" to "/tmp/s2i-build073171127/upload/src"
I1002 17:46:14.379958       1 sti.go:208] Clean build will be performed
I1002 17:46:14.379965       1 sti.go:211] Performing source build from file:///tmp/s2i-build073171127/upload/src
I1002 17:46:14.379972       1 sti.go:222] Running "assemble" in "wizyx/wizyx-20:e9a4d396"
I1002 17:46:14.379979       1 sti.go:558] Using image name registry.access.redhat.com/rhscl/nodejs-6-rhel7@sha256:b0b80d7bb0a1d69ef513a063c5fb3b074b02f699fd5437051233932dae7c864a
I1002 17:46:14.382462       1 docker.go:503] Using locally available image "registry.access.redhat.com/rhscl/nodejs-6-rhel7@sha256:b0b80d7bb0a..."
I1002 17:46:14.382510       1 sti.go:446] No user environment provided (no environment file found in application sources)
I1002 17:46:14.382604       1 sti.go:671] starting the source uploading ...
I1002 17:46:14.388034       1 docker.go:734] Image sha256:fba56b5381b7cca1dce7c50bf46ad62a3f22fac4eb051058025d541fe29b6324 contains io.openshift.s2i.scripts-url set to "image:///usr/libexec/s2i"
I1002 17:46:14.388056       1 docker.go:809] Base directory for S2I scripts is '/usr/libexec/s2i'. Untarring destination is '/tmp'.
I1002 17:46:14.388323       1 docker.go:974] Creating container with options {Name:"s2i_registry_access_redhat_com_rhscl_nodejs_6_rhel7_sha256_b0b80d7bb0a1d69ef513a063c5fb3b074b02f699fd5437051233932dae7c864a_d37d2cbe" Config:{Hostname: Domainname: User: AttachStdin:false AttachStdout:true AttachStderr:false ExposedPorts:map[] Tty:false OpenStdin:true StdinOnce:true Env:[OPENSHIFT_BUILD_NAME=wizyx-20 OPENSHIFT_BUILD_NAMESPACE=wizyx OPENSHIFT_BUILD_SOURCE=https://github.com/csutorasa/UI-toolkit OPENSHIFT_BUILD_REFERENCE=master OPENSHIFT_BUILD_COMMIT=177c8bde324d9dcd07270caa11c2bdc1138bf332 BUILD_LIBRARY=true BUILD_LOGLEVEL=3] Cmd:[/bin/sh -c tar -C /tmp -xf - && /usr/libexec/s2i/assemble] ArgsEscaped:false Image:registry.access.redhat.com/rhscl/nodejs-6-rhel7@sha256:b0b80d7bb0a1d69ef513a063c5fb3b074b02f699fd5437051233932dae7c864a Volumes:map[] WorkingDir: Entrypoint:[] NetworkDisabled:false MacAddress: OnBuild:[] Labels:map[] StopSignal:} HostConfig:&{Binds:[] ContainerIDFile: LogConfig:{Type: Config:map[]} NetworkMode:container:ae8c756111f1f1461e378705e9bcc00c2442e0dec695de1e0358bd7cd614a03d PortBindings:map[] RestartPolicy:{Name: MaximumRetryCount:0} AutoRemove:false VolumeDriver: VolumesFrom:[] CapAdd:[] CapDrop:[KILL MKNOD SETGID SETUID SYS_CHROOT] DNS:[] DNSOptions:[] DNSSearch:[] ExtraHosts:[] GroupAdd:[] IpcMode: Cgroup: Links:[] OomScoreAdj:0 PidMode: Privileged:false PublishAllPorts:false ReadonlyRootfs:false SecurityOpt:[] StorageOpt:map[] Tmpfs:map[] UTSMode: UsernsMode: ShmSize:67108864 Sysctls:map[] ConsoleSize:[0 0] Isolation: Resources:{CPUShares:0 Memory:536870912 CgroupParent:kubepods-burstable-pod895b4f8f_a799_11e7_b908_02ec8e61afcf.slice BlkioWeight:0 BlkioWeightDevice:[] BlkioDeviceReadBps:[] BlkioDeviceWriteBps:[] BlkioDeviceReadIOps:[] BlkioDeviceWriteIOps:[] CPUPeriod:0 CPUQuota:0 CpusetCpus: CpusetMems: Devices:[] DiskQuota:0 KernelMemory:0 MemoryReservation:0 MemorySwap:536870912 MemorySwappiness:<nil> OomKillDisable:<nil> PidsLimit:0 Ulimits:[] CPUCount:0 CPUPercent:0 IOMaximumIOps:0 IOMax
imumBandwidth:0 NetworkMaximumBandwidth:0}}} ...
I1002 17:46:15.184196       1 docker.go:1006] Attaching to container "5b2e80386269a0393013a29bee22f303da6b16c9839e6b479e5c3e8f13e58c4d" ...
I1002 17:46:15.185559       1 docker.go:1017] Starting container "5b2e80386269a0393013a29bee22f303da6b16c9839e6b479e5c3e8f13e58c4d" ...
I1002 17:46:15.556708       1 sti.go:679] ---> Installing application source ...
I1002 17:46:15.561610       1 sti.go:679] ---> Building your Node application from source
I1002 17:46:49.915303       1 sti.go:683] npm WARN prefer global node-gyp@3.6.2 should be installed with -g
I1002 17:46:52.097323       1 sti.go:679] 
I1002 17:46:52.171486       1 sti.go:679] > node-sass@4.5.3 install /opt/app-root/src/node_modules/node-sass
I1002 17:46:52.171498       1 sti.go:679] > node scripts/install.js
I1002 17:46:52.171504       1 sti.go:679] 

1 个答案:

答案 0 :(得分:1)

问题由Graham Dumpleton回答。

  

我见过一些npm似乎在安装时会占用大量内存的情况。尝试增加构建内存资源。

我使用:

扩展了YAML构建配置
spec:
  resources:
    limits:
      memory: 1Gi

现在工作正常。