Put working data in Docker volume?

Moderators: Site Moderators, FAHC Science Team

Post Reply
kill0rz
Posts: 4
Joined: Mon Mar 22, 2021 9:09 am

Put working data in Docker volume?

Post by kill0rz »

Hey there,

I am running FAHClient in docker image. I want to restart, stop or delete the container as desired and keep the working data in container. I tried to put the work files in a volume, but after restart fah starts from 0%.

My Dockerfile:

Code: Select all

FROM debian:stable-slim

ENV FAH_VERSION_MAJOR=7.6

ENV DEBIAN_FRONTEND=noninteractive

RUN apt update && apt install --no-install-recommends -y \
        curl adduser bzip2 ca-certificates &&\
        curl -o /tmp/fah.deb https://download.foldingathome.org/releases/public/release/fahclient/debian-stable-64bit/v${FAH_VERSION_MAJOR}/latest.deb &&\
        mkdir -p /etc/fahclient/ &&\
        touch /etc/fahclient/config.xml &&\
        dpkg --install /tmp/fah.deb &&\
        apt-get remove -y curl &&\
                apt-get autoremove -y &&\
        rm --recursive --verbose --force /tmp/* /var/log/* /var/lib/apt/

# Web viewer
EXPOSE 7396
WORKDIR /var/lib/fahclient
ENTRYPOINT ["FAHClient", "--web-allow=0/0:7396", "--allow=0/0:7396"]
docker-compose:

Code: Select all

fah:
    build: ./fah/
    restart: always
    volumes:
      - './data/fah/:/var/lib/fahclient/'
volume looks like this:

Code: Select all

total 132K
-rw-r--r-- 1 root root  98K Mar 22 08:31 GPUs.txt
-rw-r--r-- 1 root root 1.3K Mar 22 08:33 config.xml
drwxr-xr-x 2 root root 4.0K Mar 22 08:32 configs
drwxr-xr-x 3 root root 4.0K Mar 22 08:32 cores
-rw-r--r-- 1 root root 1.3K Mar 21 21:24 fah-config.xml
-rw-r--r-- 1 root root 7.5K Mar 22 09:14 log.txt
drwxr-xr-x 2 root root 4.0K Mar 22 08:51 logs
drwxr-xr-x 3 root root 4.0K Mar 22 08:31 work
Seems good to me, config ist loaded at container boot. But why does fah start from 0% after removing the container? Any ideas?
bruce
Posts: 20824
Joined: Thu Nov 29, 2007 10:13 pm
Location: So. Cal.

Re: Put working data in Docker volume?

Post by bruce »

I can't answer the question, but somebody who understands containers can if he knows where to look.

A container has to be able to reference some semi-permanent external storage. The checkpoint information and the client's CPUID and some other things need to still be accessible when the container resumes work after a pause. This also must contain the date-time the WU was downloaded to the expiration date-time can be recomputed based on "now." The references in the WU's *.db information probably needs to be accessible, too.
kill0rz
Posts: 4
Joined: Mon Mar 22, 2021 9:09 am

Re: Put working data in Docker volume?

Post by kill0rz »

Thank you very much for your reply!

To my mind, the .db-files are already mounted in the volume:

Code: Select all

/var/lib/fahclient/work/client.db-journal
/var/lib/fahclient/work/client.db
because the volume goes to

Code: Select all

/var/lib/fahclient/
So this shouldn't be a problem?
calxalot
Site Moderator
Posts: 1161
Joined: Sat Dec 08, 2007 1:33 am
Location: San Francisco, CA
Contact:

Re: Put working data in Docker volume?

Post by calxalot »

You also need to persist config.xml
kill0rz
Posts: 4
Joined: Mon Mar 22, 2021 9:09 am

Re: Put working data in Docker volume?

Post by kill0rz »

This is located in the volumes as well and is read by FAHClient correctly.
calxalot
Site Moderator
Posts: 1161
Joined: Sat Dec 08, 2007 1:33 am
Location: San Francisco, CA
Contact:

Re: Put working data in Docker volume?

Post by calxalot »

There is an existing container project that you might want to take a close look at

https://github.com/linuxserver/docker-foldingathome
calxalot
Site Moderator
Posts: 1161
Joined: Sat Dec 08, 2007 1:33 am
Location: San Francisco, CA
Contact:

Re: Put working data in Docker volume?

Post by calxalot »

kill0rz
Posts: 4
Joined: Mon Mar 22, 2021 9:09 am

Re: Put working data in Docker volume?

Post by kill0rz »

Thank you for the hint!
Ich looked at these configurations and in the end they just do the same as I do - persist the working directory.

I'll port a log of a fresh startup after the server completed 3%. It was just a reboot of the container:

Code: Select all

fah_1     | 06:40:55:Caught signal SIGTERM(15) on PID 1
fah_1     | 06:40:55:Exiting, please wait. . .
fah_1     | 06:40:57:FS00:Shutting core down
fah_1     | 06:40:57:WU01:FS00:0xa8:Caught signal SIGINT(2) on PID 36
fah_1     | 06:40:57:WU01:FS00:0xa8:Exiting, please wait. . .
fah_1     | 06:40:57:WU01:FS00:0xa8:Folding@home Core Shutdown: INTERRUPTED
fah_1     | 06:41:07:Read GPUs.txt
fah_1     | 06:41:07:WARNING:Option 'allow' already set to '0/0:7396' reseting to '127.0.0.1 proxy'.
fah_1     | 06:41:07:WARNING:Option 'web-allow' already set to '0/0:7396' reseting to '127.0.0.1 proxy'.
fah_1     | 06:41:07:******************************* libFAH ********************************
fah_1     | 06:41:07:       Date: Oct 20 2020
fah_1     | 06:41:07:       Time: 20:36:39
fah_1     | 06:41:07:   Revision: 5ca109d295a6245e2a2f590b3d0085ad5e567aeb
fah_1     | 06:41:07:     Branch: master
fah_1     | 06:41:07:   Compiler: GNU 8.3.0
fah_1     | 06:41:07:    Options: -faligned-new -std=c++11 -fsigned-char -ffunction-sections
fah_1     | 06:41:07:             -fdata-sections -O3 -funroll-loops -fno-pie
fah_1     | 06:41:07:   Platform: linux2 5.8.0-1-amd64
fah_1     | 06:41:07:       Bits: 64
fah_1     | 06:41:07:       Mode: Release
fah_1     | 06:41:07:****************************** FAHClient ******************************
fah_1     | 06:41:07:    Version: 7.6.21
fah_1     | 06:41:07:     Author: Joseph Coffland <[email protected]>
fah_1     | 06:41:07:  Copyright: 2020 foldingathome.org
fah_1     | 06:41:07:   Homepage: https://foldingathome.org/
fah_1     | 06:41:07:       Date: Oct 20 2020
fah_1     | 06:41:07:       Time: 20:39:00
fah_1     | 06:41:07:   Revision: 6efbf0e138e22d3963e6a291f78dcb9c6422a278
fah_1     | 06:41:07:     Branch: master
fah_1     | 06:41:07:   Compiler: GNU 8.3.0
fah_1     | 06:41:07:    Options: -faligned-new -std=c++11 -fsigned-char -ffunction-sections
fah_1     | 06:41:07:             -fdata-sections -O3 -funroll-loops -fno-pie
fah_1     | 06:41:07:   Platform: linux2 5.8.0-1-amd64
fah_1     | 06:41:07:       Bits: 64
fah_1     | 06:41:07:       Mode: Release
fah_1     | 06:41:07:       Args: --web-allow=0/0:7396 --allow=0/0:7396
fah_1     | 06:41:07:     Config: /var/lib/fahclient/config.xml
fah_1     | 06:41:07:******************************** CBang ********************************
fah_1     | 06:41:07:       Date: Oct 20 2020
fah_1     | 06:41:07:       Time: 18:37:59
fah_1     | 06:41:07:   Revision: 7e4ce85225d7eaeb775e87c31740181ca603de60
fah_1     | 06:41:07:     Branch: master
fah_1     | 06:41:07:   Compiler: GNU 8.3.0
fah_1     | 06:41:07:    Options: -faligned-new -std=c++11 -fsigned-char -ffunction-sections
fah_1     | 06:41:07:             -fdata-sections -O3 -funroll-loops -fno-pie -fPIC
fah_1     | 06:41:07:   Platform: linux2 5.8.0-1-amd64
fah_1     | 06:41:07:       Bits: 64
fah_1     | 06:41:07:       Mode: Release
fah_1     | 06:41:07:******************************* System ********************************
fah_1     | 06:41:07:        CPU: Intel Xeon Processor (Skylake, IBRS)
fah_1     | 06:41:07:     CPU ID: GenuineIntel Family 6 Model 85 Stepping 4
fah_1     | 06:41:07:       CPUs: 2
fah_1     | 06:41:07:     Memory: 3.75GiB
fah_1     | 06:41:07:Free Memory: 205.59MiB
fah_1     | 06:41:07:    Threads: POSIX_THREADS
fah_1     | 06:41:07: OS Version: 5.9
fah_1     | 06:41:07:Has Battery: false
fah_1     | 06:41:07: On Battery: false
fah_1     | 06:41:07: UTC Offset: 0
fah_1     | 06:41:07:        PID: 1
fah_1     | 06:41:07:        CWD: /var/lib/fahclient
fah_1     | 06:41:07:         OS: Linux 5.9.0-0.bpo.5-amd64 x86_64
fah_1     | 06:41:07:    OS Arch: AMD64
fah_1     | 06:41:07:       GPUs: 0
fah_1     | 06:41:07:       CUDA: Not detected: Failed to open dynamic library 'libcuda.so':
fah_1     | 06:41:07:             libcuda.so: cannot open shared object file: No such file or
fah_1     | 06:41:07:             directory
fah_1     | 06:41:07:     OpenCL: Not detected: Failed to open dynamic library 'libOpenCL.so':
fah_1     | 06:41:07:             libOpenCL.so: cannot open shared object file: No such file or
fah_1     | 06:41:07:             directory
fah_1     | 06:41:07:***********************************************************************
fah_1     | 06:41:07:<config>
fah_1     | 06:41:07:  <!-- Folding Slot Configuration -->
fah_1     | 06:41:07:  <gpu v='false'/>
fah_1     | 06:41:07:
fah_1     | 06:41:07:  <!-- HTTP Server -->
fah_1     | 06:41:07:  <allow v='127.0.0.1 proxy'/>
fah_1     | 06:41:07:
fah_1     | 06:41:07:  <!-- User Information -->
fah_1     | 06:41:07:  <passkey v='*****'/>
fah_1     | 06:41:07:  <team v='myteam'/>
fah_1     | 06:41:07:  <user v='myname'/>
fah_1     | 06:41:07:
fah_1     | 06:41:07:  <!-- Web Server -->
fah_1     | 06:41:07:  <web-allow v='127.0.0.1 proxy'/>
fah_1     | 06:41:07:
fah_1     | 06:41:07:  <!-- Folding Slots -->
fah_1     | 06:41:07:  <slot id='0' type='CPU'/>
fah_1     | 06:41:07:</config>
fah_1     | 06:41:07:Trying to access database...
fah_1     | 06:41:07:Successfully acquired database lock
fah_1     | 06:41:07:FS00:Initialized folding slot 00: cpu:1
fah_1     | 06:41:07:WU01:FS00:Starting
fah_1     | 06:41:07:WU01:FS00:Running FahCore: /usr/bin/FAHCoreWrapper /var/lib/fahclient/cores/cores.foldingathome.org/lin/64bit-avx2-256/a8-0.0.12/Core_a8.fah/FahCore_a8 -dir 01 -suffix 01 -version 706 -lifeline 1 -checkpoint 15 -np 1
fah_1     | 06:41:07:WU01:FS00:Started FahCore on PID 16
fah_1     | 06:41:07:WU01:FS00:Core PID:20
fah_1     | 06:41:07:WU01:FS00:FahCore 0xa8 started
fah_1     | 06:41:07:WU01:FS00:0xa8:*********************** Log Started 2021-03-26T06:41:07Z ***********************
fah_1     | 06:41:07:WU01:FS00:0xa8:************************** Gromacs Folding@home Core ***************************
fah_1     | 06:41:07:WU01:FS00:0xa8:       Core: Gromacs
fah_1     | 06:41:07:WU01:FS00:0xa8:       Type: 0xa8
fah_1     | 06:41:07:WU01:FS00:0xa8:    Version: 0.0.12
fah_1     | 06:41:07:WU01:FS00:0xa8:     Author: Joseph Coffland <[email protected]>
fah_1     | 06:41:07:WU01:FS00:0xa8:  Copyright: 2020 foldingathome.org
fah_1     | 06:41:07:WU01:FS00:0xa8:   Homepage: https://foldingathome.org/
fah_1     | 06:41:07:WU01:FS00:0xa8:       Date: Jan 16 2021
fah_1     | 06:41:07:WU01:FS00:0xa8:       Time: 19:24:44
fah_1     | 06:41:07:WU01:FS00:0xa8:   Compiler: GNU 8.3.0
fah_1     | 06:41:07:WU01:FS00:0xa8:    Options: -faligned-new -std=c++14 -fsigned-char -ffunction-sections
fah_1     | 06:41:07:WU01:FS00:0xa8:             -fdata-sections -O3 -funroll-loops -fno-pie
fah_1     | 06:41:07:WU01:FS00:0xa8:   Platform: linux2 4.15.0-128-generic
fah_1     | 06:41:07:WU01:FS00:0xa8:       Bits: 64
fah_1     | 06:41:07:WU01:FS00:0xa8:       Mode: Release
fah_1     | 06:41:07:WU01:FS00:0xa8:       SIMD: avx2_256
fah_1     | 06:41:07:WU01:FS00:0xa8:     OpenMP: ON
fah_1     | 06:41:07:WU01:FS00:0xa8:       CUDA: OFF
fah_1     | 06:41:07:WU01:FS00:0xa8:       Args: -dir 01 -suffix 01 -version 706 -lifeline 16 -checkpoint 15 -np 1
fah_1     | 06:41:07:WU01:FS00:0xa8:************************************ libFAH ************************************
fah_1     | 06:41:07:WU01:FS00:0xa8:       Date: Jan 16 2021
fah_1     | 06:41:07:WU01:FS00:0xa8:       Time: 19:21:38
fah_1     | 06:41:07:WU01:FS00:0xa8:   Compiler: GNU 8.3.0
fah_1     | 06:41:07:WU01:FS00:0xa8:    Options: -faligned-new -std=c++14 -fsigned-char -ffunction-sections
fah_1     | 06:41:07:WU01:FS00:0xa8:             -fdata-sections -O3 -funroll-loops -fno-pie
fah_1     | 06:41:07:WU01:FS00:0xa8:   Platform: linux2 4.15.0-128-generic
fah_1     | 06:41:07:WU01:FS00:0xa8:       Bits: 64
fah_1     | 06:41:07:WU01:FS00:0xa8:       Mode: Release
fah_1     | 06:41:07:WU01:FS00:0xa8:************************************ CBang *************************************
fah_1     | 06:41:07:WU01:FS00:0xa8:       Date: Jan 16 2021
fah_1     | 06:41:07:WU01:FS00:0xa8:       Time: 19:21:24
fah_1     | 06:41:07:WU01:FS00:0xa8:   Compiler: GNU 8.3.0
fah_1     | 06:41:07:WU01:FS00:0xa8:    Options: -faligned-new -std=c++14 -fsigned-char -ffunction-sections
fah_1     | 06:41:07:WU01:FS00:0xa8:             -fdata-sections -O3 -funroll-loops -fno-pie -fPIC
fah_1     | 06:41:07:WU01:FS00:0xa8:   Platform: linux2 4.15.0-128-generic
fah_1     | 06:41:07:WU01:FS00:0xa8:       Bits: 64
fah_1     | 06:41:07:WU01:FS00:0xa8:       Mode: Release
fah_1     | 06:41:07:WU01:FS00:0xa8:************************************ System ************************************
fah_1     | 06:41:07:WU01:FS00:0xa8:        CPU: Intel Xeon Processor (Skylake, IBRS)
fah_1     | 06:41:07:WU01:FS00:0xa8:     CPU ID: GenuineIntel Family 6 Model 85 Stepping 4
fah_1     | 06:41:07:WU01:FS00:0xa8:       CPUs: 2
fah_1     | 06:41:07:WU01:FS00:0xa8:     Memory: 3.75GiB
fah_1     | 06:41:07:WU01:FS00:0xa8:Free Memory: 201.11MiB
fah_1     | 06:41:07:WU01:FS00:0xa8:    Threads: POSIX_THREADS
fah_1     | 06:41:07:WU01:FS00:0xa8: OS Version: 5.9
fah_1     | 06:41:07:WU01:FS00:0xa8:Has Battery: false
fah_1     | 06:41:07:WU01:FS00:0xa8: On Battery: false
fah_1     | 06:41:07:WU01:FS00:0xa8: UTC Offset: 0
fah_1     | 06:41:07:WU01:FS00:0xa8:        PID: 20
fah_1     | 06:41:07:WU01:FS00:0xa8:        CWD: /var/lib/fahclient/work
fah_1     | 06:41:07:WU01:FS00:0xa8:********************************************************************************
fah_1     | 06:41:07:WU01:FS00:0xa8:Project: 16935 (Run 5, Clone 318, Gen 36)
fah_1     | 06:41:07:WU01:FS00:0xa8:Unit: 0x00000000000000000000000000000000
fah_1     | 06:41:07:WU01:FS00:0xa8:Digital signatures verified
fah_1     | 06:41:07:WU01:FS00:0xa8:Calling: mdrun -c frame36.gro -s frame36.tpr -x frame36.xtc -cpi state.cpt -cpt 15 -nt 1 -ntmpi 1
fah_1     | 06:41:07:WU01:FS00:0xa8:Steps: first=0 total=5000000
fah_1     | 06:41:07:WU01:FS00:0xa8:Completed 2602 out of 5000000 steps (0%)
fah_1     | 06:41:10:18:172.18.0.4:New Web session

Maybe this can help?
Post Reply