Skip to content

Commit

Permalink
Merge pull request #1 from nextcloud/fix/adjustments-after-transfer
Browse files Browse the repository at this point in the history
Fixes after repo  transfer
  • Loading branch information
bigcat88 authored Oct 18, 2024
2 parents 78f1712 + 0d8d992 commit 07734dc
Show file tree
Hide file tree
Showing 12 changed files with 83 additions and 60 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish-docker-cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:
jobs:
push_to_registry:
name: Build image
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'cloud-py-api' }} # REPLACE THIS WITH YOUR ORGANIZATION NAME
runs-on: ubuntu-22.04
if: ${{ github.repository_owner == 'nextcloud' }} # REPLACE THIS WITH YOUR ORGANIZATION NAME
permissions:
packages: write
contents: read
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-docker-cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:
jobs:
push_to_registry:
name: Build image
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'cloud-py-api' }} # REPLACE THIS WITH YOUR ORGANIZATION NAME
runs-on: ubuntu-22.04
if: ${{ github.repository_owner == 'nextcloud' }} # REPLACE THIS WITH YOUR ORGANIZATION NAME
permissions:
packages: write
contents: read
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-docker-rocm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:
jobs:
push_to_registry:
name: Build image
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'cloud-py-api' }} # REPLACE THIS WITH YOUR ORGANIZATION NAME
runs-on: ubuntu-22.04
if: ${{ github.repository_owner == 'nextcloud' }} # REPLACE THIS WITH YOUR ORGANIZATION NAME
permissions:
packages: write
contents: read
Expand Down
8 changes: 6 additions & 2 deletions .nextcloudignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
/babel.config.js
/build
/APPS.md
/AUTHORS.md
/CHANGELOG.md
/HOW_TO_INSTALL.md
/README.md
/composer.*
Expand All @@ -41,4 +39,10 @@
/requirements.txt
/Dockerfile
/results
/ex_app/js
/ex_app/lib
/ex_app/src
/ex_app_scripts
/translationtool.phar
/healthcheck.sh
tests
8 changes: 3 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
ci:
skip: [pylint]

exclude: '^ex_app/(img|js)/|.*\.phar'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
Expand All @@ -14,13 +12,13 @@ repos:
rev: 5.13.2
hooks:
- id: isort
files: lib/
files: ex_app/lib/

- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
files: lib/
files: ex_app/lib/

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.5
Expand Down
20 changes: 10 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,30 @@ FROM python:3.11-slim-bookworm
ARG BUILD_TYPE
COPY requirements.txt /

ADD cs[s] /app/css
ADD im[g] /app/img
ADD j[s] /app/js
ADD l10[n] /app/l10n
ADD li[b] /app/lib
ADD /ex_app/cs[s] /ex_app/css
ADD /ex_app/im[g] /ex_app/img
ADD /ex_app/j[s] /ex_app/js
ADD /ex_app/l10[n] /ex_app/l10n
ADD /ex_app/li[b] /ex_app/lib

COPY --chmod=775 healthcheck.sh /

# Installing PyTorch based on BUILD_TYPE
RUN ARCH=$(uname -m) && \
if [ "$ARCH" = "aarch64" ]; then \
echo "Installing PyTorch for ARM64"; \
python3 -m pip install torch torchvision torchaudio; \
python3 -m pip install torch==2.4.1 torchvision torchaudio; \
elif [ "$BUILD_TYPE" = "rocm" ]; then \
python3 -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm6.1; \
python3 -m pip install torch==2.4.1 torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm6.1; \
elif [ "$BUILD_TYPE" = "cpu" ]; then \
python3 -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu; \
python3 -m pip install torch==2.4.1 torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu; \
else \
python3 -m pip install torch torchvision torchaudio; \
python3 -m pip install torch==2.4.1 torchvision torchaudio; \
fi

RUN \
python3 -m pip install -r requirements.txt && rm -rf ~/.cache && rm requirements.txt

WORKDIR /app/lib
WORKDIR /ex_app/lib
ENTRYPOINT ["python3", "main.py"]
HEALTHCHECK --interval=2s --timeout=2s --retries=300 CMD /healthcheck.sh
59 changes: 40 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,37 +1,58 @@
.DEFAULT_GOAL := help

APP_ID := test-deploy
APP_NAME := TestDeploy
APP_VERSION := $$(xmlstarlet sel -t -v "//version" appinfo/info.xml)


.PHONY: help
help:
@echo "Welcome to Test-Deploy app. Please use \`make <target>\` where <target> is one of"
@echo " Welcome to $(APP_NAME) $(APP_VERSION)!"
@echo " "
@echo " Please use \`make <target>\` where <target> is one of"
@echo " "
@echo " build-push builds app docker image with 'release' tag and uploads it to ghcr.io"
@echo " build-push-latest builds app docker image with 'latest' tag and uploads it to ghcr.io"
@echo " "
@echo " Next commands are only for dev environment with nextcloud-docker-dev!"
@echo " "
@echo " build-push build and push release version of image"
@echo " build-push-latest build and push dev version of image"
@echo " "
@echo " run deploy release of 'Test-Deploy' for Nextcloud 28"
@echo " run-debug deploy dev version of 'Test-Deploy' for Nextcloud 28"
@echo " > Next commands are only for the dev environment with nextcloud-docker-dev!"
@echo " > They should run from the host you are developing on and not in the container with Nextcloud!"
@echo " "
@echo " run30 installs $(APP_NAME) for Nextcloud 30"
@echo " run installs $(APP_NAME) for Nextcloud Latest"
@echo " "
@echo " run30-latest installs $(APP_NAME) with 'latest' tag for Nextcloud 30"
@echo " run-latest installs $(APP_NAME) with 'latest' tag for Nextcloud Latest"

.PHONY: build-push
build-push:
docker login ghcr.io
docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ghcr.io/cloud-py-api/test-deploy:release-cpu --build-arg BUILD_TYPE=cpu .
docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ghcr.io/cloud-py-api/test-deploy:release-cuda --build-arg BUILD_TYPE=cuda .
docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ghcr.io/cloud-py-api/test-deploy:release-rocm --build-arg BUILD_TYPE=rocm .
docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ghcr.io/nextcloud/$(APP_ID):release-cpu --build-arg BUILD_TYPE=cpu .
docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ghcr.io/nextcloud/$(APP_ID):release-cuda --build-arg BUILD_TYPE=cuda .
docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ghcr.io/nextcloud/$(APP_ID):release-rocm --build-arg BUILD_TYPE=rocm .

.PHONY: build-push-latest
build-push-latest:
docker login ghcr.io
docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ghcr.io/cloud-py-api/test-deploy:latest-cpu --build-arg BUILD_TYPE=cpu .
docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ghcr.io/cloud-py-api/test-deploy:latest-cuda --build-arg BUILD_TYPE=cuda .
docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ghcr.io/cloud-py-api/test-deploy:latest-rocm --build-arg BUILD_TYPE=rocm .
docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ghcr.io/nextcloud/$(APP_ID):latest-cpu --build-arg BUILD_TYPE=cpu .
docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ghcr.io/nextcloud/$(APP_ID):latest-cuda --build-arg BUILD_TYPE=cuda .
docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ghcr.io/nextcloud/$(APP_ID):latest-rocm --build-arg BUILD_TYPE=rocm .

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

.PHONY: run
run:
docker exec master-stable28-1 sudo -u www-data php occ app_api:app:register test-deploy --force-scopes --test-deploy-mode \
--info-xml https://raw.githubusercontent.com/cloud-py-api/test-deploy/main/appinfo/info.xml
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:register $(APP_ID) --test-deploy-mode \
--info-xml https://raw.githubusercontent.com/nextcloud/$(APP_ID)/main/appinfo/info.xml

.PHONY: run30-latest
run30-latest:
docker exec master-stable30-1 sudo -u www-data php occ app_api:app:register $(APP_ID) --test-deploy-mode \
--info-xml https://raw.githubusercontent.com/nextcloud/$(APP_ID)/main/appinfo/info-latest.xml

