Skip to content

Commit

Permalink
Merge to master (#2)
Browse files Browse the repository at this point in the history
1. Update-docker-and-script
2. Update Readme
  • Loading branch information
saurabh-slacklife authored Feb 1, 2020
1 parent 4c2587e commit 7ad9612
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* [Build and run](#Build-and-run)
* [Using Docker](#Using-Docker)
* [Using shell script](#Using-shell-script)
* [Logs](#logs)
* [Release History](#Release-History)
* [Contribute](#Contribute)

Expand Down Expand Up @@ -78,6 +79,38 @@ chmod +x start.sh
nohup ./scripts/start.sh &
```

## Logs

### Local system
```shell script
# Navigate to path /var/log/ml-price-recommendation-api
cd /var/log/ml-price-recommendation-api

# Gunicorn access logs path
tail -f /var/log/ml-price-recommendation-api/access.log

# Application log path
tail -f /var/log/ml-price-recommendation-api/application.log
```

### Docker
```shell script
# Find the docker CONTAINER_ID based on the Image tag: data-model-service:v1
docker ps | grep "data-model-service:v1" | cut -d" " -f1

# Access the docker shell
docker exec -it <CONTAINER_ID> /bin/sh

# Navigate to path /var/log/ml-price-recommendation-api
cd /var/log/ml-price-recommendation-api

# Gunicorn access logs path
tail -f /var/log/ml-price-recommendation-api/access.log

# Application log path
tail -f /var/log/ml-price-recommendation-api/application.log
```

## Release History

* 1.0.0
Expand Down
2 changes: 2 additions & 0 deletions scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ echo "Environment ${SERVICE_ENV}"
export APP_CONFIG_FILE=/opt/price-modeling/config/${SERVICE_ENV}.py
export PYTHONPATH="$PWD/api"

sudo mkdir -p /var/log/ml-price-recommendation-api

echo "APP_CONFIG_FILE: " $APP_CONFIG_FILE

exec gunicorn api.app:app \
Expand Down

0 comments on commit 7ad9612

Please sign in to comment.