diff --git a/app1.ini b/app1.ini index 0b483bb..653e059 100644 --- a/app1.ini +++ b/app1.ini @@ -6,8 +6,9 @@ threads=true wsgi-file=foobar.py vacuum=true -socket=127.0.0.1:9027 +touch-reload=app1.ini +socket=127.0.0.1:19027 -stats-server=run/9027_stats.sock +stats-server=run/19027_stats.sock -subscribe2=addr=127.0.0.1:9027,key=app1.pikesquares.local,server=127.0.0.1:9700 +subscribe2=addr=127.0.0.1:19027,key=app1.pikesquares.local,server=127.0.0.1:19700 diff --git a/app2.ini b/app2.ini index ee44385..ea2afb4 100644 --- a/app2.ini +++ b/app2.ini @@ -6,7 +6,8 @@ threads = true wsgi-file = foobar.py vacuum=true -socket=127.0.0.1:9028 -stats-server=run/9028_stats.sock +touch-reload=app2.ini +socket=127.0.0.1:19028 +stats-server=run/19028_stats.sock -subscribe2=addr=127.0.0.1:9028,key=app1.pikesquares.local,server=127.0.0.1:9700 +subscribe2=addr=127.0.0.1:19028,key=app1.pikesquares.local,server=127.0.0.1:19700 diff --git a/app3.ini b/app3.ini index 1357ae3..32fa598 100644 --- a/app3.ini +++ b/app3.ini @@ -5,8 +5,10 @@ workers = 3 threads = true wsgi-file = foobar.py -socket=127.0.0.1:9029 +vacuum=true -stats-server=run/9029_stats.sock +touch-reload=app2.ini +socket=127.0.0.1:19029 +stats-server=run/19029_stats.sock -subscribe2=addr=127.0.0.1:9029,key=app2.pikesquares.local,server=127.0.0.1:9701 +subscribe2=addr=127.0.0.1:19029,key=app2.pikesquares.local,server=127.0.0.1:19701 diff --git a/app_stats.py b/app_stats.py index e49edf4..8ca0f17 100644 --- a/app_stats.py +++ b/app_stats.py @@ -14,7 +14,7 @@ def read_stats(socket_address): if __name__ == "__main__": counter = 0 - nodes =["127.0.0.1:9027", "127.0.0.1:9030"] + nodes =["127.0.0.1:19027", "127.0.0.1:19030"] for node in nodes: port = node.split(":")[-1] socket_address = f"{port}_stats.sock" diff --git a/justfile b/justfile new file mode 100644 index 0000000..4434e4e --- /dev/null +++ b/justfile @@ -0,0 +1,5 @@ +default: + just --list + +up: + process-compose -p 19995 diff --git a/process-compose.yml b/process-compose.yml new file mode 100644 index 0000000..4e6acd1 --- /dev/null +++ b/process-compose.yml @@ -0,0 +1,73 @@ +version: "0.1" +is_strict: true +log_location: "process-compose.log" +log_level: debug +log_configuration: + fields_order: ["time", "level", "message"] # order of logging fields. The default is time, level, message + disable_json: true # output as plain text. The default is false + timestamp_format: "06-01-02 15:04:05.000" # timestamp format. The default is RFC3339 + no_metadata: true # don't log process name and replica number + add_timestamp: true # add timestamp to the logger. Default is false + no_color: true # disable ANSII colors in the logger. Default is false + flush_each_line: true # disable buffering and flush each line to the log file. Default is false + +vars: + +environment: + +processes: + uWSGI HTTP Router 1: + environment: + command: "uwsgi sub1.ini" + description: uWSGI HTTP Router 1 + is_daemon: false + disabled: false + + availability: + restart: "no" + exit_on_end: true + + uWSGI HTTP Router 2: + environment: + command: "uwsgi sub2.ini" + description: uWSGI HTTP Router 2 + is_daemon: false + disabled: false + availability: + restart: "no" + + uWSGI App 1: + environment: + command: "uwsgi app1.ini" + description: uWSGI App 1 on port 19027 + is_daemon: false + disabled: false + availability: + restart: "no" + depends_on: + uWSGI HTTP Router 1: + condition: process_completed_successfuly + + uWSGI App 2: + environment: + command: "uwsgi app2.ini" + description: uWSGI App 2 on port 19028 + is_daemon: false + disabled: false + availability: + restart: "no" + depends_on: + uWSGI HTTP Router 1: + condition: process_completed_successfuly + + uWSGI App 3: + environment: + command: "uwsgi app3.ini" + description: uWSGI App 3 on port 19029 + is_daemon: false + disabled: false + availability: + restart: "no" + depends_on: + uWSGI HTTP Router 2: + condition: process_completed_successfuly diff --git a/sub1.ini b/sub1.ini index 8c1ce56..9b4747a 100644 --- a/sub1.ini +++ b/sub1.ini @@ -3,6 +3,6 @@ strict=true master=true touch-reload=sub1.ini vacuum=true -http=0.0.0.0:8934 -http-subscription-server=127.0.0.1:9700 +http=0.0.0.0:18934 +http-subscription-server=127.0.0.1:19700 http-stats=run/sub1-stats.sock diff --git a/sub2.ini b/sub2.ini index 2b6a56c..f2a7ccb 100644 --- a/sub2.ini +++ b/sub2.ini @@ -3,6 +3,6 @@ strict=true master=true touch-reload=sub2.ini vacuum=true -http=0.0.0.0:8935 -http-subscription-server=127.0.0.1:9701 +http=0.0.0.0:18935 +http-subscription-server=127.0.0.1:19701 http-stats=run/sub2-stats.sock