-
Notifications
You must be signed in to change notification settings - Fork 347
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
Make docker and docker-compose work on WSL2 #1375
Conversation
76f1393
to
419f742
Compare
Signed-off-by: Alex Chantavy <[email protected]>
Signed-off-by: Alex Chantavy <[email protected]>
Signed-off-by: Alex Chantavy <[email protected]>
402910c
to
3cbb6c9
Compare
Signed-off-by: Alex Chantavy <[email protected]>
Signed-off-by: Alex Chantavy <[email protected]>
Signed-off-by: Alex Chantavy <[email protected]>
Signed-off-by: Alex Chantavy <[email protected]>
Signed-off-by: Alex Chantavy <[email protected]>
@@ -16,11 +16,13 @@ | |||
from tests.data.github.rate_limit import RATE_LIMIT_RESPONSE_JSON | |||
|
|||
|
|||
@patch('cartography.intel.github.util.time.sleep') |
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.
Unrelated to this change, but this was wrong for a while and added 2 extra seconds to each test unncessarily
interval: 10s | ||
timeout: 10s | ||
retries: 10 | ||
|
||
# Runs the standard cartography image available at ghcr.io. | ||
cartography: | ||
image: ghcr.io/lyft/cartography:latest | ||
image: ghcr.io/cartography-cncf/cartography:latest | ||
platform: linux/x86_64 |
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.
This is needed for M* Macs.
@@ -34,14 +33,15 @@ services: | |||
# Networking: | |||
- dbms.connector.bolt.listen_address=0.0.0.0:7687 | |||
healthcheck: | |||
test: ["CMD", "curl", "-f", "http://localhost:7474"] | |||
test: ["CMD", "wget", "--no-verbose", "http://localhost:7474"] |
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.
wget works better than curl in reporting health for some reason. curl would get stuck on 'starting' status.
### Summary > Describe your changes. Fixes the docker-compose steps to work on WSL2 (Windows Subsystem for Linux 2) and OSX. Updates documentation to use the new cncf tag when building the container. docker-compose is very helpful for dev setups and trying out cartography. ### Checklist ### Testing performed I started with a fresh clone of this branch and on _both_ OSX and WSL2ran 1. `docker build -t cartography-cncf/cartography-dev -f dev.Dockerfile ./` 1. `docker-compose run cartography-dev make test` I can confirm that both paths worked and ran the full test suite using docker-compose. #### WSL2 Linter:  Unit tests:  Integration tests:  #### OSX Linter: <img width="1000" alt="Screenshot 2024-11-03 at 12 29 49 AM" src="https://github.com/user-attachments/assets/e7840c2a-8065-4163-8057-3de902532291"> Unit tests: <img width="997" alt="Screenshot 2024-11-03 at 12 30 07 AM" src="https://github.com/user-attachments/assets/11d91723-776c-4438-b2a1-fe783e75e414"> Integration tests: <img width="1003" alt="Screenshot 2024-11-03 at 12 30 22 AM" src="https://github.com/user-attachments/assets/c2360ad5-a2c2-4309-91d0-1080dc9d0bb3"> --------- Signed-off-by: Alex Chantavy <[email protected]> Signed-off-by: chandanchowdhury <[email protected]>
Summary
Fixes the docker-compose steps to work on WSL2 (Windows Subsystem for Linux 2) and OSX. Updates documentation to use the new cncf tag when building the container.
docker-compose is very helpful for dev setups and trying out cartography.
Checklist
Testing performed
I started with a fresh clone of this branch and on both OSX and WSL2ran
docker build -t cartography-cncf/cartography-dev -f dev.Dockerfile ./
docker-compose run cartography-dev make test
I can confirm that both paths worked and ran the full test suite using docker-compose.
WSL2
Linter:

Unit tests:

Integration tests:

OSX
Linter:

Unit tests:

Integration tests:
