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

Prepare for Alfalfa 0.8.0 #4

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Prepare for Alfalfa 0.8.0 #4

wants to merge 11 commits into from

Conversation

TShapinsky
Copy link
Member

No description provided.

@@ -1,4 +1,4 @@
ARG PYTHON_VERSION=3.10.14
ARG PYTHON_VERSION=3.12.2
Copy link
Member Author

Choose a reason for hiding this comment

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

Using python 3.12 now as that is what pyenergyplus requires.

RUN gnuArch="$(dpkg-architecture --query DEB_HOST_MULTIARCH)" \
&& git clone --depth 1 -b Assimulo-3.5.2 https://github.com/modelon-community/Assimulo.git \
&& cd Assimulo \
&& python3 setup.py bdist_wheel --sundials-home=/usr --blas-home=/usr/lib/${gnuArch} --lapack-home=/usr/lib/${gnuArch} --superlu-home=/usr \
&& python3 setup.py bdist_wheel \
Copy link
Member Author

Choose a reason for hiding this comment

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

We're no longer interested in building a ton of dependencies into the modelica tools as we will require dependencies to be included in the compiled FMU.

@@ -70,12 +38,13 @@ RUN git clone --depth 1 -b 2.4.1 https://github.com/modelon-community/fmi-librar
&& mkdir fmi_build && cd fmi_build \
&& mkdir fmi_library \
&& cmake -DCMAKE_INSTALL_PREFIX=/build/fmi-libary/fmi_library .. \
&& make -j4 \
&& make -j$(nproc) \
Copy link
Member Author

Choose a reason for hiding this comment

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

This just makes the compilation run with a number of threads equal to what the host system provides to the container.


ENV PYTHON_VERSION=3.8.19
Copy link
Member Author

Choose a reason for hiding this comment

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

Since we're no longer using two different python versions we don't need this build step

@@ -223,30 +86,31 @@ WORKDIR /artifacts

# Install EnergyPlus
RUN --mount=type=bind,from=energyplus-dependencies,source=/artifacts,target=/artifacts set -eux; \
mkdir ${ENERGYPLUS_DIR}; \
mkdir -p ${ENERGYPLUS_DIR}; \
Copy link
Member Author

Choose a reason for hiding this comment

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

-p just makes sure parent directories are instantiated.

tar -C $ENERGYPLUS_DIR/ --strip-components=1 -xzf energyplus.tar.gz; \
cd ${ENERGYPLUS_DIR}; \
cp -n -r ${ENERGYPLUS_DIR}/python_lib/* /usr/local/lib/python3.12; \
Copy link
Member Author

Choose a reason for hiding this comment

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

This copies the energyplus python standard library into the same folder as the system's runtime. -n prevents the system's runtime from being replaced by files coming from python_lib. After this python_lib is deleted and linked to /usr/local/lib/python3.12. This helps trim down the image size by reducing duplicate information, it also makes sure e+ and the system are using the same python.

WeatherData \
libpython3.8.so.1.0 \
libpython3.12.so.1.0 \
Copy link
Member Author

Choose a reason for hiding this comment

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

remove the python shared object and replace it with the one from the system.


# Install OpenStudio
RUN --mount=type=bind,from=energyplus-dependencies,source=/artifacts,target=/artifacts set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
gdebi-core \
openjdk-17-jre-headless \
Copy link
Member Author

Choose a reason for hiding this comment

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

java is no longer required as bcvtb is no longer used.

@@ -283,7 +148,5 @@ RUN --mount=type=bind,from=modelica-dependencies,source=/artifacts,target=/artif
apt-get autoremove -y; \
rm -rf /var/lib/apt/lists/*

ENV PYTHONPATH="${ENERGYPLUS_DIR}:/usr/local/openstudio-3.9.0/Python"
Copy link
Member Author

Choose a reason for hiding this comment

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

Add python paths so pyenergyplus and openstudio packages can be resolved


# Install OpenStudio
RUN --mount=type=bind,from=energyplus-dependencies,source=/artifacts,target=/artifacts set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
gdebi-core \
openjdk-17-jre-headless \
binutils \
Copy link
Member Author

Choose a reason for hiding this comment

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

look into if this is still needed.

&& cd PyFMI \
&& python3 setup.py bdist_wheel --fmil-home=/build/fmi-libary/fmi_library --with-openmp\
&& python3 setup.py build --fmil-home=/build/fmi-libary/fmi_library -j $(nproc)\
&& python3 setup.py bdist_wheel --fmil-home=/build/fmi-libary/fmi_library\
Copy link
Member Author

Choose a reason for hiding this comment

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

look into if separate build and bdist_wheel steps are needed.

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.

1 participant