Skip to content

Commit

Permalink
Package upgrade/improve pm2 restart by pre_stop
Browse files Browse the repository at this point in the history
  • Loading branch information
cywhale committed Aug 11, 2023
1 parent 979af5f commit d9fe56f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
2 changes: 2 additions & 0 deletions change_log.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@
###### ver 0.2.3 Breaking move read_gebco01.py to gebco_app.py, try polygon mode in wireframe01

###### ver 0.2.4 Add jsonsrc can feed JSON url/string, and fix openapi.json in /swagger

###### ver 0.2.5 Package upgrade/improve pm2 restart by pre_stop
1 change: 1 addition & 0 deletions conf/ecosystem.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module.exports = {
append_env_to_name: true,
watch: false,
max_memory_restart: '4G',
pre_stop:"ps -ef | grep -w 'gebco_app' | grep -v grep | awk '{print $2}' | xargs -r kill -9"
}],
};

3 changes: 3 additions & 0 deletions simu.sh → conf/simu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ source "$HOME/python/py38/bin/activate"
cd "$HOME/python/gebco"
gunicorn gebco_app:app -w 4 -k uvicorn.workers.UvicornWorker -b 127.0.0.1:8013 --keyfile conf/privkey.pem --certfile conf/fullchain.pem --reload

# debug
gunicorn gebco_app:app -k uvicorn.workers.UvicornWorker -b 127.0.0.1:8013 --keyfile conf/privkey.pem --certfile conf/fullchain.pem --reload --capture-output --log-level debug --access-logfile - --error-logfile -

# pm2 start
pm2 start ./conf/ecosystem.config.js

Expand Down
2 changes: 1 addition & 1 deletion gebco_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def numarr_query_validator(qry):
return ("Format Error")


@app.get("/gebco")
@app.get("/gebco", tags=["Bathymetry"], summary="Get GEBCO bathymetry as JSON")
def zprofile(lon: Optional[str] = Query(
None,
description="comma-separated longitude values. One of lon/lat and jsonsrc should be specified as longitude/latitude input.",
Expand Down
16 changes: 8 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
dask==2023.4.0
fastapi==0.95.2
dask==2023.8.0
fastapi==0.101.0
geopy==2.3.0
gunicorn==20.1.0
numpy==1.24.3
polars==0.17.15
gunicorn==21.2.0
numpy==1.25.2
polars==0.18.13
Requests==2.31.0
uvicorn==0.21.1
xarray==2023.02.0
zarr==2.14.2
uvicorn==0.23.2
xarray==2023.07.0
zarr==2.16.0

0 comments on commit d9fe56f

Please sign in to comment.