From c06321f8f13aecb76313a4d593fe3cd063720362 Mon Sep 17 00:00:00 2001 From: AdamZh0u Date: Sun, 1 Dec 2024 16:29:22 +0000 Subject: [PATCH 1/3] modif docker configs for example test --- Dockerfile | 13 +++++++------ docker-compose.yml | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 61348e690b9..6ce524b99a4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,8 +7,8 @@ FROM python:bookworm LABEL maintainer="rht " # To use this Dockerfile: -# 1. `docker build . -t mymesa_image` -# 2. `docker run --name mymesa_instance -p 8765:8765 -it mymesa_image` +# 1. `docker build . -t mesa_image` +# 2. `docker run --name mesa_instance -p 8765:8765 -it mesa_image` # 3. In your browser, visit http://127.0.0.1:8765 # # Currently, this Dockerfile defaults to running the Schelling model, as an @@ -19,7 +19,7 @@ LABEL maintainer="rht " # `docker run --name mymesa_instance -p 8765:8765 -e MODEL_DIR=/mesa-examples/examples/sugarscape_cg -it mymesa_image` # Note: the model directory MUST contain an app.py file. -ENV MODEL_DIR=/mesa-examples/examples/schelling_experimental +ENV MODEL_DIR=/opt/mesa/mesa/examples/basic/schelling # Don't buffer output: # https://docs.python.org/3.10/using/cmdline.html?highlight=pythonunbuffered#envvar-PYTHONUNBUFFERED @@ -29,10 +29,11 @@ WORKDIR /opt/mesa COPY . /opt/mesa -RUN cd / && git clone https://github.com/projectmesa/mesa-examples.git - EXPOSE 8765/tcp -RUN pip3 install -e /opt/mesa +RUN pip3 install -e /opt/mesa[all] CMD ["sh", "-c", "cd $MODEL_DIR && solara run app.py --host=0.0.0.0"] + +# To check file system: +# docker exec -it mesa_instance bash \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 9b8e165f0f1..7831079b6ac 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,6 +16,6 @@ services: # within the current directory. # E.g. if it is at my-model, then you specify it as # /opt/mesa/my-model. - MODEL_DIR: /mesa-examples/examples/schelling_experimental + MODEL_DIR: /opt/mesa/mesa/examples/basic/schelling ports: - 8765:8765 From a16280c74be582ef5bb8759b2b5ea11a0377a8fb Mon Sep 17 00:00:00 2001 From: Adam Zh0u <48118109+AdamZh0u@users.noreply.github.com> Date: Sun, 1 Dec 2024 19:27:33 +0000 Subject: [PATCH 2/3] Update dockerfile from mesa[all] to mesa[rec] Co-authored-by: Ewout ter Hoeven --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6ce524b99a4..e13192c53a9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,7 +31,7 @@ COPY . /opt/mesa EXPOSE 8765/tcp -RUN pip3 install -e /opt/mesa[all] +RUN pip3 install -e /opt/mesa[rec] CMD ["sh", "-c", "cd $MODEL_DIR && solara run app.py --host=0.0.0.0"] From 465a6cbc1cbbe2fdf15f081caa73adb203280025 Mon Sep 17 00:00:00 2001 From: Adam Zh0u <48118109+AdamZh0u@users.noreply.github.com> Date: Mon, 2 Dec 2024 12:18:10 +0000 Subject: [PATCH 3/3] Update Dockerfile : change maintainer and remove numpy issue comments --- Dockerfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index e13192c53a9..a5af06e220b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,8 @@ # We can't use slim because we need either git/wget/curl to # download mesa-examples, and so installing them requires # updating the system anyway. -# We can't use alpine because NumPy doesn't support musllinux yet. -# But it's in the RC version https://github.com/numpy/numpy/issues/20089. FROM python:bookworm -LABEL maintainer="rht " +LABEL maintainer="projectmesa maintainers@projectmesa.dev" # To use this Dockerfile: # 1. `docker build . -t mesa_image` @@ -36,4 +34,4 @@ RUN pip3 install -e /opt/mesa[rec] CMD ["sh", "-c", "cd $MODEL_DIR && solara run app.py --host=0.0.0.0"] # To check file system: -# docker exec -it mesa_instance bash \ No newline at end of file +# docker exec -it mesa_instance bash