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

Docs/small fixes #548

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions QUICK_START_GUIDE.RST
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Quick Start Guide
Presentation
------------

This is the **contributors's quick start guide** for the **Cornflow** project. This project is divided into four directories: `cornflow-Server <https://github.com/baobabsoluciones/cornflow/tree/master/cornflow-server>`_, `cornflow-client <https://github.com/baobabsoluciones/cornflow/tree/master/cornflow-client>`_, `cornflow-dags <https://github.com/baobabsoluciones/cornflow/tree/master/cornflow-dags>`_, and `cornflow-app <https://github.com/baobabsoluciones/cornflow-app>`_.
This is the **contributors's quick start guide** for the **cornflow** project. This project is divided into four directories: `cornflow-Server <https://github.com/baobabsoluciones/cornflow/tree/master/cornflow-server>`_, `cornflow-client <https://github.com/baobabsoluciones/cornflow/tree/master/cornflow-client>`_, `cornflow-dags <https://github.com/baobabsoluciones/cornflow/tree/master/cornflow-dags>`_, and `cornflow-app <https://github.com/baobabsoluciones/cornflow-app>`_.

**cornflow-server** allows you to run a local server on your computer, that will manage the instances of your problems, the created executions, and the communication with Airflow.

Expand All @@ -21,7 +21,7 @@ This is the **contributors's quick start guide** for the **Cornflow** project. T
-----------
First steps
-----------
The first steps to using Cornflow is to clone the **cornflow** repository, which contains the code for the **cornflow-server**, **cornflow-dags** and **cornflow-client** and the **cornflow-app** repository.:
The first steps to using cornflow is to clone the **cornflow** repository, which contains the code for the **cornflow-server**, **cornflow-dags** and **cornflow-client** and the **cornflow-app** repository.:

.. code-block:: console

Expand Down Expand Up @@ -96,7 +96,7 @@ To run cornflow-server, you need Linux or Windows with WSL installed.
<details open>
<summary>Apache-Airflow</summary>

Cornflow-server needs a running airflow server to operate. Once your virtual environment is activated, you can install airflow with pip:
cornflow-server needs a running airflow server to operate. Once your virtual environment is activated, you can install airflow with pip:

.. code-block:: shell

Expand Down Expand Up @@ -151,7 +151,7 @@ For each of the repositories, if you are going to modify the source code, you sh
git checkout name_of_your_branch


Cornflow-server
cornflow-server
===============

.. raw:: html
Expand Down Expand Up @@ -209,7 +209,7 @@ See the `documentation <https://baobabsoluciones.github.io/cornflow/main/install

</details>

Cornflow-dags
cornflow-dags
=============

.. raw:: html
Expand Down Expand Up @@ -285,7 +285,7 @@ Use your solution method
Once your dag is entirely developed, you can use the cornflow-client package to access it on the server. See an example `here <https://baobabsoluciones.github.io/cornflow/guides/use_solver.html>`_.


Cornflow-app
cornflow-app
============

.. raw:: html
Expand Down
10 changes: 5 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Cornflow
cornflow
=========

.. image:: https://img.shields.io/github/actions/workflow/status/baobabsoluciones/cornflow/build_docs.yml?label=docs&logo=github&style=for-the-badge
Expand Down Expand Up @@ -30,18 +30,18 @@ Cornflow
:target: https://app.codecov.io/gh/baobabsoluciones/cornflow


Cornflow is a collection of projects (being this a monorepo) that allow for the rapid prototyping and deployment of optimization-based applications. Contrary to other existing deployment servers, Cornflow is centered around the applications and the problems, not in the techniques. It offers several other advantages such as being completely free (as in freedom) and very flexible.
cornflow is a collection of projects (being this a monorepo) that allow for the rapid prototyping and deployment of optimization-based applications. Contrary to other existing deployment servers, cornflow is centered around the applications and the problems, not in the techniques. It offers several other advantages such as being completely free (as in freedom) and very flexible.

Cornflow uses input and output schemas to define “optimization problems” and then accepts any (for now python) code that reads data in the input schema and returns a solution in the output schema. We use JSONSchema to define these schemas. By working like this, Cornflow becomes technique-agnostic without losing data-validation and re-usability (e.g., we can have more than one “solution method” for the same problem).
cornflow uses input and output schemas to define “optimization problems” and then accepts any (for now python) code that reads data in the input schema and returns a solution in the output schema. We use JSONSchema to define these schemas. By working like this, cornflow becomes technique-agnostic without losing data-validation and re-usability (e.g., we can have more than one “solution method” for the same problem).

