-
-
Notifications
You must be signed in to change notification settings - Fork 429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Moving to tox-docker #583
base: master
Are you sure you want to change the base?
Moving to tox-docker #583
Conversation
Codecov Report
@@ Coverage Diff @@
## master #583 +/- ##
=========================================
- Coverage 57.8% 33.9% -23.8%
=========================================
Files 39 39
Lines 2497 2465 -32
Branches 73 73
=========================================
- Hits 1441 834 -607
- Misses 1041 1558 +517
- Partials 15 73 +58
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@@ -79,18 +79,10 @@ jobs: | |||
- name: Install dependencies | |||
run: | | |||
python -m pip install --upgrade pip | |||
python -m pip install --upgrade tox tox-gh-actions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@WisdomPill You may want to think about getting these out of your github actions and into something like a dev_dependencies (or pyproject.toml dev area). This way they're not as hidden from users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I guess I will add some kind of dev script to setup the environment.
I still do not really understand how tox installs dependencies and where is it getting redislatest
.
These are my first steps with tox
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Here's how I think about tox with docker:
- Define a series of docker images that may or may not get used
- Define tox environments that depend on individual dockers
- Add pre_commands or dependencies if/as necessary
- Run tests
For one project I use this pattern to parameterize a pytest option, so that we can control test execution and dockers being run. It may be a better example for your pattern.
@WisdomPill Awesome to see you also thinking of this approach! We ended up spinning our own dockers and pushing them to dockerhub, because it was the easiest way for us to proceed - while still having everything we need. Maybe that workflow is useful, or maybe those dockers are useful? I'm planning on (future) adding support for multiple versions of redis as well, so maybe we an collaborate there? If it helps any, I'm happy to push to dockerfab for you. Also - let me know how I can help! |
Now the problem seems to be that sentinel does find the master node, or that it is disconnected somehow. Do you know if the configuration is wrong? I would love to keep contributing maybe even with some python code to redis-py, count me in for testing multiple versions of redis, this is something we are also looking for. After solving this issue I would like also to tackle the usage of original docker images from redis. |
Our approach is a bit different. I pushed a series of dedicated dockers that I maintain and built once, from the community redis docker to dockerhub. Those dockers each load a configuration file from disk. You'll note the base docker folder, and the subsequent configuration files for a sentinel node, or a replica. Extending that we have tox-docker run a healthcheck for each docker, ensuring they're at least up. By controlling redis from outside, with the configuration file it becomes easy to (more) rapidly iterate on particular configuration needs. This was the reason I built the base docker from the community docker image, rather than our redis enteprise docker. Using that docker, and loading a configuration file that is mounted into the container using the volume mounts, added the flexibility needed for environments. Hope this helps @WisdomPill |
@chayim thanks for the great explanation. But, my problem is not on how to use tox-docker, my problem is with sentinel, it seems like the sentinel does not connect to the redis master, so my question is, is there something wrong with the configuration I have made? Could you have a look at it? I copied the configuration from redis-py and tried to make it work, but for a normal instance is working, for sentinel not. |
@WisdomPill Can you help walking me through running this locally on a single python? Looking at the dockers you're starting via tests/start_redis.sh the sentinel definitely sees the master - at least locally. I wasn't able to get pytest in my world functioning and running your tests - which I'm sure is on my side. But, I validated connectivity by running (locally, outside of the dockers)
Now, I connected to the sentinel node
With the above I'm no sentinel expert, but I think you need at least 3 nodes (so one more, see the text "Example 1: just two Sentinels, DON'T DO THIS). Because Hope this helps - and happy to debug more if you can help me on the environment side! |
@WisdomPill pinging you here too, as I'm happy to work on this in tandem. |
I did not have time to work on open source lately, I will get back to you soon |
Fixes #574
This PR is to make tox manage docker as
redis-py
is doing.I still have some issues with sentinel, I seem to not understand how it should work.
@chayim could you help me understand where I got the configuration wrong?
Also another couple of questions, why you are not using redislab docker hub repository?
What is the difference?
@terencehonles maybe you also have some hints?
After that the unix socket will be the last problem to solve, but for now I think it is not very important