{"id":15294047,"url":"https://github.com/sigopti/pyodhean-server","last_synced_at":"2025-10-08T12:53:32.829Z","repository":{"id":45122128,"uuid":"224288136","full_name":"sigopti/pyodhean-server","owner":"sigopti","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-25T19:19:45.000Z","size":147,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T18:08:39.686Z","etag":null,"topics":["district-heating-network","flask","flask-smorest","ipopt","optimization","pyomo","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sigopti.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-11-26T21:20:21.000Z","updated_at":"2023-02-23T12:54:01.000Z","dependencies_parsed_at":"2022-09-14T05:02:10.463Z","dependency_job_id":"72767014-9577-448c-88be-36f92800eab1","html_url":"https://github.com/sigopti/pyodhean-server","commit_stats":{"total_commits":236,"total_committers":4,"mean_commits":59.0,"dds":0.6355932203389831,"last_synced_commit":"7dd347f257e6c01c9188c6c6214392fdcbd55537"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigopti%2Fpyodhean-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigopti%2Fpyodhean-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigopti%2Fpyodhean-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigopti%2Fpyodhean-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sigopti","download_url":"https://codeload.github.com/sigopti/pyodhean-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248724629,"owners_count":21151561,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["district-heating-network","flask","flask-smorest","ipopt","optimization","pyomo","python"],"created_at":"2024-09-30T16:56:04.684Z","updated_at":"2025-10-08T12:53:27.794Z","avatar_url":"https://github.com/sigopti.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"===============\nPyODHeaN Server\n===============\n\n.. image:: https://img.shields.io/pypi/v/pyodhean-server.svg\n    :target: https://pypi.org/project/pyodhean-server/\n    :alt: Latest version\n\n.. image:: https://img.shields.io/pypi/pyversions/pyodhean-server.svg\n    :target: https://pypi.org/project/pyodhean-server/\n    :alt: Python versions\n\n.. image:: https://img.shields.io/pypi/l/pyodhean-server.svg\n    :target: https://github.com/sigopti/pyodhean-server/blob/master/LICENSE\n    :alt: License\n\n.. image:: https://dev.azure.com/sigopti/pyomo/_apis/build/status/sigopti.pyodhean-server?branchName=master\n    :target: https://dev.azure.com/sigopti/pyomo/_build?definitionId=2\n    :alt: Build status\n\nOptimization of District Heating Networks\n\nThis package provides the solver server.\n\n\nInstallation\n============\n\nInstall redis\n-------------\n\nIt should be available from the package manager in most Linux distributions.\n\n::\n\n   aptitude install redis\n\nInstall ipopt\n-------------\n\nInstall dependencies::\n\n   aptitude install make g++ gfortran pkgconf liblapack-dev\n\nUse coinbrew to fetch and compile Ipopt and dependencies::\n\n    # Run as unprivileged user\n    git clone --depth=1 https://github.com/coin-or/coinbrew\n    cd coinbrew\n    ./coinbrew Ipopt:releases/3.13.4 fetch\n    ./coinbrew build Ipopt\n\nCopy files to project directory::\n\n    cp -r ./coinbrew/dist /path/to/project/ipopt\n\nInstall pyodhean\n----------------\n\nUse pip::\n\n    pip install pyodhean-server\n\npyodhean-server supports Python \u003e= 3.7.\n\n\nDevelopment configuration\n=========================\n\nLaunch solver server\n--------------------\n\nAdd path to ipopt to the PATH (should be added to .bashrc)::\n\n    export PATH=$PATH:/path/to/project/ipopt/bin/\n\nCheck ipopt is correctly installed::\n\n    ldd `which ipopt`\n    ipopt -v\n\nLaunch worker::\n\n    celery -A pyodhean_server worker\n\nConfigure and launch web API server\n-----------------------------------\n\n::\n\n    # Set FLASK_ENV variable\n    export FLASK_ENV=development\n\n    # Alternatively, use a .env file\n    echo \"FLASK_ENV=development\" \u003e .env\n\n    # Run application\n    flask run\n\n\nProduction configuration\n========================\n\nConfigure and launch web API server\n-----------------------------------\n\nThe following lines explain hwo to run pyodhean server with apache. They do not\ncover creating and using an SSL certificate.\n\nCopy apache2 directory from docs/deployment/etc into /etc.\n\nCreate a pyodhean directory to hold the application files.\n\nCreate a Pyhton 3 virtual environment in the pyodhean directory::\n\n    virtualenv -p /usr/bin/python3 venv-pyodhean\n\nPull code from pyodhean and pyodhean-server repositories and install them in\nthe virtual environment::\n\n    source venv-pyodhean/bin/activate\n    pip install ./pyodhean\n    pip install ./pyodhean-server\n\nCopy files from docs/deployment/pyodhean into the pyodhean directory.\n\nCustomize them if needed. At least the path to the virtual environment must be\nspecified.\n\nMake sure settings.conf can be read by apache user::\n\n    chown root:www-data application/settings.conf\n    chmod 640 application/settings.conf\n\nThe pyodhean directory should look like this:::\n\n    pyodhean/\n        application/\n            application.wsgi\n            settings.conf\n        venv-pyodhean\n        pyodhean\n        pyodhean-server\n\nNote: The pyodhean and pyodhean-server repositories can be stored anywhere.\nThey do not have to be in the pyodhean directory.\n\nEdit /etc/apache2/sites-available/pyodhean.conf.\n\nReload apache2.\n\nThe API should be available as https://domain.tld/api/v0/.\n\nCreate directories to store log files::\n\n    mkdir /var/log/pyodhean\n    chmod pyodhean:pyodhean /var/log/pyodhean\n\nConfigure and launch solver service\n-----------------------------------\n\nCreate pyodhean user::\n\n   adduser --system --no-create-home --group pyodhean\n\nCreate log directory::\n\n    mkdir -m 755 /var/log/pyodhean-celery\n    chown pyodhean:pyodhean /var/log/pyodhean-celery\n\nCopy systemd directory from docs/deployment/etc into /etc.\n\nEdit pyodhean-celery configuration file to specify the paths.\n\n   /etc/systemd/system/pyodhean-celery.service.d/pyodhean-celery.conf\n\nStart the service and enable it for automatic start on system startup::\n\n    systemctrl enable pyodhean-celery\n    systemctrl start pyodhean-celery\n\nConfigure log files rotation\n----------------------------\n\nCopy logrotate.d directory from docs/deployment/etc into /etc.\n\nConfigure authentication\n------------------------\n\nCreate a users DB file the apache user can read::\n\n   touch /path/to/project/users.db\n   chown root:www-data /path/to/project/users.db\n   chmod 640 /path/to/project/users.db\n\nAdd users to the DB file::\n\n    source venv-pyodhean/bin/activate\n    export FLASK_APP=pyodhean_server.app\n    flask add-user /path/to/project/users.db user password\n    \nEdit application configuration to enable authorization and pass users BD file::\n\n   AUTH_ENABLED=True\n   AUTH_USERS=/path/to/project/users.db\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsigopti%2Fpyodhean-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsigopti%2Fpyodhean-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsigopti%2Fpyodhean-server/lists"}