Being technique-agnostic implies we sometimes use CP models built with ortools, MIP models built with pyomo and some heuristics in pure python. But again, we could also have a localsolver model or any metaheuristic as long as it complies with the interface format for the particular optimization problem. In the `Examples of solution methods <https://baobabsoluciones.github.io/cornflow/examples/index.html#examples-of-solution-methods>`_ documentation section we describe some of the demo solution methods we have built and deployed.


Ways it can be used
---------------------

Cornflow main advantage is its flexibility and so it can be used and deployed in many ways. The easiest is to use the test server we already have deployed to test the current offer of solvers. For this, check the `User your solution method <https://baobabsoluciones.github.io/cornflow/guides/use_solver.html#user-your-solution-method>`_ documentation section on how to test the server and then the `Examples of solution methods <https://baobabsoluciones.github.io/cornflow/examples/index.html#examples-of-solution-methods>`_ documentation section to see what solvers are available.
cornflow main advantage is its flexibility and so it can be used and deployed in many ways. The easiest is to use the test server we already have deployed to test the current offer of solvers. For this, check the `User your solution method <https://baobabsoluciones.github.io/cornflow/guides/use_solver.html#user-your-solution-method>`_ documentation section on how to test the server and then the `Examples of solution methods <https://baobabsoluciones.github.io/cornflow/examples/index.html#examples-of-solution-methods>`_ documentation section to see what solvers are available.

If you want to have your solution available in the server, feel free to propose a new solution method via a Pull Request. This is explained in the documentation section `How to deploy a new solution method (2.0) <https://baobabsoluciones.github.io/cornflow/guides/deploy_solver_new.html#how-to-deploy-a-new-solution-method-2-0>`_.

Finally, if you want to deploy your own Cornflow-server privately and deploy your own private solution methods, you can check the several ways in which you can do that in `Deploy your own Cornflow-server <https://baobabsoluciones.github.io/cornflow/deploy/index.html#deploy-your-own-cornflow-server>`_.
Finally, if you want to deploy your own cornflow-server privately and deploy your own private solution methods, you can check the several ways in which you can do that in `Deploy your own cornflow-server <https://baobabsoluciones.github.io/cornflow/deploy/index.html#deploy-your-own-cornflow-server>`_.
25 changes: 25 additions & 0 deletions cornflow-dags/DAG/bar_cutting/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Bar cutting
------------

The problem consists of cutting a rod of length n into different pieces of products based on the demand of each one of them and an available set of cutting patterns to be used.

**Name of the DAG**: bar_cutting

**Available solution methods**:

- **default**: mip solver
- mip: mip solver that can be solved with CBC or Gurobi.
- CG: column generation solver that can be solved with CBC or Gurobi.

Decision
=========

The number of products per bar and pattern in order to satisfy the demand of each product.

Input data
===========

- Bars: List of bars available for cutting and their length.
- Products: List of products that can be produced and their length.
- Demand: List of demand for each product.
- Cutting patterns: List o available cutting patters per bar. The mip solver uses the ones established here, while the CG solver generates them from this initial list.
2 changes: 2 additions & 0 deletions cornflow-dags/DAG/facility_location/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Facility location
====================
26 changes: 26 additions & 0 deletions cornflow-dags/DAG/two_dimension_bin_packing/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Two dimension bin packing
-----------------------------

A set of objects have to be place on a two dimension grid maximizing the value of the objects placed on the grid. This problem is an extension of the bin packing problem. The bin packing problem is a combinatorial NP-hard problem. The two dimension bin packing problem is also NP-hard.

**Name of the DAG**: `two_dimension_bin_packing`

**Available solution methods**:

- **default**: A mip solver.
- right_corner: The mip solver based on coordinates of the right corner. It can be solved with CBC, Gurobi or SCIP.

Decision
========

For each object we have to decide if it is included on the bin and its position inside of it maximizing the value of the items placed on the bin.

Input data
===========

- Items: A set of items with their width, height and value.

- Parameters:

- width: The width of the bin.
- height: The height of the bin.
2 changes: 1 addition & 1 deletion cornflow-dags/DAG/vrp/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ We want to schedule delivery routes to cover the demand of a given set of custom

Each route has to start and end in one depot.

**Name of dag**: ``vrp
**Name of dag**: `vrp`

**Available solution methods**:

Expand Down
2 changes: 1 addition & 1 deletion cornflow-dags/README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
===============
Cornflow-dags
cornflow-dags
===============

Public DAGs for cornflow server
Expand Down
18 changes: 9 additions & 9 deletions cornflow-server/README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Cornflow
cornflow
=========

