Skip to content

Commit fe9d2cd

Browse files
authored
support for Blackwell; support for build from src using Podman; maintenance (#32)
Signed-off-by: Oleksander Piskun <[email protected]>
1 parent 7c8b083 commit fe9d2cd

File tree

7 files changed

+37
-28
lines changed

7 files changed

+37
-28
lines changed

Dockerfile

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.12-slim-bookworm AS builder
1+
FROM docker.io/python:3.12-slim-bookworm AS builder
22

33
RUN apt-get update && apt-get install -y curl && \
44
apt-get clean && rm -rf /var/lib/apt/lists/*
@@ -27,13 +27,13 @@ RUN --mount=type=cache,target=/root/.cache/pip \
2727
ARCH=$(uname -m) && \
2828
if [ "$ARCH" = "aarch64" ]; then \
2929
echo "Installing PyTorch for ARM64"; \
30-
python3 -m pip install --root-user-action=ignore torch==2.4.1 torchvision torchaudio; \
30+
python3 -m pip install --root-user-action=ignore torch==2.8.0 torchvision; \
3131
elif [ "$BUILD_TYPE" = "rocm" ]; then \
32-
python3 -m pip install --root-user-action=ignore torch==2.4.1 torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm6.1; \
32+
python3 -m pip install --root-user-action=ignore torch==2.8.0 torchvision --index-url https://download.pytorch.org/whl/rocm6.4; \
3333
elif [ "$BUILD_TYPE" = "cpu" ]; then \
34-
python3 -m pip install --root-user-action=ignore torch==2.4.1 torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu; \
34+
python3 -m pip install --root-user-action=ignore torch==2.8.0 torchvision --index-url https://download.pytorch.org/whl/cpu; \
3535
else \
36-
python3 -m pip install --root-user-action=ignore torch==2.4.1 torchvision torchaudio; \
36+
python3 -m pip install --root-user-action=ignore torch==2.8.0 torchvision; \
3737
fi
3838

3939
RUN --mount=type=cache,target=/root/.cache/pip \
@@ -46,11 +46,7 @@ COPY --from=builder /usr/local/ /usr/local/
4646
RUN apt-get update && apt-get install -y curl procps iputils-ping netcat-traditional && \
4747
apt-get clean && rm -rf /var/lib/apt/lists/*
4848

49-
ADD /ex_app/cs[s] /ex_app/css
50-
ADD /ex_app/im[g] /ex_app/img
51-
ADD /ex_app/j[s] /ex_app/js
52-
ADD /ex_app/l10[n] /ex_app/l10n
53-
ADD /ex_app/li[b] /ex_app/lib
49+
ADD /ex_app/lib /ex_app/lib
5450

5551
COPY --chmod=775 healthcheck.sh /
5652
COPY --chmod=775 start.sh /

Makefile

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@ help:
1313
@echo " "
1414
@echo " build-push builds app docker images with 'release' tags and uploads them to ghcr.io"
1515
@echo " build-push-latest builds app docker images with 'latest' tags and uploads them to ghcr.io"
16+
@echo " build-podman-latest builds app docker images with 'latest' tags with podman"
1617
@echo " "
1718
@echo " > Next commands are only for the dev environment with nextcloud-docker-dev!"
1819
@echo " > They must be run from the host you are developing on, not in a Nextcloud container!"
1920
@echo " "
20-
@echo " run30 installs $(APP_NAME) for Nextcloud 30"
21+
@echo " run31 installs $(APP_NAME) for Nextcloud 31"
2122
@echo " run installs $(APP_NAME) for Nextcloud Latest"
2223
@echo " "
23-
@echo " run30-latest installs $(APP_NAME) with 'latest' tag for Nextcloud 30"
24+
@echo " run31-latest installs $(APP_NAME) with 'latest' tag for Nextcloud 31"
2425
@echo " run-latest installs $(APP_NAME) with 'latest' tag for Nextcloud Latest"
2526

2627
.PHONY: build-push
@@ -37,19 +38,25 @@ build-push-latest:
3738
DOCKER_BUILDKIT=1 docker buildx build --progress=plain --push --platform linux/amd64 --tag ghcr.io/nextcloud/$(APP_ID):latest-cuda --build-arg BUILD_TYPE=cuda .
3839
DOCKER_BUILDKIT=1 docker buildx build --progress=plain --push --platform linux/amd64 --tag ghcr.io/nextcloud/$(APP_ID):latest-rocm --build-arg BUILD_TYPE=rocm .
3940

40-
.PHONY: run30
41-
run30:
42-
docker exec master-stable30-1 sudo -u www-data php occ app_api:app:register $(APP_ID) --test-deploy-mode \
41+
.PHONY: build-podman-latest
42+
build-push-latest:
43+
podman build --format=docker --platform linux/arm64/v8,linux/amd64 --tag ghcr.io/nextcloud/$(APP_ID):latest --build-arg BUILD_TYPE=cpu .
44+
podman build --format=docker --platform linux/amd64 --tag ghcr.io/nextcloud/$(APP_ID):latest-cuda --build-arg BUILD_TYPE=cuda .
45+
podman build --format=docker --platform linux/amd64 --tag ghcr.io/nextcloud/$(APP_ID):latest-rocm --build-arg BUILD_TYPE=rocm .
46+
47+
.PHONY: run31
48+
run31:
49+
docker exec master-stable31-1 sudo -u www-data php occ app_api:app:register $(APP_ID) --test-deploy-mode \
4350
--info-xml https://raw.githubusercontent.com/nextcloud/$(APP_ID)/main/appinfo/info.xml
4451

4552
.PHONY: run
4653
run:
4754
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:register $(APP_ID) --test-deploy-mode \
4855
--info-xml https://raw.githubusercontent.com/nextcloud/$(APP_ID)/main/appinfo/info.xml
4956

50-
.PHONY: run30-latest
51-
run30-latest:
52-
docker exec master-stable30-1 sudo -u www-data php occ app_api:app:register $(APP_ID) --test-deploy-mode \
57+
.PHONY: run31-latest
58+
run31-latest:
59+
docker exec master-stable31-1 sudo -u www-data php occ app_api:app:register $(APP_ID) --test-deploy-mode \
5360
--info-xml https://raw.githubusercontent.com/nextcloud/$(APP_ID)/main/appinfo/info-latest.xml
5461

5562
.PHONY: run-latest

appinfo/info-latest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<description>
77
<![CDATA[Application to test the Docker AppAPI deployment process]]>
88
</description>
9-
<version>2.0.1</version>
9+
<version>2.1.0</version>
1010
<licence>MIT</licence>
1111
<author mail="[email protected]" homepage="https://github.com/andrey18106">Andrey Borysenko</author>
1212
<author mail="[email protected]" homepage="https://github.com/bigcat88">Alexander Piskun</author>
@@ -17,7 +17,7 @@
1717
<bugs>https://github.com/nextcloud/app_api/issues</bugs>
1818
<repository type="git">https://github.com/nextcloud/test-deploy</repository>
1919
<dependencies>
20-
<nextcloud min-version="32" max-version="32"/>
20+
<nextcloud min-version="30" max-version="33"/>
2121
</dependencies>
2222
<external-app>
2323
<docker-install>

appinfo/info.xml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<description>
77
<![CDATA[Application to test the Docker AppAPI deployment process]]>
88
</description>
9-
<version>1.1.0</version>
9+
<version>1.2.0</version>
1010
<licence>MIT</licence>
1111
<author mail="[email protected]" homepage="https://github.com/andrey18106">Andrey Borysenko</author>
1212
<author mail="[email protected]" homepage="https://github.com/bigcat88">Alexander Piskun</author>
@@ -17,16 +17,13 @@
1717
<bugs>https://github.com/nextcloud/app_api/issues</bugs>
1818
<repository type="git">https://github.com/nextcloud/test-deploy</repository>
1919
<dependencies>
20-
<nextcloud min-version="28" max-version="32"/>
20+
<nextcloud min-version="30" max-version="33"/>
2121
</dependencies>
2222
<external-app>
2323
<docker-install>
2424
<registry>ghcr.io</registry>
2525
<image>nextcloud/test-deploy</image>
2626
<image-tag>release</image-tag>
2727
</docker-install>
28-
<scopes>
29-
</scopes>
30-
<system>false</system>
3128
</external-app>
3229
</info>

ex_app/lib/main.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ async def init_callback(b_tasks: BackgroundTasks):
7373

7474
def enabled_handler(enabled: bool, _nc: NextcloudApp) -> str:
7575
print(f"enabled_handler: enabled={bool(enabled)}", flush=True)
76+
if torch.version.cuda is not None:
77+
torch_version = f"{torch.__version__} (CUDA {torch.version.cuda})"
78+
elif torch.version.hip is not None:
79+
torch_version = f"{torch.__version__} (ROCm {torch.version.hip})"
80+
else:
81+
torch_version = torch.__version__
82+
print(f"pytorch package version: {torch_version}", flush=True)
7683
r = ""
7784
if get_computation_device() == "CUDA":
7885
print("Get CUDA information", flush=True)

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ preview = true
66
[tool.ruff]
77
line-length = 120
88
target-version = "py310"
9-
select = ["A", "B", "C", "D", "E", "F", "G", "I", "S", "SIM", "PIE", "Q", "RET", "RUF", "UP" , "W"]
10-
extend-ignore = ["D101", "D102", "D103", "D105", "D107", "D203", "D213", "D401", "I001", "RUF100", "D400", "D415"]
9+
lint.select = ["A", "B", "C", "D", "E", "F", "G", "I", "S", "SIM", "PIE", "Q", "RET", "RUF", "UP" , "W"]
10+
lint.extend-ignore = ["D101", "D102", "D103", "D105", "D107", "D203", "D213", "D401", "I001", "RUF100", "D400", "D415"]
11+
lint.mccabe.max-complexity = 20
1112

1213
[tool.isort]
1314
profile = "black"

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
nc_py_api[app]>=0.19.2
1+
nc_py_api[app]>=0.21.1
2+
httpx

0 commit comments

Comments
 (0)