Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
173 views
in Technique[技术] by (71.8m points)

python - Pandas on OpenShift v3

Now that OpenShift Online V2 has announced its end of service, I am looking to migrate my Python application to OpenShift Online V3, aka OpenShift NextGen. Pandas is a requirement (and listed in requirements.txt)

It already has been non-trivial to get pandas installed in v2 but V3 does not allow manual interaction in the build process (or does it?).

When I try to build my app the build process stops after an hour. pip has downloaded and installed the contents of the requirements.txt and is running setup.py for selected packages. The and of the log file is

Running setup.py install for numpy
Running setup.py install for Bottleneck
Running setup.py install for numexpr
Running setup.py install for pandas

Then the process stops without any?error message.

Does anyone have a clue how to build Python applications that require pandas on OpenShift V3?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It is going to be one of two things.

Either compiling Pandas is a huge memory hog, possibly caused by the compiler hitting some pathological case. Or, the size of the generated image at that point exceeds an internal limit and so runs out of disk space allocated.

If it was memory, you would need to increase the memory allocated to the build pod. By default in Online this is 512Mi.

To increase the limit you will need to edit the YAML/JSON for the build configuration from the web console, or from the command line using oc edit.

For YAML, you need to add the following:

  resources:
    limits:
      memory: 1Gi

This is setting the field:

$ oc explain bc.spec.resources.limits FIELD: limits <object>

DESCRIPTION:
     Limits describes the maximum amount of compute resources allowed. More
     info: http://kubernetes.io/docs/user-guide/compute-resources/

The maximum is 1Gi. It appears an increase to this value does allow the build to complete, where as increasing it to 768Mi wasn't enough.

Do be aware that this takes memory away from the quota for compute-resources-timebound when running and since it is using it all during the build, other things you try and do at the same time could be held up.

FWIW, the image size on a local build, not in Online, only produced:

172.30.1.1:5000/mysite/osv3test              latest               f323d9b036f6        About an hour ago   910MB

Thus unless intermediary space used before things were cleaned up was an issue, it isn't an issue.

So increasing memory used for the build appears to be the answer.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...