.. image:: https://github.com/baobabsoluciones/cornflow/workflows/build/badge.svg?style=svg
Expand All @@ -18,13 +18,13 @@ Cornflow

.. image:: https://img.shields.io/badge/License-Apache2.0-blue

Cornflow is an open source multi-solver optimization server with a REST API built using `flask <https://flask.palletsprojects.com>`_, `airflow <https://airflow.apache.org/>`_ and `pulp <https://coin-or.github.io/pulp/>`_.
cornflow is an open source multi-solver optimization server with a REST API built using `flask <https://flask.palletsprojects.com>`_, `airflow <https://airflow.apache.org/>`_ and `pulp <https://coin-or.github.io/pulp/>`_.

While most deployment servers are based on the solving technique (MIP, CP, NLP, etc.), Cornflow focuses on the optimization problems themselves. However, it does not impose any constraint on the type of problem and solution method to use.
While most deployment servers are based on the solving technique (MIP, CP, NLP, etc.), cornflow focuses on the optimization problems themselves. However, it does not impose any constraint on the type of problem and solution method to use.

With Cornflow you can deploy a Traveling Salesman Problem solver next to a Knapsack solver or a Nurse Rostering Problem solver. As long as you describe the input and output data, you can upload any solution method for any problem and then use it with any data you want.
With cornflow you can deploy a Traveling Salesman Problem solver next to a Knapsack solver or a Nurse Rostering Problem solver. As long as you describe the input and output data, you can upload any solution method for any problem and then use it with any data you want.

Cornflow helps you formalize your problem by proposing development guidelines. It also provides a range of functionalities around your deployed solution method, namely:
cornflow helps you formalize your problem by proposing development guidelines. It also provides a range of functionalities around your deployed solution method, namely:

* storage of users, instances, solutions and solution logs.
* deployment and maintenance of models, solvers and algorithms.
Expand All @@ -40,9 +40,9 @@ Cornflow helps you formalize your problem by proposing development guidelines. I
Installation instructions
-------------------------------

Cornflow is tested with Ubuntu 20.04, python >= 3.8 and git.
cornflow is tested with Ubuntu 20.04, python >= 3.8 and git.

Download the Cornflow project and install requirements::
Download the cornflow project and install requirements::

python3 -m venv venv
venv/bin/pip3 install cornflow
Expand All @@ -58,7 +58,7 @@ initialize the sqlite database::
flask create_admin_user -u cornflow -e cornflow_admin@admin.com -p cornflow_admin_password


activate the virtual environment and run Cornflow::
activate the virtual environment and run cornflow::

source venv/bin/activate
export FLASK_APP=cornflow.app
Expand All @@ -69,7 +69,7 @@ activate the virtual environment and run Cornflow::
export AIRFLOW_PWD=airflow_pwd
flask run

**Cornflow needs a running installation of Airflow to operate and more configuration**. Check `the installation docs <https://baobabsoluciones.github.io/cornflow/main/install.html>`_ for more details on installing airflow, configuring the application and initializing the database.
**cornflow needs a running installation of Airflow to operate and more configuration**. Check `the installation docs <https://baobabsoluciones.github.io/cornflow/main/install.html>`_ for more details on installing airflow, configuring the application and initializing the database.

Using cornflow to solve a PuLP model
---------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion cornflow-server/airflow_config/airflow_local_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
from airflow.www.utils import UIAlert

DASHBOARD_UIALERTS = [
UIAlert("Welcome! This is the backend of your Cornflow environment. Airflow™ is a platform created by the community to programmatically author, schedule and monitor workflows."),
UIAlert("Welcome! This is the backend of your cornflow environment. Airflow™ is a platform created by the community to programmatically author, schedule and monitor workflows."),
]
4 changes: 2 additions & 2 deletions cornflow-server/cornflow/cli/README.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
==============
Cornflow-tools
cornflow-tools
==============

Cornflow contains commands to help you create REST APIs in an easier and faster way.
cornflow contains commands to help you create REST APIs in an easier and faster way.
It includes a set of modules that can be used to start the creation of your flask REST API and some command line
interface commands that let you create a full REST API from a JSONSchema file that represent your data or
create a JSONSchema file representing your REST API.
Expand Down
2 changes: 1 addition & 1 deletion cornflow-server/cornflow/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class DefaultConfig(object):

# APISPEC:
APISPEC_SPEC = APISpec(
title="Cornflow API docs",
title="cornflow API docs",
version="v1",
plugins=[MarshmallowPlugin()],
openapi_version="2.0.0",
Expand Down
Loading
Loading