Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCKER: python script at the end of simulation in BEAM docker image is not working #3119

Merged
merged 10 commits into from
Mar 29, 2021

Conversation

nikolayilyin
Copy link
Collaborator

@nikolayilyin nikolayilyin commented Feb 22, 2021

Currently, python scripts at the end of BEAM simulation are not working because they can not find python modules.
So, I commented they out to reduce image size and image build time.
Investigation of python modules required.

Probably the problem is in using the wrong version of python because for python there are no installed modules inside the container but for python3 all modules are installed correctly.


This change is Reviewable

@nikolayilyin nikolayilyin changed the title python script at the end of simulation is not working DOCKER: python script at the end of simulation in BEAM docker image is not working Feb 22, 2021
build.gradle Outdated
instruction 'RUN pip3 install --upgrade setuptools'
instruction 'RUN pip3 install numpy pandas cython sklearn matplotlib mapclassify descartes geopandas contextily plotly collections-extended psutil requests'

// there is a problem with python in the image:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the error? This was originally reviewed and working, so I'd be curious what error was being seen?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the error looks like that:

14:24:26.231 INFO beam.analysis.AnalysisProcessor$ - [1] Running python script: src/main/python/events_analysis/analyze_events.py with args WrappedArray(/app/output/sf-light/sf-light-1k-xml__2021-03-03_14-20-35_qzz/ITERS/it.0/0.events.csv.gz) 14:24:26.375 ERROR beam.analysis.AnalysisProcessor$ - [1] Process Handler Stderr for Python Script: src/main/python/events_analysis/analyze_events.py: Traceback (most recent call last): Process Handler Stdout for Python Script: src/main/python/events_analysis/analyze_events.py: Traceback (most recent call last): 14:24:26.375 ERROR beam.analysis.AnalysisProcessor$ - [2] Process Handler Stderr for Python Script: src/main/python/events_analysis/analyze_events.py: File "src/main/python/events_analysis/analyze_events.py", line 3, in <module> Process Handler Stdout for Python Script: src/main/python/events_analysis/analyze_events.py: File "src/main/python/events_analysis/analyze_events.py", line 3, in <module> Process Handler Stdout for Python Script: src/main/python/events_analysis/analyze_events.py: import plotly.graph_objects as go 14:24:26.375 ERROR beam.analysis.AnalysisProcessor$ - [4] Process Handler Stderr for Python Script: src/main/python/events_analysis/analyze_events.py: ImportError: No module named plotly.graph_objects Process Handler Stdout for Python Script: src/main/python/events_analysis/analyze_events.py: ImportError: No module named plotly.graph_objects

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is weird - do you have the output from the docker build? If plotly was installed then it should not throw this error. This implies to me that there was an error in install

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here is the log of the docker build:
beam-image-creation.log

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nikolayilyin I tried to fix this by pulling in python2 also. However there are a lot of hurdles I had to overcome. Right now we need pysal/mapclassify#110 to be merged and released. I mean we can pull the github repo with the PR, but that opens even more cans of worms. Then, beyond that, many libraries are not guaranteeing or even supporting python 2 much any longer. So, my take is that we run everything in python 3. Is there a reason we are using python 2 at all? If not then let's remove that need and simplify things?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed during daily stand-up, there are no reasons to stay on python 2

@JustinPihony
Copy link
Collaborator

Superceded by #3148 - shall I close?

@JustinPihony JustinPihony deleted the inm/build-beam-image branch March 24, 2021 15:54
@nikolayilyin nikolayilyin restored the inm/build-beam-image branch March 25, 2021 17:51
@nikolayilyin
Copy link
Collaborator Author

there is still an issue with orca
issue-with-orca.txt

@nikolayilyin nikolayilyin reopened this Mar 25, 2021
@nikolayilyin
Copy link
Collaborator Author

also, there is a new documentation entry and a simple but useful shell script to run the beam docker image

@nikolayilyin
Copy link
Collaborator Author

test!

@nikolayilyin nikolayilyin marked this pull request as ready for review March 25, 2021 18:50
@nikolayilyin
Copy link
Collaborator Author

test!

@nikolayilyin
Copy link
Collaborator Author

ooks like flaky tests .. everything passing locally

@nikolayilyin
Copy link
Collaborator Author

test!

@nikolayilyin nikolayilyin merged commit 4e4bbdf into develop Mar 29, 2021
@nikolayilyin nikolayilyin deleted the inm/build-beam-image branch March 29, 2021 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants