Skip to content
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

Rewrite the service management to leverage Docker Compose #154

Merged
merged 14 commits into from
Mar 30, 2023

Conversation

lucatume
Copy link
Contributor

This updates the code to leverage Docker Compose own system of dependency management and IP address resolution.
This results in a less clunky experience, more robust handling of dependencies, speed improvment and less code.

I've added healthcheck entries to the base containers to deleagate the complexity of managing their state to Docker Compose.
Depending containers, e.g. the wordpress or the slic one, can now depend on healthy services.
Along with this the requirements of the PHP CLI to have the mysql extension installed is gone.

I've also leveraged the network.aliases configuration to make sure the wordpress service IP is resolved at the network level, avoiding the fetching and setting of IP addresses in the PHP code.

Since I have added it for debugging purposes, I've refined and added the dc command to run direct Docker Compose commands in the stack.

Finally, I've introduced a slic_cache_ API to cache values across the application. Right now a simple array, I'm working on a Redis based solution next (since we have the redis service).

Screencast

@lucatume lucatume self-assigned this Mar 10, 2023
@lucatume lucatume requested a review from borkweb March 10, 2023 15:19
@lucatume lucatume marked this pull request as ready for review March 17, 2023 09:13
@lucatume
Copy link
Contributor Author

I've been using this for my day-to-day work on slic for a week and I do not seem to have broken anything. I will spin up a TEC build using this branch to test it out in CI context.

@lucatume
Copy link
Contributor Author

Tested with an ECP build -- I've used the containers from version 1.2.2 (they did not change) and it works.

borkweb
borkweb previously approved these changes Mar 21, 2023
Copy link
Member

@borkweb borkweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first time I tried to look at this, I failed to get the containers to fetch (and I tried a bunch of things). I just tried again and it worked like a champ. I'm able to cleanly run tests 🌵 💨

@borkweb borkweb dismissed their stale review March 21, 2023 20:58

Some tests are failing in weird ways.

@borkweb
Copy link
Member

borkweb commented Mar 21, 2023

Actually, I'm getting some unexpected errors while running slic run wpunit on the-events-calendar, so I'm unsure what the deal is.

@lucatume
Copy link
Contributor Author

Actually, I'm getting some unexpected errors while running slic run wpunit on the-events-calendar, so I'm unsure what the deal is.

Could you run slic down && slic reset wp && slic up and let me know what the issue is?

@borkweb
Copy link
Member

borkweb commented Mar 29, 2023

Perhaps the slic reset wp was the key. Runs like a champ, now! Nice and speedy.

@lucatume lucatume merged commit b6c0e0a into main Mar 30, 2023
@lucatume lucatume deleted the refactor/leverage-docker-compose branch March 30, 2023 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants