Update Julia Solver Dependencies and NLR API Key Environment Variables - #729
Open
Bill-Becker wants to merge 5 commits into
Open
Update Julia Solver Dependencies and NLR API Key Environment Variables#729Bill-Becker wants to merge 5 commits into
Bill-Becker wants to merge 5 commits into
Conversation
To fix an issue that was identified in a REopt run, confirmed to be fixed by this update
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Julia-side solver environment to newer versions (HiGHS/JuMP/MathOptInterface stack) and renames internally-used developer credential environment variables from NREL_* to NLR_* within julia_src, aligning with updated REopt.jl conventions.
Changes:
- Upgrade Julia solver stack dependencies and adjust the dependency graph in
julia_src/Manifest.toml(including adding MathOptIIS and removing some previously-used packages). - Rename internal developer key/email environment variables used by the Julia HTTP server (
julia_src/http.jl) and its.env. - Record the changes in
CHANGELOG.mdunderv3.22.1.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| julia_src/Manifest.toml | Upgrades solver stack packages (HiGHS/JuMP/MOI) and updates dependency resolution. |
| julia_src/http.jl | Renames env var usage for developer key/email and continues request-time key handling logic. |
| julia_src/.env | Renames env vars for local/default Julia server configuration. |
| CHANGELOG.md | Adds a v3.22.1 entry documenting the solver/env-var updates. |
Suppressed comments (1)
julia_src/http.jl:916
- Same concurrency issue as
/reopt: mutating globalENV["NLR_DEVELOPER_API_KEY"]inside the request handler can leak keys across concurrent requests. Prefer passing request-specific credentials explicitly (or otherwise isolating them) rather than relying on a process-global env var.
if !isempty(get(d, "api_key", ""))
ENV["NLR_DEVELOPER_API_KEY"] = pop!(d, "api_key")
else
ENV["NLR_DEVELOPER_API_KEY"] = test_nlr_developer_api_key
delete!(d, "api_key")
end
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+8
to
+10
| const test_nlr_developer_api_key = ENV["NLR_DEVELOPER_API_KEY"] | ||
|
|
||
| ENV["NREL_DEVELOPER_EMAIL"] = "reopt@nlr.gov" | ||
| ENV["NLR_DEVELOPER_EMAIL"] = "reopt@nlr.gov" |
Comment on lines
+1
to
+2
| NLR_DEVELOPER_API_KEY="gAfosXcQ9Ldfw3qXqvKVb7PxMEkYigozmC9R3mXQ" | ||
| NLR_DEVELOPER_EMAIL="reopt@nlr.gov" No newline at end of file |
Comment on lines
63
to
67
| if !isempty(get(d, "api_key", "")) | ||
| ENV["NREL_DEVELOPER_API_KEY"] = pop!(d, "api_key") | ||
| ENV["NLR_DEVELOPER_API_KEY"] = pop!(d, "api_key") | ||
| else | ||
| ENV["NREL_DEVELOPER_API_KEY"] = test_nrel_developer_api_key | ||
| ENV["NLR_DEVELOPER_API_KEY"] = test_nlr_developer_api_key | ||
| delete!(d, "api_key") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request makes two unrelated updates:
julia_srcfolder) for the optimization solver stack (HiGHS, JuMP, MathOptInterface). We had found peculiar optimization results for a scenario with tiered rates where it was solving with a negative NPV of larger magnitude than the tolerance. The solver stack upgrade fixed it. It also removes some unused dependencies.Environment variable renaming:
NREL_DEVELOPER_API_KEYandNREL_DEVELOPER_EMAILtoNLR_DEVELOPER_API_KEYandNLR_DEVELOPER_EMAILin thejulia_srcdirctory.envfile andhttp.jlwhich uses that. This affects how API keys and emails are loaded and set for requests. [1] [2] [3] [4]Dependency updates and removals:
Manifest.toml, includingHiGHS(from 1.15.0 to 1.24.1),HiGHS_jll,JuMP(from 1.25.0 to 1.31.1), andMathOptInterface(from 1.39.0 to 1.52.0), and added new dependencies such asMathOptIIS. [1] [2] [3]BenchmarkTools,JSON3,Profile, andStructTypesfromManifest.toml, cleaning up the dependency tree. [1] [2] [3] [4]