-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Redirect Waldur logs to stdout instead of file [WAL-4028]
- Loading branch information
1 parent
9231d6c
commit f5b1118
Showing
7 changed files
with
122 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
pgsql | ||
waldur_libs | ||
waldur_logs | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ docker exec -t waldur-mastermind-worker status | |
# Create user | ||
docker exec -t waldur-mastermind-worker waldur createstaffuser -u admin -p password -e [email protected] | ||
|
||
# Create demo categories for OpenStack: Virtual Private Cloud, VMs and Storage | ||
# Create demo categories for OpenStack: Virtual Private Cloud, VMs and Storage | ||
docker exec -t waldur-mastermind-worker waldur load_categories vpc vm storage | ||
``` | ||
|
||
|
@@ -43,6 +43,11 @@ Tearing down and cleaning up: | |
docker-compose down | ||
``` | ||
|
||
## Logs | ||
|
||
Logs emitted by the containers are collected and saved in the `waldur_logs` folder. You can change the location by | ||
editing environment variable (`.env`) and updating `LOG_FOLDER` value. | ||
|
||
## Known issues | ||
|
||
When Waldur is launched for the first time, it applies initial database migrations. | ||
|
@@ -60,9 +65,8 @@ docker-compose restart | |
## Using TLS | ||
|
||
1. Add private key and certificate to ``./certs`` folder. | ||
2. Edit docker-compose.yml and replace port section with '80'. This is needed to force HTTP->HTTPS redirect from a TLS proxy: | ||
``sed -i 's/${WALDUR_INTERNAL_PORT}:80/80/' docker-compose.yml``. | ||
3. Change `WALDUR_PUBLIC_PORT` in .env to 443 and `WALDUR_PROTOCOL` to `https`. | ||
2. Edit docker-compose.yml and replace port section with '80'. This is needed to force HTTP->HTTPS redirect from a TLS proxy: `sed -i 's/${WALDUR_INTERNAL_PORT}:80/80/' docker-compose.yml`. | ||
3. Change `WALDUR_PUBLIC_PORT` in .env to 443 and `WALDUR_PROTOCOL` to https. | ||
4. Start docker-compose with an extra TLS proxy: | ||
|
||
```bash | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
echo "INFO: Running Celery Beat..." | ||
source /etc/waldur/celery.conf | ||
mkdir -p /run/waldur/celerybeat | ||
chown -R waldur:waldur /run/waldur/celerybeat | ||
cd /run/waldur/celerybeat | ||
gosu waldur sh -c "celery -A $CELERY_APP beat --loglevel=$CELERYBEAT_LOG_LEVEL --pidfile=$CELERYBEAT_PID_FILE $CELERYBEAT_OPTS" | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import sys | ||
|
||
|
||
LOGGING = { | ||
'version': 1, | ||
'disable_existing_loggers': False, | ||
|
||
'formatters': { | ||
'simple': { | ||
'format': '%(asctime)s %(levelname)s %(message)s', | ||
}, | ||
}, | ||
|
||
'handlers': { | ||
'console': { | ||
'class': 'logging.StreamHandler', | ||
'formatter': 'simple', | ||
'level': 'DEBUG', | ||
'stream': sys.stdout, | ||
}, | ||
}, | ||
|
||
'root': { | ||
'level': 'DEBUG', | ||
'handlers': ['console'], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Waldur uWSGI configuration file | ||
# | ||
# See also: http://uwsgi-docs.readthedocs.io/en/latest/Configuration.html#ini-files | ||
|
||
[uwsgi] | ||
buffer-size = 8192 | ||
chmod-socket = 666 | ||
enable-metrics = true | ||
gid = waldur | ||
# delegate logging to master process | ||
log-master = true | ||
# disable uWSGI standard logging | ||
disable-logging = true | ||
# ensure that critical errors are always logged | ||
log-4xx = true | ||
log-5xx = true | ||
module = waldur_core.server.wsgi:application | ||
plugins = python38 | ||
processes = 8 | ||
socket = :8000 # avoid localhost to fix binding issue | ||
static-map = /static=/usr/share/waldur/static | ||
static-map = /media=/var/lib/waldur/media | ||
uid = waldur | ||
enable-threads = true # required by sentry-sdk | ||
|
||
http-socket = :8080 | ||
http-enable-proxy-protocol = 1 | ||
http-auto-chunked = true | ||
http-keepalive = 75 | ||
http-timeout = 75 | ||
offload-threads = $(UWSGI_OFFLOAD_THREADS) | ||
|
||
add-header = Access-Control-Allow-Credentials: true | ||
add-header = Access-Control-Allow-Headers: Accept, Accept-Encoding, Authorization, Content-Type, Origin, User-Agent, X-CSRFToken, X-Requested-With | ||
add-header = Access-Control-Allow-Methods: DELETE, GET, OPTIONS, PATCH, POST, PUT | ||
add-header = Access-Control-Allow-Origin: * | ||
add-header = Access-Control-Expose-Headers: Link, X-Result-Count | ||
add-header = Connection: Keep-Alive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
echo "INFO: Running Celery Worker..." | ||
source /etc/waldur/celery.conf | ||
mkdir -p /run/waldur/celery | ||
chown -R waldur:waldur /run/waldur/celery | ||
gosu waldur sh -c "celery -A $CELERY_APP worker --concurrency=$CELERYD_CONCURRENCY --loglevel=$CELERYD_LOG_LEVEL --pidfile=$CELERYD_PID_FILE $CELERYD_OPTS" | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters