Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ jobs:
repository: nextcloud/server
ref: master

- name: Checkout AppAPI
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
path: apps/app_api
repository: nextcloud/app_api
ref: main

- name: Checkout Test Deploy
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
Expand Down Expand Up @@ -72,10 +79,18 @@ jobs:
./occ config:system:set debug --value=true --type=boolean
./occ app:enable --force app_api

- name: Build image
run: |
IMAGE="$(php -r '$d = simplexml_load_file($argv[1])->{"external-app"}->{"docker-install"}; echo $d->registry . "/" . $d->image . ":" . $d->{"image-tag"};' apps/${{ env.APP_NAME }}/appinfo/info.xml)"
echo "Building $IMAGE"
docker build --build-arg BUILD_TYPE=cpu -t "$IMAGE" apps/${{ env.APP_NAME }}

- name: Test deploy
run: |
PHP_CLI_SERVER_WORKERS=2 php -S 127.0.0.1:8080 &
./occ app_api:daemon:register docker_local_sock Docker docker-install http /var/run/docker.sock http://127.0.0.1:8080/index.php
# Deploy the image built above instead of pulling the published one
./occ app_api:daemon:registry:add docker_local_sock --registry-from ghcr.io --registry-to local
./occ app_api:app:register ${{ env.APP_NAME }} docker_local_sock \
--info-xml apps/${{ env.APP_NAME }}/appinfo/info.xml
./occ app_api:app:enable ${{ env.APP_NAME }}
Expand All @@ -89,11 +104,10 @@ jobs:

- name: Check logs
run: |
grep -q 'Started' container.log || error
grep -q 'Connect to Nextcloud was successful' container.log || error
grep -q 'enabled_handler: enabled=True' container.log || error
grep -q 'enabled_handler: enabled=False' container.log || error
grep -q 'Running on CPU' container.log || error
for expected in 'Started' 'Connect to Nextcloud was successful' \
'enabled_handler: enabled=True' 'enabled_handler: enabled=False' 'Running on CPU'; do
grep -q "$expected" container.log || { echo "::error::Not found in the container log: $expected"; exit 1; }
done

- name: Unregister App & Daemon
run: |
Expand Down
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/python:3.12-slim-bookworm AS builder
FROM docker.io/python:3.14-slim-trixie AS builder

RUN apt-get update && apt-get install -y curl && \
apt-get clean && rm -rf /var/lib/apt/lists/*
Expand Down Expand Up @@ -42,19 +42,19 @@ RUN --mount=type=cache,target=/root/.cache/pip \
ARCH=$(uname -m) && \
if [ "$ARCH" = "aarch64" ]; then \
echo "Installing PyTorch for ARM64"; \
python3 -m pip install --root-user-action=ignore torch==2.8.0 torchvision; \
python3 -m pip install --root-user-action=ignore torch==2.9.1 torchvision; \
elif [ "$BUILD_TYPE" = "rocm" ]; then \
python3 -m pip install --root-user-action=ignore torch==2.8.0 torchvision --index-url https://download.pytorch.org/whl/rocm6.4; \
python3 -m pip install --root-user-action=ignore torch==2.9.1 torchvision --index-url https://download.pytorch.org/whl/rocm6.4; \
elif [ "$BUILD_TYPE" = "cpu" ]; then \
python3 -m pip install --root-user-action=ignore torch==2.8.0 torchvision --index-url https://download.pytorch.org/whl/cpu; \
python3 -m pip install --root-user-action=ignore torch==2.9.1 torchvision --index-url https://download.pytorch.org/whl/cpu; \
else \
python3 -m pip install --root-user-action=ignore torch==2.8.0 torchvision; \
python3 -m pip install --root-user-action=ignore torch==2.9.1 torchvision; \
fi

RUN --mount=type=cache,target=/root/.cache/pip \
python3 -m pip install --root-user-action=ignore -r requirements.txt && rm requirements.txt

FROM python:3.12-slim-bookworm
FROM python:3.14-slim-trixie

COPY --from=builder /usr/local/ /usr/local/

Expand Down
Loading