-
Notifications
You must be signed in to change notification settings - Fork 3
Dockerfile and enhancement python package #29
Copy link
Copy link
Open
Description
In case someone else can benefit from it, I created a Dockerfile:
FROM ubuntu
# Install jdk and other dependencies
RUN apt update && apt install -y default-jdk git pip
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64
# Install Moonlight
WORKDIR /build
RUN git clone https://github.com/MoonLightSuite/MoonLight.git
WORKDIR /build/MoonLight
RUN ./gradlew clean
RUN ./gradlew release
ENV PYTHONPATH "${PYTHONPATH}:/build/MoonLight/distribution/python"
# Install additional requirements to run examples in python
RUN pip install --upgrade pip && pip install numpy matplotlib pyjnius pandas geopy pyDOE scipy
WORKDIR /home
CMD ["/bin/bash"]Another thing I noticed is that there is no need to write python scripts in the MoonLight/distribution/python folder.
It is enough to:
- Add the
MoonLight/distribution/pythonpath to the PYTHONPATH. For example from linux, just run fromMoonLight/distribution/pythonthe following command:
export PYTHONPATH=$PYTHONPATH:$(pwd) - Modify the first 2 lines in
moonlight.pyfrom
import jnius_config
jnius_config.set_classpath('./jar/moonlight.jar')to
import jnius_config
import os
jnius_config.set_classpath(os.path.dirname(__file__) + '/jar/moonlight.jar')A last note, it could be nice to create a moonlight package instead of a python file.
In this way, instead of the need of from moonlight import *, it would be enough to do import moonlight
Hope it helps!
Best
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels