mirror of
https://github.com/ANL-CEEESA/UnitCommitment.jl.git
synced 2025-12-06 00:08:52 -06:00
web: Prepare containers
This commit is contained in:
30
web/backend/docker/startup.jl
Normal file
30
web/backend/docker/startup.jl
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env julia
|
||||
|
||||
# UnitCommitment.jl: Optimization Package for Security-Constrained Unit Commitment
|
||||
# Copyright (C) 2025, UChicago Argonne, LLC. All rights reserved.
|
||||
# Released under the modified BSD license. See COPYING.md for more details.
|
||||
|
||||
# Load required packages
|
||||
using HiGHS
|
||||
using Backend
|
||||
|
||||
const UCJL_HOST = get(ENV, "HOST", "0.0.0.0")
|
||||
const UCJL_PORT = parse(Int, get(ENV, "PORT", "9000"))
|
||||
|
||||
println("Starting UnitCommitment Backend Server...")
|
||||
println("Host: $UCJL_HOST")
|
||||
println("Port: $UCJL_PORT")
|
||||
println("Press Ctrl+C to stop the server")
|
||||
|
||||
server = Backend.start_server(UCJL_HOST, UCJL_PORT; optimizer = HiGHS.Optimizer)
|
||||
try
|
||||
wait()
|
||||
catch e
|
||||
if e isa InterruptException
|
||||
println("\nShutting down server...")
|
||||
Backend.stop(server)
|
||||
println("Server stopped")
|
||||
else
|
||||
rethrow(e)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user