diff --git a/.github/workflows/external_trigger.yml b/.github/workflows/external_trigger.yml index 50fb295..d0150a1 100755 --- a/.github/workflows/external_trigger.yml +++ b/.github/workflows/external_trigger.yml @@ -36,10 +36,15 @@ jobs: token=$(curl -sX GET \ "https://ghcr.io/token?scope=repository%3Alinuxserver%2Ffoldingathome%3Apull" \ | jq -r '.token') - digest=$(curl -s \ + multidigest=$(curl -s \ --header "Accept: application/vnd.docker.distribution.manifest.v2+json" \ --header "Authorization: Bearer ${token}" \ "https://ghcr.io/v2/${image}/manifests/${tag}" \ + | jq -r 'first(.manifests[].digest)') + digest=$(curl -s \ + --header "Accept: application/vnd.docker.distribution.manifest.v2+json" \ + --header "Authorization: Bearer ${token}" \ + "https://ghcr.io/v2/${image}/manifests/${multidigest}" \ | jq -r '.config.digest') image_info=$(curl -sL \ --header "Authorization: Bearer ${token}" \ diff --git a/Dockerfile b/Dockerfile index 8303a3e..ff740ad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/linuxserver/baseimage-ubuntu:bionic +FROM ghcr.io/linuxserver/baseimage-ubuntu:focal # set version label ARG BUILD_DATE @@ -22,7 +22,7 @@ RUN \ ocl-icd-libopencl1 && \ ln -s libOpenCL.so.1 /usr/lib/x86_64-linux-gnu/libOpenCL.so && \ echo "**** install foldingathome ****" && \ - download_url=$(curl -sL https://download.foldingathome.org/releases.py?series=${MAJOR_VERSION} | jq -r '.[] | select(.title=="64bit Linux") | .groups[0].files[0].url') && \ + download_url=$(curl -sL https://download.foldingathome.org/releases.py?series=${MAJOR_VERSION} | jq -r '.[] | select(.title=="64bit Linux") | .groups[].files[].url' | grep "fahclient" | grep "deb" | grep "amd64") && \ curl -o \ /tmp/fah.deb -L \ ${download_url} && \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 new file mode 100644 index 0000000..780d6ba --- /dev/null +++ b/Dockerfile.aarch64 @@ -0,0 +1,42 @@ +FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-focal + +# set version label +ARG BUILD_DATE +ARG VERSION +ARG FOLDINGATHOME_RELEASE +LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" +LABEL maintainer="aptalca" + +#Add needed nvidia environment variables for https://github.com/NVIDIA/nvidia-docker +ENV NVIDIA_DRIVER_CAPABILITIES="compute,video,utility" + +# global environment settings +ENV DEBIAN_FRONTEND="noninteractive" \ + MAJOR_VERSION=7.6 + +RUN \ + echo "**** install runtime packages ****" && \ + apt-get update && \ + apt-get install -y \ + jq \ + ocl-icd-libopencl1 && \ + ln -s libOpenCL.so.1 /usr/lib/aarch64-linux-gnu/libOpenCL.so && \ + echo "**** install foldingathome ****" && \ + download_url=$(curl -sL https://download.foldingathome.org/releases.py?series=${MAJOR_VERSION} | jq -r '.[] | select(.title=="64bit Linux") | .groups[].files[].url' | grep "fahclient" | grep "deb" | grep "arm64") && \ + curl -o \ + /tmp/fah.deb -L \ + ${download_url} && \ + dpkg -x /tmp/fah.deb /app && \ + echo "**** cleanup ****" && \ + apt-get clean && \ + rm -rf \ + /tmp/* \ + /var/lib/apt/lists/* \ + /var/tmp/* + +# add local files +COPY root/ / + +# ports and volumes +EXPOSE 7396 +VOLUME /config diff --git a/Dockerfile.armhf b/Dockerfile.armhf new file mode 100644 index 0000000..6fbbfdd --- /dev/null +++ b/Dockerfile.armhf @@ -0,0 +1,13 @@ +FROM ghcr.io/linuxserver/baseimage-ubuntu:focal + +# set version label +ARG BUILD_DATE +ARG VERSION +ARG FOLDINGATHOME_RELEASE +LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" +LABEL maintainer="aptalca" + +# add local files +COPY root/ / + +# This FoldingAtHome image does not support 32 bit ARM due to lack of 32 bit binaries diff --git a/Jenkinsfile b/Jenkinsfile index 7321977..b7b16da 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,7 +25,7 @@ pipeline { DEV_DOCKERHUB_IMAGE = 'lsiodev/foldingathome' PR_DOCKERHUB_IMAGE = 'lspipepr/foldingathome' DIST_IMAGE = 'ubuntu' - MULTIARCH='false' + MULTIARCH='true' CI='true' CI_WEB='true' CI_PORT='7396' diff --git a/README.md b/README.md index 14ad5ca..574fe7c 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Find us at: ## Supported Architectures -We utilise the docker manifest for multi-platform awareness. More information is available from docker [here](https://github.com/docker/distribution/blob/master/docs/spec/manifest-v2-2.md#manifest-list) and our announcement [here](https://blog.linuxserver.io/2019/02/21/the-lsio-pipeline-project/). +Our images support multiple architectures such as `x86-64`, `arm64` and `armhf`. We utilise the docker manifest for multi-platform awareness. More information is available from docker [here](https://github.com/docker/distribution/blob/master/docs/spec/manifest-v2-2.md#manifest-list) and our announcement [here](https://blog.linuxserver.io/2019/02/21/the-lsio-pipeline-project/). Simply pulling `lscr.io/linuxserver/foldingathome` should retrieve the correct image for your arch, but you can also pull specific arch images via tags. @@ -55,6 +55,7 @@ The architectures supported by this image are: | Architecture | Tag | | :----: | --- | | x86-64 | latest | +| arm64 | arm64v8-latest | ## Application Setup @@ -236,6 +237,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **15.01.22:** - Rebase to Ubuntu Focal. Add arm64v8 builds (cpu only). Increase verbosity about gpu driver permission settings. * **09.01.21:** - Add nvidia.icd. * **14.04.20:** - Add Folding@home donation links. * **20.03.20:** - Initial release. diff --git a/jenkins-vars.yml b/jenkins-vars.yml index f98deea..9302a2d 100644 --- a/jenkins-vars.yml +++ b/jenkins-vars.yml @@ -16,7 +16,7 @@ repo_vars: - DEV_DOCKERHUB_IMAGE = 'lsiodev/foldingathome' - PR_DOCKERHUB_IMAGE = 'lspipepr/foldingathome' - DIST_IMAGE = 'ubuntu' - - MULTIARCH='false' + - MULTIARCH='true' - CI='true' - CI_WEB='true' - CI_PORT='7396' diff --git a/readme-vars.yml b/readme-vars.yml index f227409..762f8eb 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -11,6 +11,7 @@ project_blurb_optional_extras_enabled: false # supported architectures available_architectures: - { arch: "{{ arch_x86_64 }}", tag: "latest"} + - { arch: "{{ arch_arm64 }}", tag: "arm64v8-latest"} # development version development_versions: false @@ -66,6 +67,7 @@ app_setup_block: | # changelog changelogs: + - { date: "15.01.22:", desc: "Rebase to Ubuntu Focal. Add arm64v8 builds (cpu only). Increase verbosity about gpu driver permission settings." } - { date: "09.01.21:", desc: "Add nvidia.icd." } - { date: "14.04.20:", desc: "Add Folding@home donation links." } - { date: "20.03.20:", desc: "Initial release." } diff --git a/root/etc/cont-init.d/19-armless b/root/etc/cont-init.d/19-armless new file mode 100644 index 0000000..8b4152b --- /dev/null +++ b/root/etc/cont-init.d/19-armless @@ -0,0 +1,16 @@ +#!/usr/bin/with-contenv bash + +if [[ "$(uname -m)" == "armv7l" ]]; then +cat <<-EOF + ******************************************************** + ******************************************************** + * * + * !!!! * + * This FoldingAtHome image does not support * + * 32 bit ARM due to lack of 32 bit binaries * + * * + * * + ******************************************************** + ******************************************************** +EOF +fi diff --git a/root/etc/cont-init.d/60-gid-video b/root/etc/cont-init.d/60-gid-video index 2c5fc9f..20545d0 100644 --- a/root/etc/cont-init.d/60-gid-video +++ b/root/etc/cont-init.d/60-gid-video @@ -13,5 +13,8 @@ do groupmod -g "$VIDEO_GID" "$VIDEO_NAME" fi usermod -a -G "$VIDEO_NAME" abc + if [ $(stat -c '%A' "${i}" | cut -b 5,6) != "rw" ]; then + echo -e "**** The device ${i} does not have group read/write permissions, which might prevent hardware transcode from functioning correctly. To fix it, you can run the following on your docker host: ****\nsudo chmod g+rw ${i}\n" + fi fi -done \ No newline at end of file +done diff --git a/root/etc/services.d/foldingathome/run b/root/etc/services.d/foldingathome/run index e8966a1..153ab98 100644 --- a/root/etc/services.d/foldingathome/run +++ b/root/etc/services.d/foldingathome/run @@ -1,5 +1,9 @@ #!/usr/bin/with-contenv bash +if [[ "$(uname -m)" == "armv7l" ]]; then + sleep infinity +fi + cd /config exec \