-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0660a4b
commit 4185b6d
Showing
5 changed files
with
68 additions
and
14 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
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,3 @@ | ||
#!/bin/bash | ||
source ${VENV_PATH}/bin/activate | ||
exec "$@" |
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,43 @@ | ||
## This file is used to configure the Celery service. | ||
|
||
It should be placed in the /etc/default directory. | ||
|
||
### Environment variables | ||
|
||
- `CELERYD_NODES`: The nodes to start. | ||
- `CELERY_BIN`: The path to the Celery binary. | ||
- `CELERY_APP`: The name of the Celery app. | ||
- `CELERYD_MULTI`: The multi command. | ||
- `CELERYD_OPTS`: The options to pass to the Celery command. | ||
- `CELERYD_PID_FILE`: The path to the PID file. | ||
- `CELERYD_LOG_FILE`: The path to the log file. | ||
- `CELERYD_LOG_LEVEL`: The log level. | ||
|
||
### Notes | ||
|
||
- Make sure to set the correct permissions for the `start_celery.sh` script. | ||
|
||
```bash | ||
chmod +x /home/ubuntu/full-stack-server/api/start_celery.sh | ||
``` | ||
|
||
- sudo chown ubuntu:ubuntu /etc/default/celery | ||
- sudo chmod 644 /etc/default/celery | ||
|
||
Remember to reload the systemd daemon after making changes to the service files. | ||
|
||
```bash | ||
sudo systemctl daemon-reload | ||
``` | ||
|
||
If you encounter errors, check the status of the service with: | ||
|
||
```bash | ||
sudo systemctl status <service-name> | ||
``` | ||
|
||
And check the logs with: | ||
|
||
```bash | ||
sudo journalctl -u <service-name> -f | ||
``` |
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,9 @@ | ||
VENV_PATH="/home/ubuntu/venv/neurolibre38" | ||
CELERY_BIN="${VENV_PATH}/bin/celery" | ||
CELERYD_NODES="w1 w2" | ||
CELERY_APP="neurolibre_celery_tasks" | ||
CELERYD_MULTI="multi" | ||
CELERYD_OPTS="--time-limit=300 --concurrency=8" | ||
CELERYD_PID_FILE="/home/ubuntu/full-stack-server/api/celery_preview/run/celery/%n.pid" | ||
CELERYD_LOG_FILE="/home/ubuntu/full-stack-server/api/celery_preview/log/celery/%n%I.log" | ||
CELERYD_LOG_LEVEL="INFO" |
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