Skip to content

Commit

Permalink
Merge branch 'development' into release/v1.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
ggsdc committed Oct 13, 2023
2 parents 82a7ecc + 7c4dc95 commit d48ccd4
Show file tree
Hide file tree
Showing 12 changed files with 472 additions and 202 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,7 @@ cornssh.pub
*.db

# IO files
*.mps
*.mps

# airflow logs
cornflow-server/airflow_config/logs
7 changes: 6 additions & 1 deletion cornflow-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# AUTHOR: sistemas@baobabsoluciones.es

FROM python:3.10-slim-buster
LABEL maintainer="sistemas@baobabsoluciones"
LABEL maintainer="cornflow@baobabsoluciones"

# Never prompt the user for choices on installation/configuration of packages
ENV DEBIAN_FRONTEND noninteractive
Expand Down Expand Up @@ -39,6 +39,11 @@ RUN mkdir -p /usr/src/app/log
# create folder for custom ssh keys
RUN mkdir /usr/src/app/.ssh

# user cornflow on application
RUN useradd -ms /bin/bash -d /usr/src/app cornflow
RUN chown -R cornflow: /usr/src/app
USER cornflow

EXPOSE 5000

# execute python init script
Expand Down
4 changes: 2 additions & 2 deletions cornflow-server/airflow_config/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# VERSION 2.7.1
# AUTHOR: sistemas@baobabsoluciones.es
# AUTHOR: cornflow@baobabsoluciones.es
# DESCRIPTION: Airflow 2.7.1 image personalized for use with Cornflow (from puckel/docker-airflow https://github.com/puckel/docker-airflow by "Puckel_")

FROM python:3.10-slim-buster
LABEL maintainer="sistemas@baobabsoluciones"
LABEL maintainer="cornflow@baobabsoluciones"

# Never prompt the user for choices on installation/configuration of packages
ENV DEBIAN_FRONTEND noninteractive
Expand Down
23 changes: 23 additions & 0 deletions cornflow-server/airflow_config/airflow_local_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# AIRFLOW custom UI colors for CornflowEnv

STATE_COLORS = {
"deferred": "#7c4fe0",
"failed": "#c9301c",
"queued": "#656d78",
"removed": "#7bdcb5",
"restarting": "#9b51e0",
"running": "#01FF70",
"scheduled": "#fcb900",
"shutdown": "blue",
"skipped": "darkorchid",
"success": "#00d084",
"up_for_reschedule": "#f78da7",
"up_for_retry": "yellow",
"upstream_failed": "#b31e1e",
}

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."),
]
10 changes: 10 additions & 0 deletions cornflow-server/airflow_config/logs/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Airflow LOGS
--------------

Users can specify the directory to place log files in airflow.cfg using base_log_folder. By default, logs are placed in the AIRFLOW_HOME directory.

The following convention is followed while naming logs: {dag_id}/{task_id}/{execution_date}/{try_number}.log

In addition, users can supply a remote location to store current logs and backups.

In the Airflow Web UI, local logs take precedence over remote logs. If local logs can not be found or accessed, the remote logs will be displayed. Note that logs are only sent to remote storage once a task is complete (including failure); In other words, remote logs for running tasks are unavailable.
6 changes: 3 additions & 3 deletions cornflow-server/airflow_config/scripts/solvers/get_gurobi.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ def install():
install_dir = "/usr/local/airflow/gurobi"
os.chdir("/usr/local/airflow")
subprocess.check_output(
["wget", "https://packages.gurobi.com/9.5/gurobi9.5.0_linux64.tar.gz"]
["wget", "https://packages.gurobi.com/10.0/gurobi10.0.1_linux64.tar.gz"]
)
subprocess.check_output(["tar", "-xvf", "gurobi9.5.0_linux64.tar.gz"])
os.rename("gurobi950", "gurobi")
subprocess.check_output(["tar", "-xvf", "gurobi10.0.1_linux64.tar.gz"])
os.rename("gurobi1001", "gurobi")
uid = pwd.getpwnam("airflow").pw_uid
gid = grp.getgrnam("airflow").gr_gid
os.chown(install_dir, uid, gid)
Expand Down
1 change: 1 addition & 0 deletions cornflow-server/cornflow/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def create_app(env_name="development", dataconn=None):
dictConfig(log_config(app_config[env_name].LOG_LEVEL))

app = Flask(__name__)
app.json.sort_keys = False
app.logger.setLevel(app_config[env_name].LOG_LEVEL)

app.config.from_object(app_config[env_name])
Expand Down
Loading

0 comments on commit d48ccd4

Please sign in to comment.