Skip to content

Commit

Permalink
Merge pull request #795 from NREL/requeue-completed
Browse files Browse the repository at this point in the history
Requeue completed
  • Loading branch information
brianlball authored Dec 20, 2024
2 parents f518a2d + d4c69ff commit cfc065b
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 9 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/openstudio-server-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Delete huge unnecessary tools folder
run: rm -rf /opt/hostedtoolcache
- name: Check out repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: setup
shell: bash
run: ./ci/github-actions/setup.sh
Expand All @@ -49,15 +49,15 @@ jobs:
run: ./ci/github-actions/export_build_linux.sh
- name: upload gem package
if: ${{ success() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: openstudio-server-gems-linux
path: build/NREL/export/*.tar.gz
macos-test:
runs-on: macos-13
steps:
- name: Check out repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: setup
shell: bash
run: ./ci/github-actions/setup.sh
Expand All @@ -82,7 +82,7 @@ jobs:
run: ./ci/github-actions/export_build_osx.sh
- name: upload gem package
if: ${{ success() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: openstudio-server-gems-darwin
path: build/NREL/export/*.tar.gz
Expand All @@ -92,7 +92,7 @@ jobs:
- name: Delete huge unnecessary tools folder
run: rm -rf /opt/hostedtoolcache
- name: Check out repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: setup
shell: bash
run: ./ci/github-actions/setup.sh
Expand Down
42 changes: 39 additions & 3 deletions ci/github-actions/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,23 @@ else
# see https://github.com/NREL/OpenStudio-PAT/wiki/Pat-Build-Notes
curl -SLO --insecure https://openstudio-resources.s3.amazonaws.com/pat-dependencies3/ruby-2.7.2-darwin.tar.gz
tar xzf ruby-2.7.2-darwin.tar.gz
exit_status_tar=$?
if [ $exit_status_tar -ne 0 ]; then
echo "Error: Failed to extract Ruby 2.7.2 archive"
exit $exit_status_tar
fi
sudo mv ruby /usr/local/
otool -L /usr/local/ruby/bin/ruby
rm ruby-2.7.2-darwin.tar.gz

# Install mongodb from a download. Brew is hanging and requires building mongo. This also speeds up the builds.
curl -SLO https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-6.0.7.tgz
tar xvzf mongodb-macos-x86_64-6.0.7.tgz
exit_status_tar=$?
if [ $exit_status_tar -ne 0 ]; then
echo "Error: Failed to extract Mongo 6.0.7 archive"
exit $exit_status_tar
fi
sudo cp mongodb-macos-x86_64-6.0.7/bin/* /usr/local/bin/
rm -r mongodb-macos*

Expand All @@ -46,6 +56,11 @@ else
#hdiutil detach /Volumes/${OS_NAME_WITH_PLUS} -force
ls -l
tar xvzf $OS_NAME_WITH_PLUS.tar.gz -C $HOME
exit_status_tar=$?
if [ $exit_status_tar -ne 0 ]; then
echo "Error: Failed to extract OpenStudio archive"
exit $exit_status_tar
fi
ls -l $HOME
rm -rf $OS_NAME_WITH_PLUS.tar.gz
export PATH="/usr/local/ruby/bin:$GITHUB_WORKSPACE/gems/bin:$HOME/$OS_NAME_WITH_PLUS/bin:$PATH"
Expand All @@ -66,10 +81,21 @@ else
sudo wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
echo "deb http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse | tee /etc/apt/sources.list.d/mongodb-org-6.0.list"
sudo apt-get update
sudo apt-get install -y pv tree mongodb libqdbm14 libxml2-dev
sudo apt-get install -y pv tree mongodb-org libqdbm14 libxml2-dev
exit_status_tar=$?
if [ $exit_status_tar -ne 0 ]; then
echo "Error: Failed to apt-get install"
exit $exit_status_tar
fi
# explicitly install. the latest version of redis-server
wget https://download.redis.io/releases/redis-6.0.9.tar.gz
tar xzf redis-6.0.9.tar.gz && cd redis-6.0.9
tar xzf redis-6.0.9.tar.gz
exit_status_tar=$?
if [ $exit_status_tar -ne 0 ]; then
echo "Error: Failed to extract Redis 6.0.9 archive"
exit $exit_status_tar
fi
cd redis-6.0.9
make && sudo make install
sudo cp utils/systemd-redis_server.service /etc/systemd/system/redis.service
cd $GITHUB_WORKSPACE
Expand All @@ -80,12 +106,17 @@ else
#sudo mv redis.conf /etc/redis/redis.conf
sudo systemctl start redis-server.service || true
sudo systemctl status redis-server.service
sudo systemctl start mongodb
sudo systemctl start mongod

# install portable ruby - required for build that will eventually be published
# see https://github.com/NREL/OpenStudio-PAT/wiki/Pat-Build-Notes
curl -SLO --insecure https://openstudio-resources.s3.amazonaws.com/pat-dependencies3/ruby-2.7.2-linux.tar.gz
tar xvzf ruby-2.7.2-linux.tar.gz
exit_status_tar=$?
if [ $exit_status_tar -ne 0 ]; then
echo "Error: Failed to extract Ruby 2.7.2 archive"
exit $exit_status_tar
fi
ls -l /usr/local/
sudo rm -rf /usr/local/ruby
sudo mv ruby /usr/local/
Expand All @@ -110,6 +141,11 @@ else
ruby ${GITHUB_WORKSPACE}/ci/github-actions/verify_openstudio.rb

ruby "${GITHUB_WORKSPACE}/bin/openstudio_meta" install_gems --with_test_develop --debug --verbose --use_cached_gems
exit_status_tar=$?
if [ $exit_status_tar -ne 0 ]; then
echo "Error: Failed to openstudio_meta install_gems"
exit $exit_status_tar
fi
bundle -v
# create dir for output files which will be generated in case of failure
if [ ! -d "${GITHUB_WORKSPACE}/spec/unit-test" ]; then
Expand Down
2 changes: 2 additions & 0 deletions server/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ gem 'mongoid-paperclip'
#gem 'kt-paperclip', :github => 'tijcolem/kt-paperclip', :ref => 'use-marcel'
#gem 'paperclip'

gem 'zeitwerk', '~> 2.6.18'

# R
gem 'rserve-simpler', '~> 0.0.6'

Expand Down
3 changes: 2 additions & 1 deletion server/app/jobs/resque_jobs/run_simulate_data_point.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def self.perform(data_point_id, options = {})
# There is a case where that worker completes a successful job, before the requeued DP starts.
# In that case, we should skip re-running that DP because it was both completed and completed normal already.
# If its a requeued failed job, then that should still get re-run
if !(statuses[:status] == 'completed' && statuses[:status_message] == 'completed normal')
if !(statuses[:status_message] == 'completed normal') #relax requirement to just completed normal
#if !(statuses[:status] == 'completed' && statuses[:status_message] == 'completed normal')
msg = "RUNNING DJ: #{statuses[:status]} and #{statuses[:status_message]}"
d.add_to_rails_log(msg)
puts msg
Expand Down

0 comments on commit cfc065b

Please sign in to comment.