.PHONY: run-latest
run-debug:
docker exec master-stable28-1 sudo -u www-data php occ app_api:app:register test-deploy --force-scopes --test-deploy-mode \
--info-xml https://raw.githubusercontent.com/cloud-py-api/test-deploy/main/appinfo/info-latest.xml
run-latest:
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:register $(APP_ID) --test-deploy-mode \
--info-xml https://raw.githubusercontent.com/nextcloud/$(APP_ID)/main/appinfo/info-latest.xml
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# AppAPI: deployment test

This repository is used in [AppAPI](https://github.com/cloud-py-api/app_api) as a test application when you click on the "Test Deploy" button
This repository is used in [AppAPI](https://github.com/nextcloud/app_api) as a test application when you click on the "Test Deploy" button

It differs from skeleton in that there are images of Python separately for CPU, AMD and NVIDIA.

Expand Down
16 changes: 8 additions & 8 deletions appinfo/info-latest.xml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<?xml version="1.0"?>
<info>
<id>test-deploy</id>
<name>Test Deploy</name>
<name>TestDeploy</name>
<summary>Docker AppAPI deployment process test</summary>
<description>
<![CDATA[Application to test the Docker AppAPI deployment process]]>
</description>
<version>1.0.0</version>
<version>1.0.1</version>
<licence>MIT</licence>
<author mail="[email protected]" homepage="https://github.com/andrey18106">Andrey Borysenko</author>
<author mail="[email protected]" homepage="https://github.com/bigcat88">Alexander Piskun</author>
<namespace>AppAPI_test_deploy</namespace>
<category>tools</category>
<website>https://github.com/cloud-py-api/test-deploy</website>
<discussion>https://github.com/cloud-py-api/app_api/discussions</discussion>
<bugs>https://github.com/cloud-py-api/app_api/issues</bugs>
<repository type="git">https://github.com/cloud-py-api/test-deploy</repository>
<website>https://github.com/nextcloud/test-deploy</website>
<discussion>https://github.com/nextcloud/app_api/discussions</discussion>
<bugs>https://github.com/nextcloud/app_api/issues</bugs>
<repository type="git">https://github.com/nextcloud/test-deploy</repository>
<dependencies>
<nextcloud min-version="27" max-version="30"/>
<nextcloud min-version="28" max-version="31"/>
</dependencies>
<external-app>
<docker-install>
<registry>ghcr.io</registry>
<image>cloud-py-api/test-deploy</image>
<image>nextcloud/test-deploy</image>
<image-tag>latest</image-tag>
</docker-install>
<scopes>
Expand Down
16 changes: 8 additions & 8 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<?xml version="1.0"?>
<info>
<id>test-deploy</id>
<name>Test Deploy</name>
<name>TestDeploy</name>
<summary>Docker AppAPI deployment process test</summary>
<description>
<![CDATA[Application to test the Docker AppAPI deployment process]]>
</description>
<version>1.0.0</version>
<version>1.0.1</version>
<licence>MIT</licence>
<author mail="[email protected]" homepage="https://github.com/andrey18106">Andrey Borysenko</author>
<author mail="[email protected]" homepage="https://github.com/bigcat88">Alexander Piskun</author>
<namespace>AppAPI_test_deploy</namespace>
<category>tools</category>
<website>https://github.com/cloud-py-api/test-deploy</website>
<discussion>https://github.com/cloud-py-api/app_api/discussions</discussion>
<bugs>https://github.com/cloud-py-api/app_api/issues</bugs>
<repository type="git">https://github.com/cloud-py-api/test-deploy</repository>
<website>https://github.com/nextcloud/test-deploy</website>
<discussion>https://github.com/nextcloud/app_api/discussions</discussion>
<bugs>https://github.com/nextcloud/app_api/issues</bugs>
<repository type="git">https://github.com/nextcloud/test-deploy</repository>
<dependencies>
<nextcloud min-version="27" max-version="30"/>
<nextcloud min-version="28" max-version="31"/>
</dependencies>
<external-app>
<docker-install>
<registry>ghcr.io</registry>
<image>cloud-py-api/test-deploy</image>
<image>nextcloud/test-deploy</image>
<image-tag>release</image-tag>
</docker-install>
<scopes>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nc_py_api[app]>=0.15.1
nc_py_api[app]>=0.17.1

0 comments on commit 07734dc

Please sign in to comment.