From 75670d9a90a746219871bce5669d7dc7e009e181 Mon Sep 17 00:00:00 2001 From: Benjamin Harder Date: Sun, 18 Feb 2024 22:41:32 +0100 Subject: [PATCH 01/27] BEAT TEST - Added Readarr Support (completely untested) --- .github/workflows/main.yml | 6 ------ README.md | 15 +++++++++++++++ config/config.conf-Example | 4 ++++ config/config.py | 10 ++++++++-- main.py | 19 ++++++++++++++++++- src/decluttarr.py | 5 +++++ src/remove_unmonitored.py | 4 +++- 7 files changed, 53 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index abad074..53ce3c3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -49,10 +49,4 @@ jobs: run: | docker buildx build --platform linux/amd64,linux/arm64 -t $IMAGE_NAME:$IMAGE_TAG -t $IMAGE_NAME:latest -f docker/Dockerfile --push . - # - name: "Build, Tag, and push the Docker image" - # env: - # IMAGE_NAME: ghcr.io/manimatter/decluttarr - # IMAGE_TAG: latest - # run: | - # docker buildx build --platform linux/amd64,linux/arm64 -t $IMAGE_NAME:$IMAGE_TAG -f docker/Dockerfile --push . diff --git a/README.md b/README.md index 009abe9..0a50bcd 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,9 @@ services: # Lidarr - LIDARR_URL=http://lidarr:8686 - LIDARR_KEY=$LIDARR_API_KEY + # Readarr + - READARR_URL=http://readarr:8787 + - READARR_KEY=$READARR_API_KEY # qBittorrent - QBITTORRENT_URL=http://qbittorrent:8080 #- QBITTORRENT_USERNAME=Your name @@ -227,6 +230,18 @@ Note: The `config.conf` is disregarded when running via docker-compose.yml --- +### **-Readarr section** +- Defines readarr instance on which download queue should be decluttered + +**READARR_URL** +- URL under which the instance can be reached +- If not defined, this instance will not be monitored + +**READARR_KEY** +- Your API key for readarr + +--- + ### **qBittorrent section** - Defines settings to connect with qBittorrent diff --git a/config/config.conf-Example b/config/config.conf-Example index 5127c02..1ad6cad 100644 --- a/config/config.conf-Example +++ b/config/config.conf-Example @@ -29,6 +29,10 @@ SONARR_KEY = $SONARR_API_KEY LIDARR_URL = http://lidarr:8686 LIDARR_KEY = $LIDARR_API_KEY +[readarr] +READARR_URL = http://lidarr:8787 +READARR_KEY = $READARR_API_KEY + [qbittorrent] QBITTORRENT_URL = http://qbittorrent:8080 QBITTORRENT_USERNAME = Your name (or empty) diff --git a/config/config.py b/config/config.py index b882834..d9b016a 100644 --- a/config/config.py +++ b/config/config.py @@ -108,6 +108,11 @@ LIDARR_URL = get_config_value('LIDARR_URL', LIDARR_KEY = None if LIDARR_URL == None else \ get_config_value('LIDARR_KEY', 'lidarr', True, str) +# Readarr +READARR_URL = get_config_value('READARR_URL', 'readarr', False, str) +READARR_KEY = None if READARR_URL == None else \ + get_config_value('READARR_KEY', 'readarr', True, str) + # qBittorrent QBITTORRENT_URL = get_config_value('QBITTORRENT_URL', 'qbittorrent', False, str, '') QBITTORRENT_USERNAME = get_config_value('QBITTORRENT_USERNAME', 'qbittorrent', False, str, '') @@ -115,14 +120,15 @@ QBITTORRENT_PASSWORD = get_config_value('QBITTORRENT_PASSWORD', ######################################################################################################################## ########### Validate settings -if not (RADARR_URL or SONARR_URL or LIDARR_URL): - print(f'[ ERROR ]: No Radarr/Sonarr/Lidarr URLs specified (nothing to monitor)') +if not (RADARR_URL or SONARR_URL or LIDARR_URL or READARR_URL): + print(f'[ ERROR ]: No Radarr/Sonarr/Lidarr/Readarr URLs specified (nothing to monitor)') sys.exit(0) ########### Enrich setting variables if RADARR_URL: RADARR_URL += '/api/v3' if SONARR_URL: SONARR_URL += '/api/v3' if LIDARR_URL: LIDARR_URL += '/api/v1' +if READARR_URL: READARR_URL += '/api/v1' if QBITTORRENT_URL: QBITTORRENT_URL += '/api/v2' ########### Add Variables to Dictionary diff --git a/main.py b/main.py index 0e4be74..1f6e5ed 100644 --- a/main.py +++ b/main.py @@ -49,6 +49,12 @@ async def main(): except: settings_dict['LIDARR_NAME'] = 'Lidarr' + try: + if settings_dict['READARR_URL']: + settings_dict['READARR_NAME'] = (await rest_get(settings_dict['READARR_URL']+'/system/status', settings_dict['READARR_KEY']))['instanceName'] + except: + settings_dict['READARR_NAME'] = 'Readarr' + # Print Settings fmt = '{0.days} days {0.hours} hours {0.minutes} minutes' logger.info('#' * 50) @@ -76,6 +82,7 @@ async def main(): if settings_dict['RADARR_URL']: logger.info('%s: %s', settings_dict['RADARR_NAME'], settings_dict['RADARR_URL']) if settings_dict['SONARR_URL']: logger.info('%s: %s', settings_dict['SONARR_NAME'], settings_dict['SONARR_URL']) if settings_dict['LIDARR_URL']: logger.info('%s: %s', settings_dict['LIDARR_NAME'], settings_dict['LIDARR_URL']) + if settings_dict['READARR_URL']: logger.info('%s: %s', settings_dict['READARR_NAME'], settings_dict['READARR_URL']) if settings_dict['QBITTORRENT_URL']: logger.info('qBittorrent: %s', settings_dict['QBITTORRENT_URL']) logger.info('') @@ -117,6 +124,14 @@ async def main(): error_occured = True logger.error('-- | %s *** Error: %s ***', settings_dict['LIDARR_NAME'], error) + if settings_dict['READARR_URL']: + try: + await asyncio.get_event_loop().run_in_executor(None, lambda: requests.get(settings_dict['READARR_URL']+'/system/status', params=None, headers={'X-Api-Key': settings_dict['READARR_KEY']})) + logger.info('OK | %s', settings_dict['READARR_NAME']) + except Exception as error: + error_occured = True + logger.error('-- | %s *** Error: %s ***', settings_dict['READARR_NAME'], error) + if settings_dict['QBITTORRENT_URL']: # Checking if qbit can be reached, and checking if version is OK try: @@ -186,6 +201,7 @@ async def main(): if settings_dict['RADARR_URL']: await queueCleaner(settings_dict, 'radarr', defective_tracker, download_sizes_tracker, protectedDownloadIDs, privateDowloadIDs) if settings_dict['SONARR_URL']: await queueCleaner(settings_dict, 'sonarr', defective_tracker, download_sizes_tracker, protectedDownloadIDs, privateDowloadIDs) if settings_dict['LIDARR_URL']: await queueCleaner(settings_dict, 'lidarr', defective_tracker, download_sizes_tracker, protectedDownloadIDs, privateDowloadIDs) + if settings_dict['READARR_URL']: await queueCleaner(settings_dict, 'readarr', defective_tracker, download_sizes_tracker, protectedDownloadIDs, privateDowloadIDs) logger.verbose('') logger.verbose('Queue clean-up complete!') await asyncio.sleep(settings_dict['REMOVE_TIMER']*60) @@ -194,7 +210,8 @@ async def main(): if __name__ == '__main__': instances = {settings_dict['RADARR_URL']: {}} if settings_dict['RADARR_URL'] else {} + \ {settings_dict['SONARR_URL']: {}} if settings_dict['SONARR_URL'] else {} + \ - {settings_dict['LIDARR_URL']: {}} if settings_dict['LIDARR_URL'] else {} + {settings_dict['LIDARR_URL']: {}} if settings_dict['LIDARR_URL'] else {} + \ + {settings_dict['READARR_URL']: {}} if settings_dict['READARR_URL'] else {} defective_tracker = Defective_Tracker(instances) download_sizes_tracker = Download_Sizes_Tracker({}) asyncio.run(main()) diff --git a/src/decluttarr.py b/src/decluttarr.py index 81be668..b507cf1 100644 --- a/src/decluttarr.py +++ b/src/decluttarr.py @@ -34,6 +34,11 @@ async def queueCleaner(settings_dict, arr_type, defective_tracker, download_size API_KEY = settings_dict['LIDARR_KEY'] NAME = settings_dict['LIDARR_NAME'] full_queue_param = 'includeUnknownArtistItems' + elif arr_type == 'readarr': + BASE_URL = settings_dict['READARR_URL'] + API_KEY = settings_dict['READARR_KEY'] + NAME = settings_dict['READARR_NAME'] + full_queue_param = 'includeUnknownAuthorItems' else: logger.error('Unknown arr_type specified, exiting: %s', str(arr_type)) sys.exit() diff --git a/src/remove_unmonitored.py b/src/remove_unmonitored.py index e406951..df32831 100644 --- a/src/remove_unmonitored.py +++ b/src/remove_unmonitored.py @@ -19,7 +19,9 @@ async def remove_unmonitored(settings_dict, BASE_URL, API_KEY, NAME, deleted_dow elif arr_type == 'radarr': isMonitored = (await rest_get(f'{BASE_URL}/movie/{str(queueItem["movieId"])}', API_KEY))['monitored'] elif arr_type == 'lidarr': - isMonitored = (await rest_get(f'{BASE_URL}/album/{str(queueItem["albumId"])}', API_KEY))['monitored'] + isMonitored = (await rest_get(f'{BASE_URL}/album/{str(queueItem["albumId"])}', API_KEY))['monitored'] + elif arr_type == 'readarr': + isMonitored = (await rest_get(f'{BASE_URL}/book/{str(queueItem["bookId"])}', API_KEY))['monitored'] if isMonitored: monitoredDownloadIDs.append(queueItem['downloadId']) From e819f48343f0d9496d73140ee3eb3ee725383736 Mon Sep 17 00:00:00 2001 From: Benjamin Harder Date: Sun, 18 Feb 2024 23:09:54 +0100 Subject: [PATCH 02/27] Showing Git package Version in loading message --- .github/workflows/main.yml | 2 +- main.py | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 53ce3c3..e787074 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -47,6 +47,6 @@ jobs: IMAGE_NAME: ghcr.io/manimatter/decluttarr IMAGE_TAG: ${{ steps.setversion.outputs.new_tag }} run: | - docker buildx build --platform linux/amd64,linux/arm64 -t $IMAGE_NAME:$IMAGE_TAG -t $IMAGE_NAME:latest -f docker/Dockerfile --push . + docker buildx build --platform linux/amd64,linux/arm64 -t $IMAGE_NAME:$IMAGE_TAG -t $IMAGE_NAME:latest --label com.decluttarr.version=$IMAGE_TAG -f docker/Dockerfile --push . diff --git a/main.py b/main.py index 1f6e5ed..0689216 100644 --- a/main.py +++ b/main.py @@ -11,6 +11,8 @@ from src.decluttarr import queueCleaner import requests import platform from packaging import version + + ########### Enabling Logging # Set up logging log_level_num=logging.getLevelName(settings_dict['LOG_LEVEL']) @@ -58,7 +60,9 @@ async def main(): # Print Settings fmt = '{0.days} days {0.hours} hours {0.minutes} minutes' logger.info('#' * 50) - logger.info('Application Started!') + logger.info('Decluttarr - Application Started!') + if settings_dict['IS_IN_DOCKER']: + logger.info('Version: %s', get_image_tag()) logger.info('') logger.info('*** Current Settings ***') logger.info('%s | Removing failed downloads', str(settings_dict['REMOVE_FAILED'])) @@ -216,3 +220,16 @@ if __name__ == '__main__': download_sizes_tracker = Download_Sizes_Tracker({}) asyncio.run(main()) + +import docker +def get_image_tag(): + client = docker.from_env() + + try: + container_info = client.containers.get('decluttarr') + image_tag = container_info.labels.get('decluttarr.version', 'No image tag provided') + return image_tag + except docker.errors.NotFound: + return 'Container not found' + except Exception as e: + return f'Error retrieving image tag: {e}' \ No newline at end of file From fda9daeb4d3f2ec9941abd73874ada68c8f3330a Mon Sep 17 00:00:00 2001 From: Benjamin Harder Date: Sun, 18 Feb 2024 23:17:01 +0100 Subject: [PATCH 03/27] fixing position of function --- main.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/main.py b/main.py index 0689216..feeb765 100644 --- a/main.py +++ b/main.py @@ -12,6 +12,18 @@ import requests import platform from packaging import version +import docker +def get_image_tag(): + # Retrieves the github version tag of the docker image + client = docker.from_env() + try: + container_info = client.containers.get('decluttarr') + image_tag = container_info.labels.get('decluttarr.version', 'No image tag provided') + return image_tag + except docker.errors.NotFound: + return 'Container not found' + except Exception as e: + return f'Error retrieving image tag: {e}' ########### Enabling Logging # Set up logging @@ -221,15 +233,3 @@ if __name__ == '__main__': asyncio.run(main()) -import docker -def get_image_tag(): - client = docker.from_env() - - try: - container_info = client.containers.get('decluttarr') - image_tag = container_info.labels.get('decluttarr.version', 'No image tag provided') - return image_tag - except docker.errors.NotFound: - return 'Container not found' - except Exception as e: - return f'Error retrieving image tag: {e}' \ No newline at end of file From d3bc476ffcfd3447443b5407ca80aef38b1e660e Mon Sep 17 00:00:00 2001 From: Benjamin Harder Date: Sun, 18 Feb 2024 23:37:41 +0100 Subject: [PATCH 04/27] Adding label into dev container, too (has a bug, not working) --- .github/workflows/dev.yml | 9 +++++++-- docker/Dockerfile | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 97197e6..5026bc7 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -35,6 +35,12 @@ jobs: - name: 'Checkout GitHub Action' uses: actions/checkout@main + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: 'Login to GitHub Container Registry' uses: docker/login-action@v1 with: @@ -47,8 +53,7 @@ jobs: IMAGE_NAME: ghcr.io/manimatter/decluttarr IMAGE_TAG: dev run: | - docker build -f docker/Dockerfile -t $IMAGE_NAME:$IMAGE_TAG . - docker push $IMAGE_NAME:$IMAGE_TAG + docker buildx build --platform linux/amd64,linux/arm64 -t $IMAGE_NAME:$IMAGE_TAG --label com.decluttarr.version=$IMAGE_TAG -f docker/Dockerfile --push . - name: "Delete untagged versions" uses: actions/delete-package-versions@v4 diff --git a/docker/Dockerfile b/docker/Dockerfile index e584110..c68e2fa 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,7 @@ #FROM python:3.9-slim-buster +# For debugging: +# sudo docker run --rm -it --entrypoint sh ghcr.io/manimatter/decluttarr:dev + FROM python:3.10.13-slim LABEL org.opencontainers.image.source="https://github.com/ManiMatter/decluttarr" From 2b4b4ac38573e755f89bdde8112152c3a323a098 Mon Sep 17 00:00:00 2001 From: Benjamin Harder Date: Sun, 18 Feb 2024 23:41:23 +0100 Subject: [PATCH 05/27] Dev build fix --- .github/workflows/dev.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 5026bc7..7d86c7e 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -35,12 +35,6 @@ jobs: - name: 'Checkout GitHub Action' uses: actions/checkout@main - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: 'Login to GitHub Container Registry' uses: docker/login-action@v1 with: @@ -53,7 +47,8 @@ jobs: IMAGE_NAME: ghcr.io/manimatter/decluttarr IMAGE_TAG: dev run: | - docker buildx build --platform linux/amd64,linux/arm64 -t $IMAGE_NAME:$IMAGE_TAG --label com.decluttarr.version=$IMAGE_TAG -f docker/Dockerfile --push . + docker build -f docker/Dockerfile -t $IMAGE_NAME:$IMAGE_TAG --label com.decluttarr.version=$IMAGE_TAG . + docker push $IMAGE_NAME:$IMAGE_TAG - name: "Delete untagged versions" uses: actions/delete-package-versions@v4 From 3a6c14a24ef54775e06ba84bea155943b5374cce Mon Sep 17 00:00:00 2001 From: Benjamin Harder Date: Sun, 18 Feb 2024 23:56:56 +0100 Subject: [PATCH 06/27] Added version as environment variable --- .github/workflows/dev.yml | 2 +- .github/workflows/main.yml | 2 +- config/config.py | 1 + docker/Dockerfile | 8 ++++++++ main.py | 16 +--------------- 5 files changed, 12 insertions(+), 17 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 7d86c7e..0a4b097 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -47,7 +47,7 @@ jobs: IMAGE_NAME: ghcr.io/manimatter/decluttarr IMAGE_TAG: dev run: | - docker build -f docker/Dockerfile -t $IMAGE_NAME:$IMAGE_TAG --label com.decluttarr.version=$IMAGE_TAG . + docker build -f docker/Dockerfile -t $IMAGE_NAME:$IMAGE_TAG --label com.decluttarr.version=$IMAGE_TAG --build-arg IMAGE_TAG=$IMAGE_TAG . docker push $IMAGE_NAME:$IMAGE_TAG - name: "Delete untagged versions" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e787074..24d8929 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -47,6 +47,6 @@ jobs: IMAGE_NAME: ghcr.io/manimatter/decluttarr IMAGE_TAG: ${{ steps.setversion.outputs.new_tag }} run: | - docker buildx build --platform linux/amd64,linux/arm64 -t $IMAGE_NAME:$IMAGE_TAG -t $IMAGE_NAME:latest --label com.decluttarr.version=$IMAGE_TAG -f docker/Dockerfile --push . + docker buildx build --platform linux/amd64,linux/arm64 -t $IMAGE_NAME:$IMAGE_TAG -t $IMAGE_NAME:latest --label com.decluttarr.version=$IMAGE_TAG --build-arg IMAGE_TAG=$IMAGE_TAG -f docker/Dockerfile --push . diff --git a/config/config.py b/config/config.py index d9b016a..c6331a3 100644 --- a/config/config.py +++ b/config/config.py @@ -6,6 +6,7 @@ import configparser ######################################################################################################################## # Check if in Docker IS_IN_DOCKER = os.environ.get('IS_IN_DOCKER') +IMAGE_TAG = os.environ.get('IMAGE_TAG', 'Local') ######################################################################################################################## def config_section_map(section): diff --git a/docker/Dockerfile b/docker/Dockerfile index c68e2fa..a053d89 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -3,6 +3,14 @@ # sudo docker run --rm -it --entrypoint sh ghcr.io/manimatter/decluttarr:dev FROM python:3.10.13-slim + +# Define a build-time argument for IMAGE_TAG +ARG IMAGE_TAG + +# Set an environment variable using the build-time argument +ENV IMAGE_TAG_ENV=$IMAGE_TAG + + LABEL org.opencontainers.image.source="https://github.com/ManiMatter/decluttarr" ENV IS_IN_DOCKER 1 diff --git a/main.py b/main.py index feeb765..bc4cd81 100644 --- a/main.py +++ b/main.py @@ -12,19 +12,6 @@ import requests import platform from packaging import version -import docker -def get_image_tag(): - # Retrieves the github version tag of the docker image - client = docker.from_env() - try: - container_info = client.containers.get('decluttarr') - image_tag = container_info.labels.get('decluttarr.version', 'No image tag provided') - return image_tag - except docker.errors.NotFound: - return 'Container not found' - except Exception as e: - return f'Error retrieving image tag: {e}' - ########### Enabling Logging # Set up logging log_level_num=logging.getLevelName(settings_dict['LOG_LEVEL']) @@ -73,10 +60,9 @@ async def main(): fmt = '{0.days} days {0.hours} hours {0.minutes} minutes' logger.info('#' * 50) logger.info('Decluttarr - Application Started!') - if settings_dict['IS_IN_DOCKER']: - logger.info('Version: %s', get_image_tag()) logger.info('') logger.info('*** Current Settings ***') + logger.info('Version: %s', settings_dict['IMAGE_TAG']) logger.info('%s | Removing failed downloads', str(settings_dict['REMOVE_FAILED'])) logger.info('%s | Removing downloads missing metadata', str(settings_dict['REMOVE_METADATA_MISSING'])) logger.info('%s | Removing downloads missing files', str(settings_dict['REMOVE_MISSING_FILES'])) From 39e9b77ace9e874abfd21ee1de0b683e22c24423 Mon Sep 17 00:00:00 2001 From: Benjamin Harder Date: Mon, 19 Feb 2024 00:04:06 +0100 Subject: [PATCH 07/27] Fixed variable --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index a053d89..1b7d5fc 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -8,7 +8,7 @@ FROM python:3.10.13-slim ARG IMAGE_TAG # Set an environment variable using the build-time argument -ENV IMAGE_TAG_ENV=$IMAGE_TAG +ENV IMAGE_TAG=$IMAGE_TAG LABEL org.opencontainers.image.source="https://github.com/ManiMatter/decluttarr" From c0a4036bc1b5b5245182a0e66ba258998db87c52 Mon Sep 17 00:00:00 2001 From: Benjamin Harder Date: Mon, 19 Feb 2024 00:22:01 +0100 Subject: [PATCH 08/27] Added commit id into loading screen --- .github/workflows/dev.yml | 18 ++++++++++++++++-- .github/workflows/main.yml | 13 +++++++++++-- config/config.py | 1 + docker/Dockerfile | 2 +- main.py | 2 ++ 5 files changed, 31 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 0a4b097..e0cbe6e 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -35,6 +35,12 @@ jobs: - name: 'Checkout GitHub Action' uses: actions/checkout@main + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: 'Login to GitHub Container Registry' uses: docker/login-action@v1 with: @@ -46,9 +52,17 @@ jobs: env: IMAGE_NAME: ghcr.io/manimatter/decluttarr IMAGE_TAG: dev + SHORT_COMMIT_ID: ${{ github.sha_short }} run: | - docker build -f docker/Dockerfile -t $IMAGE_NAME:$IMAGE_TAG --label com.decluttarr.version=$IMAGE_TAG --build-arg IMAGE_TAG=$IMAGE_TAG . - docker push $IMAGE_NAME:$IMAGE_TAG + docker buildx build \ + --platform linux/amd64,linux/arm64 \ + -t $IMAGE_NAME:$IMAGE_TAG \ + --label com.decluttarr.version=$IMAGE_TAG \ + --label com.decluttarr.commit=$SHORT_COMMIT_ID + --build-arg IMAGE_TAG=$IMAGE_TAG \ + --build-arg SHORT_COMMIT_ID=$SHORT_COMMIT_ID \ + -f docker/Dockerfile \ + --push - name: "Delete untagged versions" uses: actions/delete-package-versions@v4 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 24d8929..94f3fb8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -46,7 +46,16 @@ jobs: env: IMAGE_NAME: ghcr.io/manimatter/decluttarr IMAGE_TAG: ${{ steps.setversion.outputs.new_tag }} + SHORT_COMMIT_ID: ${{ github.sha_short }} run: | - docker buildx build --platform linux/amd64,linux/arm64 -t $IMAGE_NAME:$IMAGE_TAG -t $IMAGE_NAME:latest --label com.decluttarr.version=$IMAGE_TAG --build-arg IMAGE_TAG=$IMAGE_TAG -f docker/Dockerfile --push . - + docker buildx build \ + --platform linux/amd64,linux/arm64 \ + -t $IMAGE_NAME:$IMAGE_TAG \ + -t $IMAGE_NAME:latest \ + --label com.decluttarr.version=$IMAGE_TAG \ + --label com.decluttarr.commit=$SHORT_COMMIT_ID + --build-arg IMAGE_TAG=$IMAGE_TAG \ + --build-arg SHORT_COMMIT_ID=$SHORT_COMMIT_ID \ + -f docker/Dockerfile \ + --push diff --git a/config/config.py b/config/config.py index c6331a3..575bc29 100644 --- a/config/config.py +++ b/config/config.py @@ -7,6 +7,7 @@ import configparser # Check if in Docker IS_IN_DOCKER = os.environ.get('IS_IN_DOCKER') IMAGE_TAG = os.environ.get('IMAGE_TAG', 'Local') +SHORT_COMMIT_ID = os.environ.get('SHORT_COMMIT_ID', 'n/a') ######################################################################################################################## def config_section_map(section): diff --git a/docker/Dockerfile b/docker/Dockerfile index 1b7d5fc..d5d76a9 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -9,7 +9,7 @@ ARG IMAGE_TAG # Set an environment variable using the build-time argument ENV IMAGE_TAG=$IMAGE_TAG - +ENV SHORT_COMMIT_ID=$SHORT_COMMIT_ID LABEL org.opencontainers.image.source="https://github.com/ManiMatter/decluttarr" diff --git a/main.py b/main.py index bc4cd81..0a864c9 100644 --- a/main.py +++ b/main.py @@ -63,6 +63,8 @@ async def main(): logger.info('') logger.info('*** Current Settings ***') logger.info('Version: %s', settings_dict['IMAGE_TAG']) + logger.info('Commit: %s', settings_dict['SHORT_COMMIT_ID']) + logger.info('') logger.info('%s | Removing failed downloads', str(settings_dict['REMOVE_FAILED'])) logger.info('%s | Removing downloads missing metadata', str(settings_dict['REMOVE_METADATA_MISSING'])) logger.info('%s | Removing downloads missing files', str(settings_dict['REMOVE_MISSING_FILES'])) From 99e3c1b11200a0d5416c779b90fe84a871a7f92a Mon Sep 17 00:00:00 2001 From: Benjamin Harder Date: Mon, 19 Feb 2024 00:24:52 +0100 Subject: [PATCH 09/27] bugfix with dev.yml --- .github/workflows/dev.yml | 2 +- .github/workflows/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index e0cbe6e..8c75e6d 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -58,7 +58,7 @@ jobs: --platform linux/amd64,linux/arm64 \ -t $IMAGE_NAME:$IMAGE_TAG \ --label com.decluttarr.version=$IMAGE_TAG \ - --label com.decluttarr.commit=$SHORT_COMMIT_ID + --label com.decluttarr.commit=$SHORT_COMMIT_ID \ --build-arg IMAGE_TAG=$IMAGE_TAG \ --build-arg SHORT_COMMIT_ID=$SHORT_COMMIT_ID \ -f docker/Dockerfile \ diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 94f3fb8..f7efa3e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -53,7 +53,7 @@ jobs: -t $IMAGE_NAME:$IMAGE_TAG \ -t $IMAGE_NAME:latest \ --label com.decluttarr.version=$IMAGE_TAG \ - --label com.decluttarr.commit=$SHORT_COMMIT_ID + --label com.decluttarr.commit=$SHORT_COMMIT_ID \ --build-arg IMAGE_TAG=$IMAGE_TAG \ --build-arg SHORT_COMMIT_ID=$SHORT_COMMIT_ID \ -f docker/Dockerfile \ From ab4c6412ccbc0fcee6bdf136e6715467187fdea3 Mon Sep 17 00:00:00 2001 From: Benjamin Harder Date: Mon, 19 Feb 2024 00:27:00 +0100 Subject: [PATCH 10/27] Bugfix continued --- .github/workflows/dev.yml | 2 +- .github/workflows/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 8c75e6d..46e56f6 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -62,7 +62,7 @@ jobs: --build-arg IMAGE_TAG=$IMAGE_TAG \ --build-arg SHORT_COMMIT_ID=$SHORT_COMMIT_ID \ -f docker/Dockerfile \ - --push + --push . - name: "Delete untagged versions" uses: actions/delete-package-versions@v4 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f7efa3e..93dfd16 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -57,5 +57,5 @@ jobs: --build-arg IMAGE_TAG=$IMAGE_TAG \ --build-arg SHORT_COMMIT_ID=$SHORT_COMMIT_ID \ -f docker/Dockerfile \ - --push + --push . From 07d2d602806ab90d9360ce8f5b724b1d20be5ce7 Mon Sep 17 00:00:00 2001 From: Benjamin Harder Date: Mon, 19 Feb 2024 00:35:15 +0100 Subject: [PATCH 11/27] bugfixing-.. manifest issues on dev --- .github/workflows/dev.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 46e56f6..2df23b2 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -35,11 +35,11 @@ jobs: - name: 'Checkout GitHub Action' uses: actions/checkout@main - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + # - name: Set up QEMU + # uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v1 - name: 'Login to GitHub Container Registry' uses: docker/login-action@v1 @@ -54,8 +54,7 @@ jobs: IMAGE_TAG: dev SHORT_COMMIT_ID: ${{ github.sha_short }} run: | - docker buildx build \ - --platform linux/amd64,linux/arm64 \ + docker build \ -t $IMAGE_NAME:$IMAGE_TAG \ --label com.decluttarr.version=$IMAGE_TAG \ --label com.decluttarr.commit=$SHORT_COMMIT_ID \ From 4939edb119bc4f6d3f52db18a362f925abad45bf Mon Sep 17 00:00:00 2001 From: Benjamin Harder Date: Mon, 19 Feb 2024 00:46:24 +0100 Subject: [PATCH 12/27] trying to fix short commit ID --- .github/workflows/dev.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 2df23b2..5aba22e 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -48,18 +48,23 @@ jobs: username: ${{github.actor}} password: ${{secrets.GITHUB_TOKEN}} + - name: Store short Commit ID in env variable + id: vars + run: | + calculatedSha=$(git rev-parse --short ${{ github.sha }}) + echo "SHORT_COMMIT_ID=$calculatedSha" >> $GITHUB_ENV + - name: "Build, Tag, and push the Docker image" env: IMAGE_NAME: ghcr.io/manimatter/decluttarr IMAGE_TAG: dev - SHORT_COMMIT_ID: ${{ github.sha_short }} run: | docker build \ -t $IMAGE_NAME:$IMAGE_TAG \ --label com.decluttarr.version=$IMAGE_TAG \ --label com.decluttarr.commit=$SHORT_COMMIT_ID \ --build-arg IMAGE_TAG=$IMAGE_TAG \ - --build-arg SHORT_COMMIT_ID=$SHORT_COMMIT_ID \ + --build-arg SHORT_COMMIT_ID=${{ env.COMMIT_SHORT_SHA }} \ -f docker/Dockerfile \ --push . From df3e4fc1870ea33b5c7e0d362a474da5962c3988 Mon Sep 17 00:00:00 2001 From: Benjamin Harder Date: Mon, 19 Feb 2024 00:49:32 +0100 Subject: [PATCH 13/27] and another try --- .github/workflows/dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 5aba22e..c7ed4ec 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -64,7 +64,7 @@ jobs: --label com.decluttarr.version=$IMAGE_TAG \ --label com.decluttarr.commit=$SHORT_COMMIT_ID \ --build-arg IMAGE_TAG=$IMAGE_TAG \ - --build-arg SHORT_COMMIT_ID=${{ env.COMMIT_SHORT_SHA }} \ + --build-arg SHORT_COMMIT_ID=$COMMIT_SHORT_SHA \ -f docker/Dockerfile \ --push . From 11710a56dcd24330ffc8ca9066263a665e17a013 Mon Sep 17 00:00:00 2001 From: Benjamin Harder Date: Mon, 19 Feb 2024 00:52:37 +0100 Subject: [PATCH 14/27] fixing commit ids.. once again --- .github/workflows/dev.yml | 2 +- .github/workflows/main.yml | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index c7ed4ec..27f891e 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -64,7 +64,7 @@ jobs: --label com.decluttarr.version=$IMAGE_TAG \ --label com.decluttarr.commit=$SHORT_COMMIT_ID \ --build-arg IMAGE_TAG=$IMAGE_TAG \ - --build-arg SHORT_COMMIT_ID=$COMMIT_SHORT_SHA \ + --build-arg SHORT_COMMIT_ID=$SHORT_COMMIT_ID \ -f docker/Dockerfile \ --push . diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 93dfd16..f2176b3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,11 +42,16 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} WITH_V: true + - name: Store short Commit ID in env variable + id: vars + run: | + calculatedSha=$(git rev-parse --short ${{ github.sha }}) + echo "SHORT_COMMIT_ID=$calculatedSha" >> $GITHUB_ENV + - name: "Build, Tag, and push the Docker image" env: IMAGE_NAME: ghcr.io/manimatter/decluttarr IMAGE_TAG: ${{ steps.setversion.outputs.new_tag }} - SHORT_COMMIT_ID: ${{ github.sha_short }} run: | docker buildx build \ --platform linux/amd64,linux/arm64 \ From 1eeea0e92073fb03453342e3dc21f8fced4b5adc Mon Sep 17 00:00:00 2001 From: Benjamin Harder Date: Mon, 19 Feb 2024 00:56:23 +0100 Subject: [PATCH 15/27] fixing.. --- docker/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index d5d76a9..72d41d3 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -6,6 +6,7 @@ FROM python:3.10.13-slim # Define a build-time argument for IMAGE_TAG ARG IMAGE_TAG +ARG SHORT_COMMIT_ID # Set an environment variable using the build-time argument ENV IMAGE_TAG=$IMAGE_TAG From 1d8924fb060b85e9c1afc0dbe8133bed044acc94 Mon Sep 17 00:00:00 2001 From: Benjamin Harder Date: Mon, 19 Feb 2024 00:58:55 +0100 Subject: [PATCH 16/27] trying to fix the buildx issue that leads to manifest problems on dev --- .github/workflows/dev.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 27f891e..9c18e98 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -35,11 +35,11 @@ jobs: - name: 'Checkout GitHub Action' uses: actions/checkout@main - # - name: Set up QEMU - # uses: docker/setup-qemu-action@v1 + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 - name: 'Login to GitHub Container Registry' uses: docker/login-action@v1 @@ -59,7 +59,8 @@ jobs: IMAGE_NAME: ghcr.io/manimatter/decluttarr IMAGE_TAG: dev run: | - docker build \ + docker buildx build \ + --platform linux/amd64,linux/arm64 \ -t $IMAGE_NAME:$IMAGE_TAG \ --label com.decluttarr.version=$IMAGE_TAG \ --label com.decluttarr.commit=$SHORT_COMMIT_ID \ From 7ba1591286279830625669bcb06f54039e24663d Mon Sep 17 00:00:00 2001 From: Benjamin Harder Date: Mon, 19 Feb 2024 01:01:34 +0100 Subject: [PATCH 17/27] trying to fix it.. --- .github/workflows/dev.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 9c18e98..ba69e72 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -59,8 +59,7 @@ jobs: IMAGE_NAME: ghcr.io/manimatter/decluttarr IMAGE_TAG: dev run: | - docker buildx build \ - --platform linux/amd64,linux/arm64 \ + docker build \ -t $IMAGE_NAME:$IMAGE_TAG \ --label com.decluttarr.version=$IMAGE_TAG \ --label com.decluttarr.commit=$SHORT_COMMIT_ID \ From c515abdc6e2e84a6e9639b63fdc9bae1b9b85611 Mon Sep 17 00:00:00 2001 From: Benjamin Harder Date: Mon, 19 Feb 2024 01:08:24 +0100 Subject: [PATCH 18/27] Removed code that creates "manifest unknown" error. Meaning that arm + x86 compatibilty is now removed (happy for somebody to look into dev.yml + main.yml and propose a fix) --- .github/workflows/dev.yml | 23 +++++++++++++++++++---- .github/workflows/main.yml | 26 ++++++++++++++++++++------ 2 files changed, 39 insertions(+), 10 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index ba69e72..1b97360 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -35,11 +35,11 @@ jobs: - name: 'Checkout GitHub Action' uses: actions/checkout@main - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + # - name: Set up QEMU + # uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v1 - name: 'Login to GitHub Container Registry' uses: docker/login-action@v1 @@ -67,6 +67,21 @@ jobs: --build-arg SHORT_COMMIT_ID=$SHORT_COMMIT_ID \ -f docker/Dockerfile \ --push . + + # - name: "Build, Tag, and push the Docker image" + # env: + # IMAGE_NAME: ghcr.io/manimatter/decluttarr + # IMAGE_TAG: dev + # run: | + # docker buildx build \ <<<<<<<<<<<<<<<<<<<<< creates manifest issues... don't know how to solve that + # --platform linux/amd64,linux/arm64 \ <<<<<<<<<<<<<<<<<<<<< creates manifest issues... don't know how to solve that + # -t $IMAGE_NAME:$IMAGE_TAG \ + # --label com.decluttarr.version=$IMAGE_TAG \ + # --label com.decluttarr.commit=$SHORT_COMMIT_ID \ + # --build-arg IMAGE_TAG=$IMAGE_TAG \ + # --build-arg SHORT_COMMIT_ID=$SHORT_COMMIT_ID \ + # -f docker/Dockerfile \ + # --push . - name: "Delete untagged versions" uses: actions/delete-package-versions@v4 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f2176b3..122f1c5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,11 +18,11 @@ jobs: - name: 'Checkout GitHub Action' uses: actions/checkout@main - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + # - name: Set up QEMU + # uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v1 - name: 'Login to GitHub Container Registry' uses: docker/login-action@v1 @@ -53,8 +53,7 @@ jobs: IMAGE_NAME: ghcr.io/manimatter/decluttarr IMAGE_TAG: ${{ steps.setversion.outputs.new_tag }} run: | - docker buildx build \ - --platform linux/amd64,linux/arm64 \ + docker build \ -t $IMAGE_NAME:$IMAGE_TAG \ -t $IMAGE_NAME:latest \ --label com.decluttarr.version=$IMAGE_TAG \ @@ -64,3 +63,18 @@ jobs: -f docker/Dockerfile \ --push . + # - name: "Build, Tag, and push the Docker image" + # env: + # IMAGE_NAME: ghcr.io/manimatter/decluttarr + # IMAGE_TAG: ${{ steps.setversion.outputs.new_tag }} + # run: | + # docker buildx build \ <<<<<<<<<<<<<<<<<<<<< creates manifest issues... don't know how to solve that + # --platform linux/amd64,linux/arm64 \ <<<<<<<<<<<<<<<<<<<<< creates manifest issues... don't know how to solve that + # -t $IMAGE_NAME:$IMAGE_TAG \ + # -t $IMAGE_NAME:latest \ + # --label com.decluttarr.version=$IMAGE_TAG \ + # --label com.decluttarr.commit=$SHORT_COMMIT_ID \ + # --build-arg IMAGE_TAG=$IMAGE_TAG \ + # --build-arg SHORT_COMMIT_ID=$SHORT_COMMIT_ID \ + # -f docker/Dockerfile \ + # --push . \ No newline at end of file From e05bc58166e6ad00b3014ba38205eae481226bce Mon Sep 17 00:00:00 2001 From: Benjamin Harder Date: Mon, 19 Feb 2024 01:12:49 +0100 Subject: [PATCH 19/27] Manifest issues... --- .github/workflows/dev.yml | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 1b97360..8dc91bb 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -25,7 +25,6 @@ jobs: python3 -m pytest --import-mode=append tests/ build-dev: - # if: github.ref == 'refs/heads/dev' needs: unit-tests runs-on: ubuntu-latest defaults: @@ -35,12 +34,6 @@ jobs: - name: 'Checkout GitHub Action' uses: actions/checkout@main - # - name: Set up QEMU - # uses: docker/setup-qemu-action@v1 - - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v1 - - name: 'Login to GitHub Container Registry' uses: docker/login-action@v1 with: @@ -68,20 +61,6 @@ jobs: -f docker/Dockerfile \ --push . - # - name: "Build, Tag, and push the Docker image" - # env: - # IMAGE_NAME: ghcr.io/manimatter/decluttarr - # IMAGE_TAG: dev - # run: | - # docker buildx build \ <<<<<<<<<<<<<<<<<<<<< creates manifest issues... don't know how to solve that - # --platform linux/amd64,linux/arm64 \ <<<<<<<<<<<<<<<<<<<<< creates manifest issues... don't know how to solve that - # -t $IMAGE_NAME:$IMAGE_TAG \ - # --label com.decluttarr.version=$IMAGE_TAG \ - # --label com.decluttarr.commit=$SHORT_COMMIT_ID \ - # --build-arg IMAGE_TAG=$IMAGE_TAG \ - # --build-arg SHORT_COMMIT_ID=$SHORT_COMMIT_ID \ - # -f docker/Dockerfile \ - # --push . - name: "Delete untagged versions" uses: actions/delete-package-versions@v4 From b2f1e149250f554ad00df17b8f72d6f9686c8590 Mon Sep 17 00:00:00 2001 From: Benjamin Harder Date: Mon, 19 Feb 2024 01:14:38 +0100 Subject: [PATCH 20/27] Trying to restore.. --- .github/workflows/dev.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 8dc91bb..ba69e72 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -25,6 +25,7 @@ jobs: python3 -m pytest --import-mode=append tests/ build-dev: + # if: github.ref == 'refs/heads/dev' needs: unit-tests runs-on: ubuntu-latest defaults: @@ -34,6 +35,12 @@ jobs: - name: 'Checkout GitHub Action' uses: actions/checkout@main + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: 'Login to GitHub Container Registry' uses: docker/login-action@v1 with: @@ -60,7 +67,6 @@ jobs: --build-arg SHORT_COMMIT_ID=$SHORT_COMMIT_ID \ -f docker/Dockerfile \ --push . - - name: "Delete untagged versions" uses: actions/delete-package-versions@v4 From 56cd5ce7e78776f040303638a78e737e11bdcb48 Mon Sep 17 00:00:00 2001 From: Benjamin Harder Date: Mon, 19 Feb 2024 01:16:54 +0100 Subject: [PATCH 21/27] trying --- .github/workflows/dev.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index ba69e72..583f6e5 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -35,11 +35,11 @@ jobs: - name: 'Checkout GitHub Action' uses: actions/checkout@main - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + # - name: Set up QEMU + # uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v1 - name: 'Login to GitHub Container Registry' uses: docker/login-action@v1 @@ -59,7 +59,8 @@ jobs: IMAGE_NAME: ghcr.io/manimatter/decluttarr IMAGE_TAG: dev run: | - docker build \ + docker buildx build \ + --platform linux/amd64,linux/arm64 \ -t $IMAGE_NAME:$IMAGE_TAG \ --label com.decluttarr.version=$IMAGE_TAG \ --label com.decluttarr.commit=$SHORT_COMMIT_ID \ From 31759abfb6a1a62a195bed6c041b605da8def817 Mon Sep 17 00:00:00 2001 From: Benjamin Harder Date: Mon, 19 Feb 2024 01:21:34 +0100 Subject: [PATCH 22/27] trying to fix the manifest issues --- .github/workflows/dev.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 583f6e5..beed4e9 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -25,7 +25,6 @@ jobs: python3 -m pytest --import-mode=append tests/ build-dev: - # if: github.ref == 'refs/heads/dev' needs: unit-tests runs-on: ubuntu-latest defaults: @@ -35,11 +34,13 @@ jobs: - name: 'Checkout GitHub Action' uses: actions/checkout@main - # - name: Set up QEMU - # uses: docker/setup-qemu-action@v1 + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + with: + driver-opts: image=ubuntu:latest - name: 'Login to GitHub Container Registry' uses: docker/login-action@v1 @@ -60,6 +61,7 @@ jobs: IMAGE_TAG: dev run: | docker buildx build \ + --driver docker-containerd \ --platform linux/amd64,linux/arm64 \ -t $IMAGE_NAME:$IMAGE_TAG \ --label com.decluttarr.version=$IMAGE_TAG \ From d8998e8a2997e8ee395c377813b933d3d24dfd8f Mon Sep 17 00:00:00 2001 From: Benjamin Harder Date: Mon, 19 Feb 2024 01:25:29 +0100 Subject: [PATCH 23/27] trying --- .github/workflows/dev.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index beed4e9..f1c275d 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -41,6 +41,7 @@ jobs: uses: docker/setup-buildx-action@v1 with: driver-opts: image=ubuntu:latest + version: 0.6.3 - name: 'Login to GitHub Container Registry' uses: docker/login-action@v1 @@ -62,6 +63,7 @@ jobs: run: | docker buildx build \ --driver docker-containerd \ + --progress plain \ --platform linux/amd64,linux/arm64 \ -t $IMAGE_NAME:$IMAGE_TAG \ --label com.decluttarr.version=$IMAGE_TAG \ From 837fa2abc8e44f97f81b01f5bdfe632994af27f7 Mon Sep 17 00:00:00 2001 From: Benjamin Harder Date: Mon, 19 Feb 2024 01:28:27 +0100 Subject: [PATCH 24/27] updgraded buildx version --- .github/workflows/dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index f1c275d..e12a9d2 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -41,7 +41,7 @@ jobs: uses: docker/setup-buildx-action@v1 with: driver-opts: image=ubuntu:latest - version: 0.6.3 + version: 0.12.1 - name: 'Login to GitHub Container Registry' uses: docker/login-action@v1 From 2bf4cd89ea38e81c4701c9135953ad4217760c93 Mon Sep 17 00:00:00 2001 From: Benjamin Harder Date: Mon, 19 Feb 2024 01:29:32 +0100 Subject: [PATCH 25/27] removed specified buidlx version --- .github/workflows/dev.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index e12a9d2..c7a026b 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -41,7 +41,6 @@ jobs: uses: docker/setup-buildx-action@v1 with: driver-opts: image=ubuntu:latest - version: 0.12.1 - name: 'Login to GitHub Container Registry' uses: docker/login-action@v1 From 60de1b747f0fc25d4f6140b61b73fbeec3b17e29 Mon Sep 17 00:00:00 2001 From: Benjamin Harder Date: Mon, 19 Feb 2024 01:32:39 +0100 Subject: [PATCH 26/27] R --- .github/workflows/dev.yml | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index c7a026b..7c6c5b7 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -34,13 +34,11 @@ jobs: - name: 'Checkout GitHub Action' uses: actions/checkout@main - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + # - name: Set up QEMU + # uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - with: - driver-opts: image=ubuntu:latest + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v1 - name: 'Login to GitHub Container Registry' uses: docker/login-action@v1 @@ -60,10 +58,8 @@ jobs: IMAGE_NAME: ghcr.io/manimatter/decluttarr IMAGE_TAG: dev run: | - docker buildx build \ - --driver docker-containerd \ + docker build \ --progress plain \ - --platform linux/amd64,linux/arm64 \ -t $IMAGE_NAME:$IMAGE_TAG \ --label com.decluttarr.version=$IMAGE_TAG \ --label com.decluttarr.commit=$SHORT_COMMIT_ID \ @@ -71,7 +67,23 @@ jobs: --build-arg SHORT_COMMIT_ID=$SHORT_COMMIT_ID \ -f docker/Dockerfile \ --push . - + + # - name: "Build, Tag, and push the Docker image" + # env: + # IMAGE_NAME: ghcr.io/manimatter/decluttarr + # IMAGE_TAG: dev + # run: | + # docker buildx build \ <<<<<<<<<<<<<<<<<<<<< creates manifest issues... don't know how to solve that + # --platform linux/amd64,linux/arm64 \ <<<<<<<<<<<<<<<<<<<<< creates manifest issues... don't know how to solve that + # --progress plain \ + # -t $IMAGE_NAME:$IMAGE_TAG \ + # --label com.decluttarr.version=$IMAGE_TAG \ + # --label com.decluttarr.commit=$SHORT_COMMIT_ID \ + # --build-arg IMAGE_TAG=$IMAGE_TAG \ + # --build-arg SHORT_COMMIT_ID=$SHORT_COMMIT_ID \ + # -f docker/Dockerfile \ + # --push . + - name: "Delete untagged versions" uses: actions/delete-package-versions@v4 with: From 7d93cc69fd5d0af9c8b0adfaffe30fcf5a5c20a2 Mon Sep 17 00:00:00 2001 From: Benjamin Harder Date: Mon, 19 Feb 2024 01:33:22 +0100 Subject: [PATCH 27/27] Removed code that leads to manifest issues --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 122f1c5..7b468f1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -54,6 +54,7 @@ jobs: IMAGE_TAG: ${{ steps.setversion.outputs.new_tag }} run: | docker build \ + --progress plain \ -t $IMAGE_NAME:$IMAGE_TAG \ -t $IMAGE_NAME:latest \ --label com.decluttarr.version=$IMAGE_TAG \ @@ -70,6 +71,7 @@ jobs: # run: | # docker buildx build \ <<<<<<<<<<<<<<<<<<<<< creates manifest issues... don't know how to solve that # --platform linux/amd64,linux/arm64 \ <<<<<<<<<<<<<<<<<<<<< creates manifest issues... don't know how to solve that + # --progress plain \ # -t $IMAGE_NAME:$IMAGE_TAG \ # -t $IMAGE_NAME:latest \ # --label com.decluttarr.version=$IMAGE_TAG \