Skip to content

Commit fd36339

Browse files
committed
Restructure for v8
1 parent 0aceb13 commit fd36339

9 files changed

Lines changed: 80 additions & 52 deletions

File tree

.github/workflows/external_trigger.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
echo "**** External trigger running off of master branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_FOLDINGATHOME_MASTER\". ****"
2121
echo "External trigger running off of master branch. To disable this trigger, set a Github secret named \`PAUSE_EXTERNAL_TRIGGER_FOLDINGATHOME_MASTER\`" >> $GITHUB_STEP_SUMMARY
2222
echo "**** Retrieving external version ****"
23-
EXT_RELEASE=$(curl -H 'Accept-Encoding: gzip' -fSsL --compressed https://download.foldingathome.org/releases.py?series=7.6 | jq -r '.[] | select(.title=="64bit Linux") | .groups[0].files[0].filename' | awk -F'(fahclient_|_amd64.deb)' '{print $2}')
23+
EXT_RELEASE=$(curl -H 'Accept-Encoding: gzip' -fSsL --compressed https://download.foldingathome.org/releases.py | jq -r '.[] | select(.title=="64bit Linux") | .groups[0].files[0].filename' | awk -F'(fah-client_|_amd64.deb)' '{print $2}')
2424
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
2525
echo "**** Can't retrieve external version, exiting ****"
2626
FAILURE_REASON="Can't retrieve external version for foldingathome branch master"

Dockerfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,20 @@ LABEL maintainer="aptalca"
1313
ENV NVIDIA_DRIVER_CAPABILITIES="compute,video,utility"
1414

1515
# global environment settings
16-
ENV DEBIAN_FRONTEND="noninteractive" \
17-
MAJOR_VERSION=7.6
16+
ENV DEBIAN_FRONTEND="noninteractive"
1817

1918
RUN \
2019
echo "**** install runtime packages ****" && \
2120
apt-get update && \
2221
apt-get install -y \
23-
ocl-icd-libopencl1 && \
22+
intel-opencl-icd && \
2423
ln -s libOpenCL.so.1 /usr/lib/x86_64-linux-gnu/libOpenCL.so && \
2524
echo "**** install foldingathome ****" && \
26-
download_url=$(curl -H 'Accept-Encoding: gzip' -fSsL --compressed https://download.foldingathome.org/releases.py?series=${MAJOR_VERSION} | jq -r '.[] | select(.title=="64bit Linux") | .groups[].files[].url' | grep "fahclient" | grep "deb" | grep "amd64") && \
25+
download_url=$(curl -H 'Accept-Encoding: gzip' -fSsL --compressed https://download.foldingathome.org/releases.py | jq -r '.[] | select(.title=="64bit Linux") | .groups[].files[].url' | grep "fah-client" | grep "amd64.deb") && \
2726
curl -o \
2827
/tmp/fah.deb -L \
2928
${download_url} && \
30-
dpkg -x /tmp/fah.deb /app && \
29+
dpkg -x /tmp/fah.deb / && \
3130
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
3231
echo "**** cleanup ****" && \
3332
apt-get clean && \

Dockerfile.aarch64

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ LABEL maintainer="aptalca"
1313
ENV NVIDIA_DRIVER_CAPABILITIES="compute,video,utility"
1414

1515
# global environment settings
16-
ENV DEBIAN_FRONTEND="noninteractive" \
17-
MAJOR_VERSION=7.6
16+
ENV DEBIAN_FRONTEND="noninteractive"
1817

1918
RUN \
2019
echo "**** install runtime packages ****" && \
@@ -23,11 +22,11 @@ RUN \
2322
ocl-icd-libopencl1 && \
2423
ln -s libOpenCL.so.1 /usr/lib/aarch64-linux-gnu/libOpenCL.so && \
2524
echo "**** install foldingathome ****" && \
26-
download_url=$(curl -H 'Accept-Encoding: gzip' -fSsL --compressed https://download.foldingathome.org/releases.py?series=${MAJOR_VERSION} | jq -r '.[] | select(.title=="64bit Linux") | .groups[].files[].url' | grep "fahclient" | grep "deb" | grep "arm64") && \
25+
download_url=$(curl -H 'Accept-Encoding: gzip' -fSsL --compressed https://download.foldingathome.org/releases.py | jq -r '.[] | select(.title=="64bit Linux") | .groups[].files[].url' | grep "fah-client" | grep "arm64.deb") && \
2726
curl -o \
2827
/tmp/fah.deb -L \
2928
${download_url} && \
30-
dpkg -x /tmp/fah.deb /app && \
29+
dpkg -x /tmp/fah.deb / && \
3130
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
3231
echo "**** cleanup ****" && \
3332
apt-get clean && \

Jenkinsfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ pipeline {
3131
CI_PORT='7396'
3232
CI_SSL='false'
3333
CI_DELAY='120'
34-
CI_DOCKERENV='TZ=US/Pacific'
35-
CI_AUTH='user:password'
34+
CI_DOCKERENV=''
35+
CI_AUTH=''
3636
CI_WEBPATH=''
3737
}
3838
stages {
@@ -115,7 +115,7 @@ pipeline {
115115
steps{
116116
script{
117117
env.EXT_RELEASE = sh(
118-
script: ''' curl -H 'Accept-Encoding: gzip' -fSsL --compressed https://download.foldingathome.org/releases.py?series=7.6 | jq -r '.[] | select(.title=="64bit Linux") | .groups[0].files[0].filename' | awk -F'(fahclient_|_amd64.deb)' '{print $2}' ''',
118+
script: ''' curl -H 'Accept-Encoding: gzip' -fSsL --compressed https://download.foldingathome.org/releases.py | jq -r '.[] | select(.title=="64bit Linux") | .groups[0].files[0].filename' | awk -F'(fah-client_|_amd64.deb)' '{print $2}' ''',
119119
returnStdout: true).trim()
120120
env.RELEASE_LINK = 'custom_command'
121121
}

README.md

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,19 @@ The architectures supported by this image are:
5959

6060
## Application Setup
6161

62-
This image sets up the Folding@home client. The interface is available at `http://your-ip:7396`.
62+
This image sets up the Folding@home client. The interface is available at [https://app.foldingathome.org](https://app.foldingathome.org).
6363

64-
The built-in webserver provides very basic control (ie. GPUs are only active when set to `Medium` or higher). For more fine grained control of individual devices, you can use the FAHControl app on a different device and connect remotely via port `36330` (no password).
64+
Before setting up this container, please register for an account on [https://app.foldingathome.org](https://app.foldingathome.org) and retrieve the account token shown in the account settings. That value should be populated in the `ACCOUNT_TOKEN` env var.
6565

66-
There are a couple of minor issues with the webgui:
67-
- If you get an "ERR_EMPTY_RESPONSE" error when trying to access via IP, it's most likely due to a clash of cookies/cache. Try opening in an incgnito window.
68-
- If you're getting a constant refresh of the window but no display of info, try a force refresh via `shft-F5` or `ctrl-F5`.
66+
Once the container is created with the token and the machine name, the instance should be listed in the web app and can be controlled there.
67+
68+
Afterwards, the `ACCOUNT_TOKEN` and the `MACHINE_NAME` vars can be removed as the instance will already be associated with the online account and the info stored in the config folder.
69+
70+
## Migration from version 7.6
71+
72+
Version 8 of fah-client has been rewritten and has some breaking changes that we can't automatically mitigate in this container.
73+
74+
Unlike v7, v8 no longer bundles a local webgui. The web app is loaded from an online source and can only auto-detect instances that are running on the same machine (bare metal) as the browser. This is not possible in a docker container. Therefore, upgrading to v8 requires registering for an online account, retrieving the account token and setting it in the new env var `ACCOUNT_TOKEN`, along with a friendly name in `MACHINE_NAME`.
6975

7076
## GPU Hardware Acceleration
7177

@@ -91,12 +97,13 @@ services:
9197
- PUID=1000
9298
- PGID=1000
9399
- TZ=Etc/UTC
100+
- ACCOUNT_TOKEN=
101+
- MACHINE_NAME=
94102
- CLI_ARGS= #optional
95103
volumes:
96-
- /path/to/data:/config
104+
- /path/to/foldingathome/data:/config
97105
ports:
98-
- 7396:7396
99-
- 36330:36330 #optional
106+
- 7396:7396 #optional
100107
restart: unless-stopped
101108
```
102109
@@ -108,10 +115,11 @@ docker run -d \
108115
-e PUID=1000 \
109116
-e PGID=1000 \
110117
-e TZ=Etc/UTC \
118+
-e ACCOUNT_TOKEN= \
119+
-e MACHINE_NAME= \
111120
-e CLI_ARGS= `#optional` \
112-
-p 7396:7396 \
113-
-p 36330:36330 `#optional` \
114-
-v /path/to/data:/config \
121+
-p 7396:7396 `#optional` \
122+
-v /path/to/foldingathome/data:/config \
115123
--restart unless-stopped \
116124
lscr.io/linuxserver/foldingathome:latest
117125
```
@@ -122,12 +130,13 @@ Containers are configured using parameters passed at runtime (such as those abov
122130

123131
| Parameter | Function |
124132
| :----: | --- |
125-
| `-p 7396` | Folding@home web gui. |
126-
| `-p 36330` | Optional port for connecting remotely via FAHControl app (no password). |
133+
| `-p 7396` | Folding@home web gui (redirects to [https://app.foldingathome.org](https://app.foldingathome.org)). |
127134
| `-e PUID=1000` | for UserID - see below for explanation |
128135
| `-e PGID=1000` | for GroupID - see below for explanation |
129136
| `-e TZ=Etc/UTC` | specify a timezone to use, see this [list](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List). |
130-
| `-e CLI_ARGS=` | Optionally pass additional cli arguments to `FAHClient` on container start. |
137+
| `-e ACCOUNT_TOKEN=` | Register for an account on `https://app.foldingathome.org` and retrieve account token in settings. Required on first start. |
138+
| `-e MACHINE_NAME=` | Assign a friendly name to this instance (no spaces). Required on first start. |
139+
| `-e CLI_ARGS=` | Optionally pass additional cli arguments to `fah-client` on container start. |
131140
| `-v /config` | Where Folding@home should store its database and config. |
132141

133142
## Environment variables from files (Docker secrets)
@@ -291,6 +300,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
291300

292301
## Versions
293302

303+
* **25.06.24:** - ***Breaking Changes*** - Please see the Application Setup section for more details. Restructure image for F@H v8.
294304
* **15.06.24:** - Rebase to Ubuntu Noble, add optional cli args.
295305
* **14.12.22:** - Rebase to Ubuntu Jammy, migrate to s6v3.
296306
* **15.01.22:** - Rebase to Ubuntu Focal. Add arm64v8 builds (cpu only). Increase verbosity about gpu driver permission settings.

jenkins-vars.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# jenkins variables
44
project_name: docker-foldingathome
55
external_type: na
6-
custom_version_command: "curl -H 'Accept-Encoding: gzip' -fSsL --compressed https://download.foldingathome.org/releases.py?series=7.6 | jq -r '.[] | select(.title==\"64bit Linux\") | .groups[0].files[0].filename' | awk -F'(fahclient_|_amd64.deb)' '{print $2}'"
6+
custom_version_command: "curl -H 'Accept-Encoding: gzip' -fSsL --compressed https://download.foldingathome.org/releases.py | jq -r '.[] | select(.title==\"64bit Linux\") | .groups[0].files[0].filename' | awk -F'(fah-client_|_amd64.deb)' '{print $2}'"
77
release_type: stable
88
release_tag: latest
99
ls_branch: master
@@ -23,8 +23,8 @@ repo_vars:
2323
- CI_PORT='7396'
2424
- CI_SSL='false'
2525
- CI_DELAY='120'
26-
- CI_DOCKERENV='TZ=US/Pacific'
27-
- CI_AUTH='user:password'
26+
- CI_DOCKERENV=''
27+
- CI_AUTH=''
2828
- CI_WEBPATH=''
2929
sponsor_links:
3030
- { name: "Folding@home", url: "https://foldingathome.org/about/donate/" }

readme-vars.yml

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,40 +19,41 @@ development_versions: false
1919
# container parameters
2020
common_param_env_vars_enabled: true
2121
param_container_name: "{{ project_name }}"
22-
param_usage_include_net: false
2322
param_usage_include_env: true
23+
param_env_vars:
24+
- { env_var: "ACCOUNT_TOKEN", env_value: "", desc: "Register for an account on `https://app.foldingathome.org` and retrieve account token in settings. Required on first start." }
25+
- { env_var: "MACHINE_NAME", env_value: "", desc: "Assign a friendly name to this instance (no spaces). Required on first start." }
2426
param_usage_include_vols: true
2527
param_volumes:
26-
- { vol_path: "/config", vol_host_path: "/path/to/data", desc: "Where Folding@home should store its database and config." }
27-
param_usage_include_ports: true
28-
param_ports:
29-
- { external_port: "7396", internal_port: "7396", port_desc: "Folding@home web gui." }
30-
param_device_map: false
31-
cap_add_param: false
32-
cap_add_param_vars: ''
28+
- { vol_path: "/config", vol_host_path: "/path/to/{{ project_name }}/data", desc: "Where Folding@home should store its database and config." }
3329

3430
# optional container parameters
3531
opt_param_usage_include_env: true
3632
opt_param_env_vars:
37-
- { env_var: "CLI_ARGS", env_value: "", desc: "Optionally pass additional cli arguments to `FAHClient` on container start." }
38-
opt_param_usage_include_vols: false
33+
- { env_var: "CLI_ARGS", env_value: "", desc: "Optionally pass additional cli arguments to `fah-client` on container start." }
3934
opt_param_usage_include_ports: true
4035
opt_param_ports:
41-
- { external_port: "36330", internal_port: "36330", port_desc: "Optional port for connecting remotely via FAHControl app (no password)." }
36+
- { external_port: "7396", internal_port: "7396", port_desc: "Folding@home web gui (redirects to [https://app.foldingathome.org](https://app.foldingathome.org))." }
4237
opt_param_device_map: false
4338
opt_param_devices:
4439
- { device_path: "/dev/dri", device_host_path: "/dev/dri", desc: "Only needed if you want to use your Intel GPU (vaapi)." }
4540

4641
# application setup block
4742
app_setup_block_enabled: true
4843
app_setup_block: |
49-
This image sets up the Folding@home client. The interface is available at `http://your-ip:7396`.
50-
51-
The built-in webserver provides very basic control (ie. GPUs are only active when set to `Medium` or higher). For more fine grained control of individual devices, you can use the FAHControl app on a different device and connect remotely via port `36330` (no password).
52-
53-
There are a couple of minor issues with the webgui:
54-
- If you get an "ERR_EMPTY_RESPONSE" error when trying to access via IP, it's most likely due to a clash of cookies/cache. Try opening in an incgnito window.
55-
- If you're getting a constant refresh of the window but no display of info, try a force refresh via `shft-F5` or `ctrl-F5`.
44+
This image sets up the Folding@home client. The interface is available at [https://app.foldingathome.org](https://app.foldingathome.org).
45+
46+
Before setting up this container, please register for an account on [https://app.foldingathome.org](https://app.foldingathome.org) and retrieve the account token shown in the account settings. That value should be populated in the `ACCOUNT_TOKEN` env var.
47+
48+
Once the container is created with the token and the machine name, the instance should be listed in the web app and can be controlled there.
49+
50+
Afterwards, the `ACCOUNT_TOKEN` and the `MACHINE_NAME` vars can be removed as the instance will already be associated with the online account and the info stored in the config folder.
51+
52+
## Migration from version 7.6
53+
54+
Version 8 of fah-client has been rewritten and has some breaking changes that we can't automatically mitigate in this container.
55+
56+
Unlike v7, v8 no longer bundles a local webgui. The web app is loaded from an online source and can only auto-detect instances that are running on the same machine (bare metal) as the browser. This is not possible in a docker container. Therefore, upgrading to v8 requires registering for an online account, retrieving the account token and setting it in the new env var `ACCOUNT_TOKEN`, along with a friendly name in `MACHINE_NAME`.
5657
5758
## GPU Hardware Acceleration
5859
@@ -64,6 +65,7 @@ app_setup_block: |
6465
6566
# changelog
6667
changelogs:
68+
- { date: "25.06.24:", desc: "***Breaking Changes*** - Please see the Application Setup section for more details. Restructure image for F@H v8." }
6769
- { date: "15.06.24:", desc: "Rebase to Ubuntu Noble, add optional cli args." }
6870
- { date: "14.12.22:", desc: "Rebase to Ubuntu Jammy, migrate to s6v3." }
6971
- { date: "15.01.22:", desc: "Rebase to Ubuntu Focal. Add arm64v8 builds (cpu only). Increase verbosity about gpu driver permission settings." }

root/etc/s6-overlay/s6-rc.d/init-foldingathome-config/run

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ mkdir -p /config
66

77
# permissions on config root and folders
88
lsiown -R abc:abc \
9-
/app \
109
/config
Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,27 @@
11
#!/usr/bin/with-contenv bash
22
# shellcheck shell=bash
33

4+
if [[ -n "${ACCOUNT_TOKEN}" ]] && [[ -n "${MACHINE_NAME}" ]]; then
5+
TOKEN_AND_NAME="--account-token ${ACCOUNT_TOKEN} --machine-name ${MACHINE_NAME}"
6+
else
7+
echo '
8+
***************************************************************************
9+
***************************************************************************
10+
**** ****
11+
**** ****
12+
**** On first run, both the ACCOUNT_TOKEN and the MACHINE_NAME ****
13+
**** env vars are required. Please set them and recreate the container ****
14+
**** unless the instance was previously added to online account. ****
15+
**** ****
16+
**** ****
17+
***************************************************************************
18+
***************************************************************************
19+
'
20+
fi
21+
22+
423
exec \
524
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 7396" \
6-
cd /config s6-setuidgid abc /app/usr/bin/FAHClient \
7-
--http-addresses 0.0.0.0:7396 --allow 0/0 --web-allow 0/0 --command-allow-no-pass 0/0 \
8-
$CLI_ARGS
25+
cd /config s6-setuidgid abc fah-client \
26+
--http-addresses 0.0.0.0:7396 --allow 0/0 ${TOKEN_AND_NAME} \
27+
${CLI_ARGS}

0 commit comments

Comments
 (0)