Skip to content

Commit a63211d

Browse files
authored
Merge pull request #231 from linuxserver/master-pypi
2 parents 2439eee + fbb76a7 commit a63211d

9 files changed

Lines changed: 65 additions & 51 deletions

File tree

.github/workflows/external_trigger.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ jobs:
2929
echo "> [!NOTE]" >> $GITHUB_STEP_SUMMARY
3030
echo "> External trigger running off of master branch. To disable this trigger, add \`deluge_master\` into the Github organizational variable \`SKIP_EXTERNAL_TRIGGER\`." >> $GITHUB_STEP_SUMMARY
3131
printf "\n## Retrieving external version\n\n" >> $GITHUB_STEP_SUMMARY
32-
EXT_RELEASE=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
33-
&& awk '/^P:'"deluge"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://')
34-
echo "Type is \`alpine_repo\`" >> $GITHUB_STEP_SUMMARY
32+
EXT_RELEASE=$(curl -sL "https://pypi.python.org/pypi/deluge/json" |jq -r '. | .info.version')
33+
echo "Type is \`pip_version\`" >> $GITHUB_STEP_SUMMARY
3534
if grep -q "^deluge_master_${EXT_RELEASE}" <<< "${SKIP_EXTERNAL_TRIGGER}"; then
3635
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
3736
echo "> Github organizational variable \`SKIP_EXTERNAL_TRIGGER\` matches current external release; skipping trigger." >> $GITHUB_STEP_SUMMARY
@@ -107,13 +106,6 @@ jobs:
107106
if [ "${EXT_RELEASE_SANITIZED}" == "${IMAGE_VERSION}" ]; then
108107
echo "Sanitized version \`${EXT_RELEASE_SANITIZED}\` already pushed, exiting" >> $GITHUB_STEP_SUMMARY
109108
exit 0
110-
elif [[ $(curl -sL "http://dl-cdn.alpinelinux.org/alpine/edge/community/aarch64/APKINDEX.tar.gz" | tar -xz -C /tmp && awk '/^P:'"deluge"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://') != "${EXT_RELEASE}" ]]; then
111-
echo "New version \`${EXT_RELEASE}\` found; but not all arch repos updated yet; exiting" >> $GITHUB_STEP_SUMMARY
112-
FAILURE_REASON="New version ${EXT_RELEASE} for deluge tag latest is detected, however not all arch repos are updated yet. Will try again later."
113-
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
114-
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}],
115-
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
116-
exit 0
117109
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-deluge/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then
118110
echo "New version \`${EXT_RELEASE}\` found; but there already seems to be an active build on Jenkins; exiting" >> $GITHUB_STEP_SUMMARY
119111
exit 0

Dockerfile

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
FROM ghcr.io/linuxserver/unrar:latest AS unrar
44

5-
FROM ghcr.io/linuxserver/baseimage-alpine:edge
5+
FROM ghcr.io/by275/libtorrent:2-alpine3.23 AS libtorrent
6+
7+
FROM ghcr.io/linuxserver/baseimage-alpine:3.23
68

79
# set version label
810
ARG BUILD_DATE
@@ -19,19 +21,26 @@ ENV PYTHON_EGG_CACHE="/config/plugins/.python-eggs" \
1921
RUN \
2022
echo "**** install build packages ****" && \
2123
apk add --no-cache --upgrade --virtual=build-dependencies \
22-
build-base && \
24+
build-base \
25+
python3-dev && \
2326
echo "**** install packages ****" && \
24-
if [ -z ${DELUGE_VERSION+x} ]; then \
25-
DELUGE_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
26-
&& awk '/^P:deluge$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \
27-
fi && \
28-
apk add --no-cache --upgrade --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
29-
deluge==${DELUGE_VERSION} \
27+
apk add --no-cache --upgrade \
28+
boost1.84-python3 \
29+
geoip \
3030
python3 \
31-
py3-future \
32-
py3-geoip \
33-
py3-requests \
3431
p7zip && \
32+
if [ -z ${DELUGE_VERSION+x} ]; then \
33+
DELUGE_VERSION=$(curl -sL https://pypi.python.org/pypi/deluge/json |jq -r '. | .info.version');\
34+
fi && \
35+
python3 -m venv /lsiopy && \
36+
pip install -U --no-cache-dir \
37+
pip \
38+
'setuptools==81' && \
39+
pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.23/ \
40+
rencode==1.0.6 && \
41+
pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.23/ \
42+
deluge[all]==${DELUGE_VERSION} \
43+
pygeoip && \
3544
echo "**** grab GeoIP database ****" && \
3645
curl -L --retry 10 --retry-max-time 60 --retry-all-errors \
3746
"https://geoip.linuxserver.io/GeoIP.dat.gz" \
@@ -44,6 +53,10 @@ RUN \
4453
$HOME/.cache \
4554
/tmp/*
4655

56+
COPY --from=libtorrent /libtorrent-build/usr/lib/libtorrent-rasterbar.* /usr/lib/
57+
58+
COPY --from=libtorrent /libtorrent-build/usr/lib/python3.12 /lsiopy/lib/python3.12
59+
4760
# add local files
4861
COPY root/ /
4962

Dockerfile.aarch64

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
FROM ghcr.io/linuxserver/unrar:arm64v8-latest AS unrar
44

5-
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-edge
5+
FROM ghcr.io/by275/libtorrent:2-alpine3.23-arm64 AS libtorrent
6+
7+
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.23
68

79
# set version label
810
ARG BUILD_DATE
@@ -19,19 +21,26 @@ ENV PYTHON_EGG_CACHE="/config/plugins/.python-eggs" \
1921
RUN \
2022
echo "**** install build packages ****" && \
2123
apk add --no-cache --upgrade --virtual=build-dependencies \
22-
build-base && \
24+
build-base \
25+
python3-dev && \
2326
echo "**** install packages ****" && \
24-
if [ -z ${DELUGE_VERSION+x} ]; then \
25-
DELUGE_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
26-
&& awk '/^P:deluge$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \
27-
fi && \
28-
apk add --no-cache --upgrade --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
29-
deluge==${DELUGE_VERSION} \
27+
apk add --no-cache --upgrade \
28+
boost1.84-python3 \
29+
geoip \
3030
python3 \
31-
py3-future \
32-
py3-geoip \
33-
py3-requests \
3431
p7zip && \
32+
if [ -z ${DELUGE_VERSION+x} ]; then \
33+
DELUGE_VERSION=$(curl -sL https://pypi.python.org/pypi/deluge/json |jq -r '. | .info.version');\
34+
fi && \
35+
python3 -m venv /lsiopy && \
36+
pip install -U --no-cache-dir \
37+
pip \
38+
'setuptools==81' && \
39+
pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.23/ \
40+
rencode==1.0.6 && \
41+
pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.23/ \
42+
deluge[all]==${DELUGE_VERSION} \
43+
pygeoip && \
3544
echo "**** grab GeoIP database ****" && \
3645
curl -L --retry 10 --retry-max-time 60 --retry-all-errors \
3746
"https://geoip.linuxserver.io/GeoIP.dat.gz" \
@@ -44,6 +53,10 @@ RUN \
4453
$HOME/.cache \
4554
/tmp/*
4655

56+
COPY --from=libtorrent /libtorrent-build/usr/lib/libtorrent-rasterbar.* /usr/lib/
57+
58+
COPY --from=libtorrent /libtorrent-build/usr/lib/python3.12 /lsiopy/lib/python3.12
59+
4760
# add local files
4861
COPY root/ /
4962

Jenkinsfile

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,14 @@ pipeline {
2020
QUAYIO_API_TOKEN=credentials('quayio-repo-api-token')
2121
GIT_SIGNING_KEY=credentials('484fbca6-9a4f-455e-b9e3-97ac98785f5f')
2222
BUILD_VERSION_ARG = 'DELUGE_VERSION'
23+
EXT_PIP='deluge'
2324
LS_USER = 'linuxserver'
2425
LS_REPO = 'docker-deluge'
2526
CONTAINER_NAME = 'deluge'
2627
DOCKERHUB_IMAGE = 'linuxserver/deluge'
2728
DEV_DOCKERHUB_IMAGE = 'lsiodev/deluge'
2829
PR_DOCKERHUB_IMAGE = 'lspipepr/deluge'
2930
DIST_IMAGE = 'alpine'
30-
DIST_TAG = 'edge'
31-
DIST_REPO = 'http://dl-cdn.alpinelinux.org/alpine/edge/community/'
32-
DIST_REPO_PACKAGES = 'deluge'
3331
MULTIARCH='true'
3432
CI='true'
3533
CI_WEB='true'
@@ -145,19 +143,17 @@ pipeline {
145143
/* ########################
146144
External Release Tagging
147145
######################## */
148-
// If this is an alpine repo change for external version determine an md5 from the version string
149-
stage("Set tag Alpine Repo"){
146+
// If this is a pip release set the external tag to the pip version
147+
stage("Set ENV pip_version"){
150148
steps{
151149
script{
152150
env.EXT_RELEASE = sh(
153-
script: '''curl -sL "${DIST_REPO}x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
154-
&& awk '/^P:'"${DIST_REPO_PACKAGES}"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://' ''',
151+
script: '''curl -sL https://pypi.python.org/pypi/${EXT_PIP}/json |jq -r '. | .info.version' ''',
155152
returnStdout: true).trim()
156-
env.RELEASE_LINK = 'alpine_repo'
153+
env.RELEASE_LINK = 'https://pypi.python.org/pypi/' + env.EXT_PIP
157154
}
158155
}
159-
}
160-
// Sanitize the release tag and strip illegal docker or github characters
156+
} // Sanitize the release tag and strip illegal docker or github characters
161157
stage("Sanitize tag"){
162158
steps{
163159
script{
@@ -1024,7 +1020,7 @@ pipeline {
10241020
"type": "commit",\
10251021
"tagger": {"name": "LinuxServer-CI","email": "[email protected]","date": "'${GITHUB_DATE}'"}}'
10261022
echo "Pushing New release for Tag"
1027-
echo "Updating external repo packages to ${EXT_RELEASE_CLEAN}" > releasebody.json
1023+
echo "Updating PIP version of ${EXT_PIP} to ${EXT_RELEASE_CLEAN}" > releasebody.json
10281024
jq -n \
10291025
--arg tag_name "$META_TAG" \
10301026
--arg target_commitish "master" \

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
323323

324324
## Versions
325325

326+
* **02.04.26:** - Install from pypi due to Alpine geoip package deprecation.
326327
* **29.12.25:** - Fix some issues with GeoIP updates.
327328
* **23.08.25:** - Update GeoIP provider, add weekly cronjob to update.
328329
* **12.01.25:** - Rebase libtorrentv1 branch to Alpine 3.21.

jenkins-vars.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,20 @@
22

33
# jenkins variables
44
project_name: docker-deluge
5-
external_type: alpine_repo
5+
external_type: pip_version
66
release_type: stable
77
release_tag: latest
88
ls_branch: master
99
repo_vars:
1010
- BUILD_VERSION_ARG = 'DELUGE_VERSION'
11+
- EXT_PIP='deluge'
1112
- LS_USER = 'linuxserver'
1213
- LS_REPO = 'docker-deluge'
1314
- CONTAINER_NAME = 'deluge'
1415
- DOCKERHUB_IMAGE = 'linuxserver/deluge'
1516
- DEV_DOCKERHUB_IMAGE = 'lsiodev/deluge'
1617
- PR_DOCKERHUB_IMAGE = 'lspipepr/deluge'
1718
- DIST_IMAGE = 'alpine'
18-
- DIST_TAG = 'edge'
19-
- DIST_REPO = 'http://dl-cdn.alpinelinux.org/alpine/edge/community/'
20-
- DIST_REPO_PACKAGES = 'deluge'
2119
- MULTIARCH='true'
2220
- CI='true'
2321
- CI_WEB='true'

readme-vars.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ init_diagram: |
101101
"deluge:latest" <- Base Images
102102
# changelog
103103
changelogs:
104+
- {date: "02.04.26:", desc: "Install from pypi due to Alpine geoip package deprecation."}
104105
- {date: "29.12.25:", desc: "Fix some issues with GeoIP updates."}
105106
- {date: "23.08.25:", desc: "Update GeoIP provider, add weekly cronjob to update."}
106107
- {date: "12.01.25:", desc: "Rebase libtorrentv1 branch to Alpine 3.21."}

root/etc/s6-overlay/s6-rc.d/svc-deluge-web/run

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ fi
1010
if [[ -z ${LSIO_NON_ROOT_USER} ]]; then
1111
exec \
1212
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z 127.0.0.1 ${DELUGE_WEB_PORT:-8112}" \
13-
s6-setuidgid abc /usr/bin/deluge-web -d -c /config --loglevel="${DELUGE_LOGLEVEL}"
13+
s6-setuidgid abc /lsiopy/bin/deluge-web -d -c /config --loglevel="${DELUGE_LOGLEVEL}"
1414
else
1515
exec \
1616
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z 127.0.0.1 ${DELUGE_WEB_PORT:-8112}" \
17-
/usr/bin/deluge-web -d -c /config --loglevel="${DELUGE_LOGLEVEL}"
17+
/lsiopy/bin/deluge-web -d -c /config --loglevel="${DELUGE_LOGLEVEL}"
1818
fi

root/etc/s6-overlay/s6-rc.d/svc-deluged/run

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ fi
1010
if [[ -z ${LSIO_NON_ROOT_USER} ]]; then
1111
exec \
1212
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z 127.0.0.1 ${DELUGED_PORT:-58846}" \
13-
s6-setuidgid abc /usr/bin/deluged -c /config -d --loglevel="${DELUGE_LOGLEVEL}"
13+
s6-setuidgid abc /lsiopy/bin/deluged -c /config -d --loglevel="${DELUGE_LOGLEVEL}"
1414
else
1515
exec \
1616
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z 127.0.0.1 ${DELUGED_PORT:-58846}" \
17-
/usr/bin/deluged -c /config -d --loglevel="${DELUGE_LOGLEVEL}"
17+
/lsiopy/bin/deluged -c /config -d --loglevel="${DELUGE_LOGLEVEL}"
1818
fi

0 commit comments

Comments
 (0)