diff --git a/.github/workflows/test_cornflow_client.yml b/.github/workflows/test_cornflow_client.yml index 07a82601a..8e916fe59 100644 --- a/.github/workflows/test_cornflow_client.yml +++ b/.github/workflows/test_cornflow_client.yml @@ -11,9 +11,10 @@ on: push: branches: - master - - development + - develop paths: - 'libs/client/**' + - '.github/workflows/test_cornflow_client.yml' - '!libs/client/README.rst' - '!libs/client/setup.py' diff --git a/.github/workflows/test_cornflow_dags.yml b/.github/workflows/test_cornflow_dags.yml index 879c87e2d..9d660d796 100644 --- a/.github/workflows/test_cornflow_dags.yml +++ b/.github/workflows/test_cornflow_dags.yml @@ -10,9 +10,10 @@ on: push: branches: - master - - development + - develop paths: - 'cornflow-dags/**' + - '.github/workflows/test_cornflow_dags.yml' - '!cornflow-dags/README.rst' jobs: diff --git a/.github/workflows/test_cornflow_server.yml b/.github/workflows/test_cornflow_server.yml index b603ca435..a8976bc3a 100644 --- a/.github/workflows/test_cornflow_server.yml +++ b/.github/workflows/test_cornflow_server.yml @@ -11,9 +11,10 @@ on: push: branches: - master - - development + - develop paths: - 'cornflow-server/**' + - '.github/workflows/test_cornflow_server.yml' - '!cornflow-server/docs/**' - '!cornflow-server/README.rst' diff --git a/cornflow-dags/.coveragerc b/cornflow-dags/.coveragerc index 2b90a30e1..f2eb21054 100644 --- a/cornflow-dags/.coveragerc +++ b/cornflow-dags/.coveragerc @@ -1,4 +1,6 @@ [run] +branch = True + omit = */tests/* diff --git a/cornflow-dags/requirements.txt b/cornflow-dags/requirements.txt index c500d6e61..f06c51bf6 100644 --- a/cornflow-dags/requirements.txt +++ b/cornflow-dags/requirements.txt @@ -1,6 +1,6 @@ cornflow-client>=1.1.0 orloge<=0.17.2 -PuLP<=2.7 +PuLP<=2.9.0 pandas<=2.1.1 hackathonbaobab2020[solvers] pytups<=0.86.2 @@ -9,3 +9,4 @@ xmltodict<=0.13.0 openpyxl<=3.1.2 pyomo<=6.6.2 tsplib95<=0.7.1 +numpy<2.0.0 diff --git a/cornflow-server/.coveragerc b/cornflow-server/.coveragerc index 2b90a30e1..f2eb21054 100644 --- a/cornflow-server/.coveragerc +++ b/cornflow-server/.coveragerc @@ -1,4 +1,6 @@ [run] +branch = True + omit = */tests/* diff --git a/cornflow-server/changelog.rst b/cornflow-server/changelog.rst index 7f8af75d4..ab5eedcf2 100644 --- a/cornflow-server/changelog.rst +++ b/cornflow-server/changelog.rst @@ -1,3 +1,14 @@ +version 1.1.1 +-------------- + +- released: 2024-08-29 +- description: small security fixes +- changelog: + - bump PuLP to version 2.9.0 + - bump requests to version 2.32.3 + - modified branch structure on repository. + - minor changes to documentation + version 1.1.0 -------------- diff --git a/cornflow-server/requirements.txt b/cornflow-server/requirements.txt index 493278e62..48287a3d9 100644 --- a/cornflow-server/requirements.txt +++ b/cornflow-server/requirements.txt @@ -8,7 +8,7 @@ Flask==2.3.2 flask-apispec<=0.11.4 Flask-Bcrypt<=1.0.1 Flask-Compress<=1.13 -flask-cors<=4.0.1 +flask-cors>=4.0.2 flask-inflate<=0.3 Flask-Migrate<=4.0.4 Flask-RESTful<=0.3.9 @@ -20,11 +20,11 @@ gunicorn<=22.0.0 jsonpatch<=1.32 ldap3<=2.9.1 marshmallow<=3.19.0 -PuLP<=2.7.0 +PuLP<=2.9.0 psycopg2<=2.95 PyJWT<=2.6.0 pytups>=0.86.2 -requests<=2.31.0 +requests<=2.32.3 SQLAlchemy==1.3.21 webargs<=8.2.0 Werkzeug<=3.0.3 diff --git a/cornflow-server/setup.py b/cornflow-server/setup.py index c64649c0f..32e71a5dc 100644 --- a/cornflow-server/setup.py +++ b/cornflow-server/setup.py @@ -9,7 +9,7 @@ setuptools.setup( name="cornflow", - version="1.1.0", + version="1.1.1", author="baobab soluciones", author_email="cornflow@baobabsoluciones.es", description="Cornflow is an open source multi-solver optimization server with a REST API built using flask.", diff --git a/docs/source/deploy/problems.rst b/docs/source/deploy/issues.rst similarity index 69% rename from docs/source/deploy/problems.rst rename to docs/source/deploy/issues.rst index db784e6a6..0a426eeb9 100644 --- a/docs/source/deploy/problems.rst +++ b/docs/source/deploy/issues.rst @@ -1,4 +1,4 @@ -Known problems +Known issues ------------------ When deploying cornflow through docker, you may run into one of the following problems. It is difficult to cover all the possibilities but we will try to update the documentation to include at least those that happen to us. @@ -9,7 +9,7 @@ Situations Development ^^^^^^^^^^^^^^^ -Problem: Possible error with psycopg2 +Issue: Possible error with psycopg2 Error: Error pg_config executable not found. @@ -18,19 +18,19 @@ Problem: Possible error with psycopg2 Docker build ^^^^^^^^^^^^^^^ -Problem: The volume airflow_config can´t be mounted. +Issue: The volume airflow_config can´t be mounted. Error: Unable to prepare context: path "local_path_to_docker-compose.yml/airflow_config" Possible solution: Start docker-compose.yml from root path of cloned corn repository. -Problem: The Dockerfile is not found by docker-compose. +Issue: The Dockerfile is not found by docker-compose. Error: Not found or failed to solve with frontend dockerfile.v0: failed to read dockerfile Possible solution: Start from the same path of Dockerfile or modify the location of it into the build section of docker-compose file. -Problem: The image is not installing any linux pkg. +Issue: The image is not installing any linux pkg. Error: gcc exited code error 1 @@ -39,7 +39,7 @@ Problem: The image is not installing any linux pkg. Cornflow database ^^^^^^^^^^^^^^^^^^^^^^ -Problem: Cornflow can´t reach postgres internal database +Issue: Cornflow can´t reach postgres internal database Error: sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not translate host name "host_database" to address: Name or service not known @@ -48,7 +48,7 @@ Problem: Cornflow can´t reach postgres internal database Running cornflow-server ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Problem: Users were not created when cornflow started +Issue: Users were not created when cornflow started Error: usage: flask [-?] {db,create_admin_user,create_service_user,access_init,register_base_assignations,register_actions,register_views,register_roles,update_views,clean_historic_data,shell,runserver} ... @@ -57,16 +57,35 @@ Problem: Users were not created when cornflow started Flower ^^^^^^^^^^ -Problem: Can´t login to flower GUI +Issue: Can't login to flower GUI Error: Access denied Possible solution: The admin user and password is the same than airflow. +Scheduler +^^^^^^^^^^^ +Issue: Can't find Scheduler logs. + + Error: + + .. code-block:: bash + + FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/airflow/logs/scheduler/2024-07-01' + PermissionError: [Errno 13] Permission denied: '/usr/local/airflow/logs/scheduler' + + Possible solution: Both errors usually occur when using the root user and root group as the owner of the directory. One possible solution is: + + .. code-block:: bash + + sudo chown -R 1000:1000 cornflow/cornflow-server/airflow_config/logs + + You should use 1000 because it is the UID and GID of the first user and group different from root. + Airflow ^^^^^^^^^^^ -Problem: Can´t login to airflow GUI +Issue: Can't login to airflow GUI Error: Bad Request The CSRF session token is missing @@ -75,26 +94,26 @@ Problem: Can´t login to airflow GUI Ldap docker ^^^^^^^^^^^^^^^^ -Problem: Can´t login to flower GUI +Issue: Can't login to flower GUI Error: Access denied Possible solution: If airflow goes to ldap config, and you don´t give any values to AIRFLOW_USER and AIRFLOW_PWD, the default values are "admin/admin" -Problem: Can´t login to airflow GUI +Issue: Can't login to airflow GUI Error: Access denied Possible solution: User is not same as normal deployment -Problem: Openldap docker container don´t start +Issue: Openldap docker container don´t start Error: Can't parse ldif entry on line 1 Possible solution: Some entry on ``*.ldif`` file has not properly defined and slapd can't start and populate the ldap server -Problem: Openldap does not show entries from ldif file +Issue: Openldap does not show entries from ldif file Error: failed: bash ls -l not ldif on path - Possible solution: Try to mount openldap volume with full local path of ldif folder in your machine \ No newline at end of file + Possible solution: Try to mount openldap volume with full local path of ldif folder in your machine diff --git a/docs/source/main/install.rst b/docs/source/main/install.rst index 5cf89404a..3dfb1468a 100644 --- a/docs/source/main/install.rst +++ b/docs/source/main/install.rst @@ -94,6 +94,7 @@ Then we export the variables that we need to run airflow:: export AIRFLOW__API__AUTH_BACKEND=airflow.api.auth.backend.basic_auth export AIRFLOW__WEBSERVER__SECRET_KEY=e9adafa751fd35adfc1fdd3285019be15eea0758f76e38e1e37a1154fb36 export AIRFLOW_CONN_CF_URI=http://service_user:Service_password1@localhost:5000 + export AIRFLOW_HOME=./airflow_config/ airflow webserver -p 8080 & airflow scheduler & @@ -195,4 +196,4 @@ Troubleshooting To install all the dependencies, additional packages may be needed. For example, in Ubuntu 20.04, the following packages are needed:: - sudo apt-get install libpq-dev python3-dev python3.10-venv build-essential \ No newline at end of file + sudo apt-get install libpq-dev python3-dev python3.10-venv build-essential diff --git a/libs/client/.coveragerc b/libs/client/.coveragerc index 2b90a30e1..f2eb21054 100644 --- a/libs/client/.coveragerc +++ b/libs/client/.coveragerc @@ -1,4 +1,6 @@ [run] +branch = True + omit = */tests/* diff --git a/libs/client/changelog.rst b/libs/client/changelog.rst index 5afa33865..d63e03b0d 100644 --- a/libs/client/changelog.rst +++ b/libs/client/changelog.rst @@ -1,3 +1,14 @@ +version 1.1.1 +-------------- + +- released: 2024-08-29 +- description: small security fixes +- changelog: + - bump PuLP to version 2.9.0 + - bump requests to version 2.32.3 + - modified branch structure on repository. + - minor changes to documentation + version 1.1.0 -------------- diff --git a/libs/client/requirements.txt b/libs/client/requirements.txt index a3d662fe4..27c7dd937 100644 --- a/libs/client/requirements.txt +++ b/libs/client/requirements.txt @@ -1,7 +1,7 @@ -requests<=2.31.0 +requests<=2.32.3 genson<=1.2.2 jsonschema<=4.19.1 marshmallow<=3.19.0 pytups<=0.86.2 ortools<=9.8.3296 -PuLP<=2.7.0 \ No newline at end of file +PuLP<=2.9.0 diff --git a/libs/client/setup.py b/libs/client/setup.py index bd3b8f896..48a6ebca6 100644 --- a/libs/client/setup.py +++ b/libs/client/setup.py @@ -12,7 +12,7 @@ setuptools.setup( name="cornflow-client", - version="1.1.0", + version="1.1.1", author="baobab soluciones", author_email="sistemas@baobabsoluciones.es", description="Client to connect to a cornflow server",