diff --git a/CMakeLists.txt b/CMakeLists.txt index 33a4e3f..7cb0b58 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -199,7 +199,7 @@ endif() # ---------------------------------- # Main Project Executable # ---------------------------------- -set(INTERPRETER tools/forefire/ForeFire.cpp tools/forefire/AdvancedLineEditor.cpp) +set(INTERPRETER app/forefire/ForeFire.cpp app/forefire/AdvancedLineEditor.cpp) add_executable(forefire ${INTERPRETER}) if(DEFINED NETCDF_STATIC_LIBS) if(MPI_FOUND) diff --git a/Dockerfile b/Dockerfile index cbab8ce..fb1225d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,8 +19,13 @@ RUN pip3 install --no-cache-dir lxml xarray netCDF4 WORKDIR /forefire ENV FOREFIREHOME=/forefire -# we could only copy src, cmakelists.txt and cmake-build.sh -COPY . . +# Copy build configuration first (rarely changes) +COPY CMakeLists.txt cmake-build.sh LICENSE ./ + +# Copy source code and applications +COPY src/ ./src/ +COPY app/ ./app/ +COPY tools/runANN/ ./tools/runANN/ # Build and install the ForeFire C++ library RUN sh cmake-build.sh @@ -29,7 +34,16 @@ RUN sh cmake-build.sh RUN cp /forefire/bin/forefire /usr/local/bin/ # Use pip to install the Python bindings +COPY bindings/ ./bindings/ RUN pip3 install ./bindings/python +# Copy everything else (changes most frequently - docs, tests, etc.) +COPY . . + +# WE COULD USE A CUSTOM ENTRYPOINT SCRIPT TO START THE HTTP SERVER AND RUN THE DEMO SIMULATION +# COPY tools/devops/entrypoint.sh /usr/local/bin/entrypoint.sh +# RUN chmod +x /usr/local/bin/entrypoint.sh +# ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] + # Set the entrypoint to bash for interactive sessions CMD ["bash"] \ No newline at end of file diff --git a/tools/forefire/AdvancedLineEditor.cpp b/app/forefire/AdvancedLineEditor.cpp similarity index 100% rename from tools/forefire/AdvancedLineEditor.cpp rename to app/forefire/AdvancedLineEditor.cpp diff --git a/tools/forefire/AdvancedLineEditor.hpp b/app/forefire/AdvancedLineEditor.hpp similarity index 100% rename from tools/forefire/AdvancedLineEditor.hpp rename to app/forefire/AdvancedLineEditor.hpp diff --git a/tools/forefire/ForeFire.cpp b/app/forefire/ForeFire.cpp similarity index 100% rename from tools/forefire/ForeFire.cpp rename to app/forefire/ForeFire.cpp diff --git a/tools/forefire/commands.md b/app/forefire/commands.md similarity index 100% rename from tools/forefire/commands.md rename to app/forefire/commands.md diff --git a/paper/paper.md b/paper/paper.md index 95190fd..e3a8418 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -59,6 +59,7 @@ authors: corresponding: false - name: Antonio Leblanc affiliation: 4 + orcid: 0009-0001-9043-2039 corresponding: false - name: Alberto Alonso-Pinar orcid: 0009-0009-2051-9700 diff --git a/src/include/Version.h b/src/include/Version.h index 6d3ab43..759b7ed 100644 --- a/src/include/Version.h +++ b/src/include/Version.h @@ -1,3 +1,3 @@ #pragma once -const char* ff_version = "v2.2.0"; +const char* ff_version = "v2.2.1"; diff --git a/tools/devops/entrypoint.sh b/tools/devops/entrypoint.sh new file mode 100644 index 0000000..fa15f6e --- /dev/null +++ b/tools/devops/entrypoint.sh @@ -0,0 +1,34 @@ +#!/bin/bash +set -e + +echo "🔥 ForeFire Quick Start Demo" +echo "==============================" +echo "" + +# Navigate to the test directory +cd /forefire/tests/runff + +echo "📁 Working directory: $(pwd)" +echo "🌐 Starting ForeFire with HTTP server..." +echo "" +echo "Once started, open your browser to: http://localhost:8000" +echo "To run the demo simulation, type: include[real_case.ff]" +echo "To stop, press Ctrl+C" +echo "" + +# Function to handle graceful shutdown +cleanup() { + echo "" + echo "🛑 Shutting down ForeFire..." + exit 0 +} + +# Set up signal handlers for graceful shutdown +trap cleanup SIGINT SIGTERM + +# Start forefire and automatically launch HTTP server +forefire -l & +FOREFIRE_PID=$! + +# Wait for the forefire process +wait $FOREFIRE_PID