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

Choose solver, add back V3 CI tests #565

Merged
merged 27 commits into from
Feb 28, 2024
Merged

Choose solver, add back V3 CI tests #565

merged 27 commits into from
Feb 28, 2024

Conversation

Bill-Becker
Copy link
Collaborator

@Bill-Becker Bill-Becker commented Feb 13, 2024

  • Makes one Julia environment to avoid needing to update REopt.jl and other dependencies in multiple locations
  • Makes one http.jl file with conditional loading for Xpress.jl, if it is installed
  • Adds a choice of solver in Settings.solver_name, and useful error messages if trying to use Xpress without installation
  • Changes all the GitHub Actions test_job_endpoint.py tests to use an open source solver so we can have full V3 CI testing again
  • Updated the instructions in the licenseserver repo on github.nrel.gov
  • Updated the Wiki in this repo with open source solver setup info
  • Added instructions to REopt "All in One" document (NREL employees only)

@Bill-Becker Bill-Becker marked this pull request as ready for review February 14, 2024 05:55
@@ -117,7 +117,8 @@ docs/formulation/*log
/.werf_secret_key

# Customized solver setup and docker files
julia_src/xpress/licenseserver
julia_src/xpress/
Copy link
Collaborator

Choose a reason for hiding this comment

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

this directory should no longer exist, correct? Is this a check just in case someone hasn't deleted it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it should no longer exist, but I'd rather keep this here as people transition over, just in case.

# Load Xpress only if it is installed, as indicated by ENV["XPRESS_INSTALLED"]="True"
xpress_installed = get(ENV, "XPRESS_INSTALLED", "False")
if xpress_installed == "True"
import Xpress # Why not "using Xpress"?
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not? :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated to "using Xpress", and tested with V2 and V3

@@ -227,7 +227,7 @@ def test_superset_input_fields(self):
r = json.loads(resp.content)
results = r["outputs"]

self.assertAlmostEqual(results["Financial"]["npv"], 11323.01, places=0)
self.assertAlmostEqual(results["Financial"]["npv"], -258533.19, places=-3)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did just changing the solver change the result by this much?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, no, it's because I had to fix all of the technology sizes to avoid a timeout with the open source solver. Fixing the sizes still tests the capabilities here, which also implies the NPV test is not needed.

@@ -27,14 +27,12 @@ jobs:
NREL_DEV_API_KEY: ${{ secrets.NREL_DEV_API_KEY }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we consider renaming line 1 of this file and push_tests.yml?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated.

@adfarth
Copy link
Collaborator

adfarth commented Feb 28, 2024

@Bill-Becker

  • For the instructions in this Wiki, did you mean -f instead of -d in each of the new lines? (https://github.com/NREL/REopt_API/wiki/2.-Setup-for-Local-API-Development)
  • Since the xpress docker file also needs to be updated, I think we should recommend to the team to (1) delete the old Dockerfile.xpress and licenseserver directory and (2) follow the instructions on github.nrel.gov again (if you leave the old Dockerfile, you get an error due to the directory changing)
  • I tested locally with xpress and ran some of the tests and it worked with no issues
  • Just a few questions above but I am approving

@Bill-Becker
Copy link
Collaborator Author

@Bill-Becker

  • For the instructions in this Wiki, did you mean -f instead of -d in each of the new lines? (https://github.com/NREL/REopt_API/wiki/2.-Setup-for-Local-API-Development)
  • Since the xpress docker file also needs to be updated, I think we should recommend to the team to (1) delete the old Dockerfile.xpress and licenseserver directory and (2) follow the instructions on github.nrel.gov again (if you leave the old Dockerfile, you get an error due to the directory changing)
  • I tested locally with xpress and ran some of the tests and it worked with no issues
  • Just a few questions above but I am approving

Good catch and thanks for testing. I plan to go over this in the dev meeting tomorrow, and good to know we should just delete licenseserver and re-do those instructions.

@Bill-Becker Bill-Becker merged commit 68cc601 into develop Feb 28, 2024
1 check passed
@Bill-Becker Bill-Becker deleted the solver-choice branch February 28, 2024 17:56
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.

None yet

2 participants