ソースを参照

corr

Signed-off-by: Jean-Michel Batto <jmbatto@eldarsoft.com>
Jean-Michel Batto 3 週間 前
コミット
dc3e0c82d1
3 ファイル変更81 行追加13 行削除
  1. 58 8
      Dockerfile
  2. 5 3
      docker-compose.yml
  3. 18 2
      redo-20260123.txt

+ 58 - 8
Dockerfile

@@ -3,8 +3,8 @@ FROM julia:1.10-bookworm
 
 # Métadonnées
 LABEL maintainer="jmbatto"
-LABEL description="Environnement de portage Julia -> C avec PDI/HDF5 et Outils graphiques"
 
+LABEL description="Environnement Julia -> C avec PDI, HDF5, GTK4, Profiling et Xvfb"
 # Arguments pour gérer l'utilisateur (évite les fichiers root sur le host)
 ARG USER_ID=1001
 ARG GROUP_ID=1001
@@ -40,8 +40,40 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
 	pkg-config \
 	colordiff \
 	mpi-default-dev \
+	# --- Bibliothèques Scientifiques ---
+    libhdf5-dev libz-dev \
+    # --- X11 & Affichage de base ---
+    libx11-6 libxext6 libxrender1 libxtst6 xauth \
+	xvfb \
+	libgl1-mesa-dri \
+    libgl1 \
+    # --- DÉPENDANCES GTK4 & CAIRO (Le correctif est ici) ---
+    libgtk-4-1 \
+	libgtk-3-0 \
+    libglib2.0-0 \
+    libcairo2 \
+    libpango-1.0-0 \
+    libharfbuzz0b \
+    libgdk-pixbuf-2.0-0 \
+	libgdk-pixbuf2.0-bin \
+    libgraphene-1.0-0 \
+    librsvg2-common \
+    shared-mime-info \
+    # --- Thèmes & Polices (Indispensable pour éviter le crash GTK) ---
+    adwaita-icon-theme-full \
+    hicolor-icon-theme \
+    fonts-liberation \
+    # --- Outils de Graphisme (Pour PProf/Graphviz) ---
+    graphviz \
     && rm -rf /var/lib/apt/lists/*
 
+RUN LOADER_PATH=$(find /usr/lib -name gdk-pixbuf-query-loaders | head -n 1) && \
+    ln -s $LOADER_PATH /usr/bin/gdk-pixbuf-query-loaders && \
+    # On lance une première mise à jour du cache système maintenant
+    gdk-pixbuf-query-loaders --update-cache && \
+    echo "GDK Pixbuf loaders fixed and cached."
+
+
 # Configuration de l'environnement pour PDI
 ENV PDI_DIR=/usr/local
 ENV LD_LIBRARY_PATH=/usr/local/lib
@@ -66,16 +98,34 @@ RUN git clone https://github.com/pdidev/pdi.git . && \
     ldconfig && \
     cd / && rm -rf /tmp/pdi-build
 
-# 3. Pré-installation des packages Julia essentiels pour le portage
-# HDF5.jl pour lire/écrire ce que PDI manipule
-# Plots.jl pour la visualisation
-RUN julia -e 'import Pkg; Pkg.add(["HDF5", "Plots", "DataFrames"]); Pkg.precompile()'
+# 3. Pré-installation Julia (Avec Xvfb configuré proprement)
+# --server-args :
+#    "-screen 0 1920x1080x24" : Assure une géométrie valide pour les calculs de layout
+#    "-nolisten tcp"         : Désactive l'écoute réseau (Sécurité/Propreté)
+RUN rm /usr/local/julia/lib/julia/libstdc++.so.6
+RUN ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/local/julia/lib/julia/libstdc++.so.6
+ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
+RUN xvfb-run --auto-servernum --server-args="-screen 0 1920x1080x24 -nolisten tcp" \
+    julia -e 'import Pkg; \
+    # 1. On ajoute les paquets
+    Pkg.add(["HDF5", "Plots", "DataFrames", "Gtk4", "Gtk", "ProfileView", "PProf", "Reexport"]); \
+    # 2. Fix de compatibilité binaire (GLib 2.74 / Cairo 1.18)
+    Pkg.add(name="Glib_jll", version="2.74"); \
+    Pkg.pin("Glib_jll"); \
+    Pkg.add(name="Cairo_jll", version="1.18.2"); \
+    Pkg.pin("Cairo_jll"); \
+    # 3. Précompilation
+    Pkg.precompile()'
 
 # 4. Création de l'utilisateur non-root
-RUN groupadd -g ${GROUP_ID} ${USER_NAME} && \
-    useradd -m -u ${USER_ID} -g ${USER_NAME} -s /bin/bash ${USER_NAME}
-
+RUN groupadd -g ${GROUP_ID} ${USER_NAME}
+RUN adduser --uid ${GROUP_ID} --gid  ${GROUP_ID} --home /home/${USER_NAME} --shell /bin/bash --disabled-password --gecos '' ${USER_NAME} 
+RUN passwd -d ${USER_NAME}
+RUN adduser ${USER_NAME} sudo
+RUN mkdir -p /usr/local/var
+RUN chown ${USER_NAME} /usr/local/var
 
+ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/lib/x86_64-linux-gnu 
 
 # Passage à l'utilisateur
 USER ${USER_NAME}

+ 5 - 3
docker-compose.yml

@@ -17,7 +17,8 @@ services:
       - ./:/home/engineer/project
       # Montage du socket X11 pour l'affichage graphique (Linux)
       - /tmp/.X11-unix:/tmp/.X11-unix
-    
+      - /var/run/docker.sock:/var/run/docker.sock
+      - usrlocalvar-foo:/usr/local/var
     # Configuration de l'affichage
     environment:
       - DISPLAY=${DISPLAY}
@@ -29,7 +30,8 @@ services:
       - SYS_PTRACE
     security_opt:
       - seccomp:unconfined
-    
     # Garde le conteneur actif
     tty: true
-    stdin_open: true
+    stdin_open: true
+volumes:
+  usrlocalvar-foo:

+ 18 - 2
redo-20260123.txt

@@ -1,8 +1,24 @@
-https://github.com/flnt/Flower.jl/tree/electrolysis
+# https://github.com/flnt/Flower.jl/tree/electrolysis
+
+git clone -b electrolysis  https://github.com/flnt/Flower.jl  
+
+# dans le dossier /usr/local/var/test
+julia --project=../Flower.jl -e 'using Pkg; Pkg.instantiate()'
 
 LD_LIBRARY_PATH :/usr/lib/x86_64-linux-gnu 
 
 python3 ../../../Flower.jl/examples/flower_post_proc.py ../../../Flower.jl/examples/convergence_diffusion_constant_conductivity_bubble_wall_Newton.yml --func plot_all_fig_func --h5 flower_00000001.h5 --name current_lines
 
 
-julia +1.10.5 --project=../Flower.jl --threads=1 ../Flower.jl/examples/convergence.jl ../Flower.jl/examples/convergence_diffusion_constant_conductivity_bubble_wall_Newton.yml
+julia +1.10.5 --project=../Flower.jl --threads=1 ../Flower.jl/examples/convergence.jl ../Flower.jl/examples/convergence_diffusion_constant_conductivity_bubble_wall_Newton.yml
+
+
+Pour le Makefile
+
+# Initialise les dépendances Julia (à lancer une fois au démarrage du conteneur)
+init:
+	julia --project=../Flower.jl -e 'using Pkg; Pkg.instantiate(); Pkg.precompile()'
+
+# Votre commande de run existante
+run-convergence:
+	julia --project=../Flower.jl --threads=1 ../Flower.jl/examples/convergence.jl ../Flower.jl/examples/convergence_diffusion_constant_conductivity_bubble_wall_Newton.yml