Comments (7)
@dehengxu
Okay, I understand. I will release a hotfix as soon as possible.
from stack-lifecycle-deployment.
Both in module src.shared.helpers.get_data
and src.worker.tasks.terraform_worker
, use redis as result backend
r = redis.Redis(
host=settings.BACKEND_SERVER,
port=6379,
db=settings.BACKEND_DB,
charset="utf-8",
decode_responses=True,
)
this always create redis client, event I change BACKEND config to mysql , it connect failed
Do you mean this is should be BROKER_SERVER, BROKER_DB ?
from stack-lifecycle-deployment.
Hi @dehengxu
It has been fixed in version v2.26.1.
Now the cache configuration is managed through these variables:
CACHE_USER: str = os.getenv("SLD_CACHE_USER", "")
CACHE_PASSWD: str = os.getenv("SLD_CACHE_PASSWD", "")
CACHE_SERVER: str = os.getenv("SLD_CACHE_SERVER", "redis")
Thank you very much for your collaboration, and I hope you can continue contributing.
Regards
from stack-lifecycle-deployment.
Hi @dehengxu
thanks a lot for your feedback!
The result backend is changed to use the default database, this will add new tables to the database such as celery_taskmeta. It's important to change the size of the blob in the result column if you work with Terraform stacks with multiple resources.
mysql> desc celery_taskmeta;
+-----------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------+--------------+------+-----+---------+----------------+
| id | int | NO | PRI | NULL | auto_increment |
| task_id | varchar(155) | YES | UNI | NULL | |
| status | varchar(50) | YES | | NULL | |
| result | blob | YES | | NULL | |
| date_done | datetime | YES | | NULL | |
| traceback | text | YES | | NULL | |
| name | varchar(155) | YES | | NULL | |
| args | blob | YES | | NULL | |
| kwargs | blob | YES | | NULL | |
| worker | varchar(155) | YES | | NULL | |
| retries | int | YES | | NULL | |
| queue | varchar(155) | YES | | NULL | |
+-----------+--------------+------+-----+---------+----------------+
12 rows in set (0.00 sec)
Command for change size
ALTER TABLE celery_taskmeta MODIFY result MEDIUMBLOB;
ALTER TABLE celery_taskmeta MODIFY result LONGBLOB;
MEDIUMBLOB: Can store up to 16MB of data.
LONGBLOB: Can store up to 4GB of data.
from stack-lifecycle-deployment.
Thanks, I'll try it
from stack-lifecycle-deployment.
I saw your update v2.25.0, worker celery use mysql as backend, but api-backend get_data.py also use redis as backend. Should api-backend read from redis ?
I config backend to db+mysql for api-backend, but it connect refused. Because get_data.py only read task status from redis.
from stack-lifecycle-deployment.
HI @dehengxu
Both the workers and the API backend use MySQL as the result backend. When the configuration is changed, it affects both. However, Redis is also used as both a broker, a cache and a "semaphore" to prevent race conditions. The latter is the case in ./src/shared/helpers/get_data.py. To alter the behavior of tasks, it is done through Celery in sld-api-backend/config/celery_config.py, which is designed for you to pass environment variables to modify it.
ROKER_USER = os.getenv("BROKER_USER", "")
BROKER_PASSWD = os.getenv("BROKER_PASSWD", "")
BROKER_SERVER = os.getenv("BROKER_SERVER", "redis") # use rabbit or redis
BROKER_SERVER_PORT = os.getenv(
"BROKER_SERVER_PORT", "6379"
) # use por 6379 for redis or 5672 for RabbitMQ
BROKER_TYPE = os.getenv("BROKER_TYPE", "redis") # use amqp for RabbitMQ or redis
# Redus backend config
BACKEND_TYPE = os.getenv("BACKEND_TYPE", "db+mysql")
BACKEND_USER = os.getenv("BACKEND_USER", "root")
BACKEND_PASSWD = os.getenv("BACKEND_PASSWD", "123")
BACKEND_SERVER = os.getenv("BACKEND_SERVER", "db")
BACKEND_DB = os.getenv("BACKEND_DB", "restapi")`
Regards
from stack-lifecycle-deployment.
Related Issues (20)
- Depoly
- Depoy HOT 6
- How's SLD compare to gaia-app.io? HOT 2
- Git clone TimeLimitExceeded(15,) HOT 8
- Login is failing with default admin user after first time installation HOT 1
- How to custom terraform command ? HOT 2
- invalid username-password pair or user is disabled HOT 1
- When I create new stack , input field "Project_Path" length limited at 20 chars, it's better get it more greater, like 200 chars ... HOT 2
- Task record in db doesn't include state, but in redis its not reliable, could missing HOT 1
- How can I disable destroy cron task? HOT 3
- Does SLD worker wait all tasks done when receive signal signal.SIGTERM from k8s or docker ? HOT 1
- Stacks as YAML? HOT 1
- Clone deploy erro when name exist
- When there is an error prior to applying Terraform, it is not shown in the UI
- Does SLD support multiple cloud provider when operates resource on multiple cloud in one tf config ? HOT 9
- [Feedback] - Project Documentation HOT 1
- When the worker-squad crush from some reason(Evicted, OOMKiller..) the deploy state is stuck and returns the error “Deploy state running, cannot upgrade HOT 1
- Deploy record stuck HOT 1
- Private git repository
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stack-lifecycle-deployment.