Skip to content

Commit

Permalink
Change default os version to 3.9 and change the logic retrieve the fo…
Browse files Browse the repository at this point in the history
…lder.
  • Loading branch information
wenyikuang committed Oct 28, 2024
1 parent 7db5249 commit 9ec4670
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM ubuntu:20.04 AS base
FROM ubuntu:22.04 AS base

MAINTAINER Nicholas Long [email protected]

# Set the version of OpenStudio when building the container. For example `docker build --build-arg
ARG OPENSTUDIO_VERSION=3.8.0
ARG OPENSTUDIO_VERSION_EXT=""
ARG OPENSTUDIO_DOWNLOAD_URL=""
ARG OPENSTUDIO_VERSION=3.9.0
ARG OPENSTUDIO_VERSION_EXT="alpha"
ARG OPENSTUDIO_DOWNLOAD_URL="https://openstudio-ci-builds.s3.amazonaws.com/develop/OpenStudio-3.9.0-alpha%2B023c513504-Ubuntu-22.04-x86_64.deb"
ENV RC_RELEASE=TRUE
ENV OS_BUNDLER_VERSION=2.4.10
ENV RUBY_VERSION=3.2.2
Expand Down Expand Up @@ -51,12 +51,15 @@ RUN curl -SLO -k https://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.2.tar.gz \

## if the openstudio-${OPENSTUDIO_VERSION} folder existed, set it as the OPENSTUDIO
## folder, otherwise set the openstudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT} folder

#the folder will be Openstudio-3.9.0 or something like Openstudio-3.9.0-alpha

RUN if [ -d "/usr/local/openstudio-${OPENSTUDIO_VERSION}" ]; then \
echo "OpenStudio folder is /usr/local/openstudio-${OPENSTUDIO_VERSION}"; \
OPENSTUDIO_FOLDER=/usr/local/openstudio-${OPENSTUDIO_VERSION}; \
else \
echo "OpenStudio folder is /usr/local/openstudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}"; \
OPENSTUDIO_FOLDER=/usr/local/openstudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}; \
echo "OpenStudio folder is /usr/local/openstudio-${OPENSTUDIO_VERSION}-${OPENSTUDIO_VERSION_EXT}"; \
OPENSTUDIO_FOLDER=/usr/local/openstudio-${OPENSTUDIO_VERSION}-${OPENSTUDIO_VERSION_EXT}; \
fi \
&& echo "OpenStudio folder is ${OPENSTUDIO_FOLDER}" \
&& rm -rf ruby* \
Expand All @@ -68,22 +71,22 @@ RUN if [ -d "/usr/local/openstudio-${OPENSTUDIO_VERSION}" ]; then \
&& cp ${OPENSTUDIO_FOLDER}/Ruby/openstudio-gems.gemspec /var/oscli/\
&& ln -s ${OPENSTUDIO_FOLDER} /usr/local/openstudio-${OPENSTUDIO_VERSION}

ENV RUBYLIB=/usr/local/openstudio-${OPENSTUDIO_VERSION}/Ruby
ENV ENERGYPLUS_EXE_PATH=/usr/local/openstudio-${OPENSTUDIO_VERSION}/EnergyPlus/energyplus
# ENV RUBYLIB=/usr/local/openstudio-${OPENSTUDIO_VERSION}/Ruby
# ENV ENERGYPLUS_EXE_PATH=/usr/local/openstudio-${OPENSTUDIO_VERSION}/EnergyPlus/energyplus

RUN rm -rf ruby*
## Add RUBYLIB link for openstudio.rb
ENV RUBYLIB=/usr/local/openstudio-${OPENSTUDIO_VERSION}/Ruby
ENV ENERGYPLUS_EXE_PATH=/usr/local/openstudio-${OPENSTUDIO_VERSION}/EnergyPlus/energyplus
# RUN rm -rf ruby*
# ## Add RUBYLIB link for openstudio.rb
# ENV RUBYLIB=/usr/local/openstudio-${OPENSTUDIO_VERSION}/Ruby
# ENV ENERGYPLUS_EXE_PATH=/usr/local/openstudio-${OPENSTUDIO_VERSION}/EnergyPlus/energyplus

WORKDIR /var/oscli
RUN bundle -v
RUN bundle _${OS_BUNDLER_VERSION}_ install --path=gems --without=native_ext --jobs=4 --retry=3
# WORKDIR /var/oscli
# RUN bundle -v
# RUN bundle _${OS_BUNDLER_VERSION}_ install --path=gems --without=native_ext --jobs=4 --retry=3

# Configure the bootdir & confirm that openstudio is able to load the bundled gem set in /var/gemdata
VOLUME /var/simdata/openstudio
WORKDIR /var/simdata/openstudio
RUN openstudio --loglevel Trace --bundle /var/oscli/Gemfile --bundle_path /var/oscli/gems --bundle_without native_ext openstudio_version
# # Configure the bootdir & confirm that openstudio is able to load the bundled gem set in /var/gemdata
# VOLUME /var/simdata/openstudio
# WORKDIR /var/simdata/openstudio
# RUN openstudio --loglevel Trace --bundle /var/oscli/Gemfile --bundle_path /var/oscli/gems --bundle_without native_ext openstudio_version

# May need this for syscalls that do not have ext in path

Expand Down

0 comments on commit 9ec4670

Please sign in to comment.