-
Notifications
You must be signed in to change notification settings - Fork 928
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
Fix: running Mesa in Docker with Schelling model #2524
Conversation
Thanks for the PR. @projectmesa/maintainers or @AdamZh0u, can someone remind me what the use case for running Mesa in docker is exactly? |
Well, I guess the motivation is probably similar for many projects that use docker. You can get something up and running locally with one single I do not have docker installed on my mac, because it's not as convenient as it is on ubuntu. There might be others who prefer to use docker. |
+1 to what @wang-boyu said. |
Hi all, Docker allows seamless deployment of Mesa applications across Windows, macOS, and Linux without any platform-specific differences. It ensures that all dependencies and environments are consistent, making it easier for users to get started quickly. And also, it provides a reproducible testing environment and an issue-reporting environment for troubleshooting. In fact, on macOS, you can run an example model with just two simple commands: brew install docker
#cd mesa
docker compose up -d This simplicity is particularly useful for users who want a hassle-free setup experience. |
Yes I know these commands. What I meant was that using docker on macOS involves Linux virtual machines, and I'm using an old Intel macbook that can be a bit slow. This was the case a few years ago and things could have changed. There may be new virtual tech on Apple Silicon macs that I'm not aware of. Anyways this is just my own personal preference that do not apply to many others, and is not related to this PR. Sorry about the confusion. |
No worries! I’ve actually started promoting Docker because I’m in a Python course with over 100 students, and their systems range from macOS 10 to Windows Home version. We’ve been using Docker, and it’s been working smoothly on almost all computers, making things easier for everyone. |
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.
I don’t see anything weird in the changeset, so no objections from my side. One small suggestion. I will leave final review and merge to a maintainer more familiar with (our) Docker.
I would love to hear more about the course you’re teaching! |
Co-authored-by: Ewout ter Hoeven <E.M.terHoeven@student.tudelft.nl>
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.
Thanks for your interest! I’m involved in teaching a basic Python course this term, and Docker has been really helpful in making everything run smoothly across different systems. Next term, we’ll focus partly on ABM, so I’m exploring Mesa for this, trying to avoid the need to learn another language like NetLogo. |
LGTM. Merging now. Thanks @AdamZh0u for your first contribution to Mesa! |
@AdamZh0u Cool, thanks for sharing! |
Thanks for your contribution! @AdamZh0u I just tested the docker, and it works well. One small comment on your message: I think it's also necessary to install |
Just realized that I was wrong about this. Since the image is not released on docker hub, users still have to 1) clone the repo, If our image is on docker hub, then it's possible to just do |
Yes. Fair enough. I vote to be involved in the docker hub in the future. |
Hey! I think I need to make it clearer about two different workflows for using Mesa with Docker: For Developers: For Users: @SongshGeo Thanks for catching that! Just checked - actually this is already covered in the README where it lists Docker Compose installation as the first step. |
@projectmesa/maintainers do we want this? Things needed from our end would be (feel free to add more if I miss any):
This was previously discussed in #558 (comment). Interestinly there's an unmaintained Mesa image under CoMESE: https://hub.docker.com/r/comses/mesa. |
Summary
This pull request addresses issues with the existing Docker configuration, including missing dependencies and untested references to the mesa-examples repository. The updates ensure that the Mesa Schelling model runs correctly with Solara visualization in Docker on port 8765.
Bug / Issue
Implementation
Replaced the mesa-examples repository reference with the mesa.examples module, specifically pointing to the built-in Schelling model:
Testing