--- /dev/null
+name: Build multiarch Docker image (Alpine based)
+
+on:
+ push:
+ release:
+ types: [published, prereleased]
+ workflow_dispatch:
+ inputs:
+ logLevel:
+ description: 'Log level'
+ required: true
+ default: 'warning'
+ tag:
+ description: 'Tag to set on docker image (e.g. 0.0.1'
+ required: true
+
+jobs:
+ buildx:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+
+ - name: Prepare
+ id: prep
+ run: |
+ DOCKER_IMAGE=musicassistant/music-assistant
+ VERSION=latest
+ SHORTREF=${GITHUB_SHA::8}
+ MANUAL_TAG=${{ github.event.inputs.tag }}
+
+ # If a manual tag was supplied, use that
+ if [[ -n $MANUAL_TAG ]]; then
+ VERSION=${MANUAL_TAG}
+
+ # If this is git tag, use the tag name as a docker tag
+ elif [[ $GITHUB_REF == refs/tags/* ]]; then
+ VERSION=${GITHUB_REF#refs/tags/}
+ fi
+ TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:${SHORTREF}"
+
+ # If the VERSION looks like a version number, assume that
+ # this is the most recent version of the image and also
+ # tag it 'latest'.
+ if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
+ TAGS="$TAGS,${DOCKER_IMAGE}:latest"
+ fi
+
+ # Set output parameters.
+ echo ::set-output name=tags::${TAGS}
+ echo ::set-output name=docker_image::${DOCKER_IMAGE}
+
+ - name: Set up QEMU
+ uses: docker/setup-qemu-action@v1
+ with:
+ platforms: all
+
+ - name: Set up Docker Buildx
+ id: buildx
+ uses: docker/setup-buildx-action@v1
+
+ - name: Login to DockerHub
+ uses: docker/login-action@v1
+ with:
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
+
+ - name: Build
+ uses: docker/build-push-action@v2
+ with:
+ builder: ${{ steps.buildx.outputs.name }}
+ context: .
+ file: ./Dockerfile.alpine
+ platforms: linux/amd64,linux/arm/v7,linux/arm64
+ push: true
+ tags: ${{ steps.prep.outputs.tags }}
+++ /dev/null
-name: Build multiarch Docker image
-
-on:
- release:
- types: [published, prereleased]
- workflow_dispatch:
- inputs:
- logLevel:
- description: 'Log level'
- required: true
- default: 'warning'
- tag:
- description: 'Tag to set on docker image (e.g. 0.0.1'
- required: true
-
-jobs:
- buildx:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v2
-
- - name: Prepare
- id: prep
- run: |
- DOCKER_IMAGE=${{ secrets.DOCKER_USERNAME }}/music-assistant
- VERSION=latest
- SHORTREF=${GITHUB_SHA::8}
- MANUAL_TAG=${{ github.event.inputs.tag }}
-
- # If a manual tag was supplied, use that
- if [[ -n $MANUAL_TAG ]]; then
- VERSION=${MANUAL_TAG}
-
- # If this is git tag, use the tag name as a docker tag
- elif [[ $GITHUB_REF == refs/tags/* ]]; then
- VERSION=${GITHUB_REF#refs/tags/}
- fi
- TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:${SHORTREF}"
-
- # If the VERSION looks like a version number, assume that
- # this is the most recent version of the image and also
- # tag it 'latest'.
- if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
- TAGS="$TAGS,${DOCKER_IMAGE}:latest"
- fi
-
- # Set output parameters.
- echo ::set-output name=tags::${TAGS}
- echo ::set-output name=docker_image::${DOCKER_IMAGE}
-
- - name: Set up QEMU
- uses: docker/setup-qemu-action@master
- with:
- platforms: all
-
- - name: Set up Docker Buildx
- id: buildx
- uses: docker/setup-buildx-action@master
-
- - name: Login to DockerHub
- if: github.event_name != 'pull_request'
- uses: docker/login-action@v1
- with:
- username: ${{ secrets.DOCKER_USERNAME }}
- password: ${{ secrets.DOCKER_PASSWORD }}
-
- - name: Build
- uses: docker/build-push-action@v2
- with:
- builder: ${{ steps.buildx.outputs.name }}
- context: .
- file: ./Dockerfile
- platforms: linux/amd64,linux/arm/v7,linux/arm64
- push: true
- tags: ${{ steps.prep.outputs.tags }}
--- /dev/null
+name: Build multiarch Docker image (Debian based)
+
+on:
+ push:
+ release:
+ types: [published, prereleased]
+ workflow_dispatch:
+ inputs:
+ logLevel:
+ description: 'Log level'
+ required: true
+ default: 'warning'
+ tag:
+ description: 'Tag to set on docker image (e.g. 0.0.1'
+ required: true
+
+jobs:
+ buildx:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+
+ - name: Prepare
+ id: prep
+ run: |
+ DOCKER_IMAGE=musicassistant/music-assistant-server
+ VERSION=latest
+ SHORTREF=${GITHUB_SHA::8}
+ MANUAL_TAG=${{ github.event.inputs.tag }}
+
+ # If a manual tag was supplied, use that
+ if [[ -n $MANUAL_TAG ]]; then
+ VERSION=${MANUAL_TAG}
+
+ # If this is git tag, use the tag name as a docker tag
+ elif [[ $GITHUB_REF == refs/tags/* ]]; then
+ VERSION=${GITHUB_REF#refs/tags/}
+ fi
+ TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:${SHORTREF}"
+
+ # If the VERSION looks like a version number, assume that
+ # this is the most recent version of the image and also
+ # tag it 'latest'.
+ if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
+ TAGS="$TAGS,${DOCKER_IMAGE}:latest"
+ fi
+
+ # Set output parameters.
+ echo ::set-output name=tags::${TAGS}
+ echo ::set-output name=docker_image::${DOCKER_IMAGE}
+
+ - name: Set up QEMU
+ uses: docker/setup-qemu-action@v1
+ with:
+ platforms: all
+
+ - name: Set up Docker Buildx
+ id: buildx
+ uses: docker/setup-buildx-action@v1
+
+ - name: Login to DockerHub
+ uses: docker/login-action@v1
+ with:
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
+
+ - name: Build
+ uses: docker/build-push-action@v2
+ with:
+ builder: ${{ steps.buildx.outputs.name }}
+ context: .
+ file: ./Dockerfile
+ platforms: linux/amd64,linux/arm/v7,linux/arm64
+ push: true
+ tags: ${{ steps.prep.outputs.tags }}
"python.linting.pylintEnabled": true,
"python.linting.pylintArgs": ["--rcfile=${workspaceFolder}/setup.cfg"],
"python.linting.enabled": true,
- "python.pythonPath": "venv/bin/python",
+ "python.pythonPath": "/Users/marcelvanderveldt/Workdir/music-assistant/server/.venv/bin/python3",
"python.linting.flake8Enabled": true,
"python.linting.flake8Args": ["--config=${workspaceFolder}/setup.cfg"],
"python.linting.mypyEnabled": false,
-FROM python:3.8-slim as builder
+FROM musicassistant/base-image
-ENV PIP_EXTRA_INDEX_URL=https://www.piwheels.org/simple
-
-RUN set -x \
- # Install buildtime packages
- && apt-get update && apt-get install -y --no-install-recommends \
- curl \
- ca-certificates \
- build-essential \
- gcc \
- libtag1-dev \
- libffi-dev \
- libssl-dev \
- zlib1g-dev \
- xvfb \
- tcl8.6-dev \
- tk8.6-dev \
- libjpeg-turbo-progs \
- libjpeg62-turbo-dev
-
-# build jemalloc
-ARG JEMALLOC_VERSION=5.2.1
-RUN curl -L -s https://github.com/jemalloc/jemalloc/releases/download/${JEMALLOC_VERSION}/jemalloc-${JEMALLOC_VERSION}.tar.bz2 \
- | tar -xjf - -C /tmp \
- && cd /tmp/jemalloc-${JEMALLOC_VERSION} \
- && ./configure \
- && NB_CORES=$(grep -c '^processor' /proc/cpuinfo) \
- && export MAKEFLAGS="-j$((NB_CORES+1)) -l${NB_CORES}" \
- && make \
- && make install
-
-# build python wheels
-WORKDIR /wheels
+# install latest version
COPY . /tmp
-RUN pip wheel uvloop cchardet aiodns brotlipy \
- && pip wheel -r /tmp/requirements.txt \
+RUN cd /tmp \
# Include frontend-app in the source files
&& curl -L https://github.com/music-assistant/app/archive/master.tar.gz | tar xz \
&& mv app-master/docs /tmp/music_assistant/web/static \
- && pip wheel /tmp
-
-#### FINAL IMAGE
-FROM python:3.8-slim AS final-image
-
-WORKDIR /wheels
-COPY --from=builder /wheels /wheels
-COPY --from=builder /usr/local/lib/libjemalloc.so /usr/local/lib/libjemalloc.so
-RUN set -x \
- # Install runtime dependency packages
- && apt-get update \
- && apt-get install -y --no-install-recommends \
- curl \
- tzdata \
- ca-certificates \
- flac \
- sox \
- libsox-fmt-all \
- ffmpeg \
- libtag1v5 \
- openssl \
- libjpeg62-turbo \
- zlib1g \
- # install music assistant (and all it's dependencies) using the prebuilt wheels
- && pip install --no-cache-dir -f /wheels music_assistant \
+ && pip install --no-cache-dir music_assistant \
# cleanup
- && rm -rf /tmp/* \
- && rm -rf /wheels \
- && rm -rf /var/lib/apt/lists/* \
- && rm -rf /root/*
+ && rm -rf /tmp/*
-ENV DEBUG=false
EXPOSE 8095/tcp
VOLUME [ "/data" ]
-ENV LD_PRELOAD=/usr/local/lib/libjemalloc.so
ENTRYPOINT ["mass", "--config", "/data"]
\ No newline at end of file
+++ /dev/null
-FROM python:3.8-alpine3.12
-
-ARG JEMALLOC_VERSION=5.2.1
-WORKDIR /tmp
-COPY . .
-
-# Install packages
-RUN set -x \
- && apk update \
- && echo "http://dl-8.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
- && echo "http://dl-8.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
- # install default packages
- && apk add --no-cache \
- tzdata \
- ca-certificates \
- curl \
- flac \
- sox \
- libuv \
- ffmpeg \
- uchardet \
- taglib \
- libressl \
- # dependencies for pillow
- freetype \
- lcms2 \
- libimagequant \
- libjpeg-turbo \
- libwebp \
- libxcb \
- openjpeg \
- tiff \
- zlib \
- # install (temp) build packages
- && apk add --no-cache --virtual .build-deps \
- build-base \
- libsndfile-dev \
- taglib-dev \
- gcc \
- musl-dev \
- freetype-dev \
- libpng-dev \
- libressl-dev \
- fribidi-dev \
- harfbuzz-dev \
- jpeg-dev \
- lcms2-dev \
- openjpeg-dev \
- tcl-dev \
- tiff-dev \
- tk-dev \
- zlib-dev \
- libuv-dev \
- libffi-dev \
- uchardet-dev \
- # setup jemalloc
- && curl -L -f -s "https://github.com/jemalloc/jemalloc/releases/download/${JEMALLOC_VERSION}/jemalloc-${JEMALLOC_VERSION}.tar.bz2" \
- | tar -xjf - -C /tmp \
- && cd /tmp/jemalloc-${JEMALLOC_VERSION} \
- && ./configure \
- && make \
- && make install \
- && cd /tmp \
- # make sure optional packages are installed
- && pip install uvloop cchardet aiodns brotlipy \
- # install music assistant
- && pip install . \
- # cleanup build files
- && apk del .build-deps \
- && rm -rf /tmp/*
-
-ENV DEBUG=false
-EXPOSE 8095/tcp
-
-VOLUME [ "/data" ]
-
-ENV LD_PRELOAD=/usr/local/lib/libjemalloc.so
-ENTRYPOINT ["mass", "--config", "/data"]
\ No newline at end of file
"""All constants for Music Assistant."""
-__version__ = "0.0.84"
+__version__ = "0.0.85"
REQUIRED_PYTHON_VER = "3.7"
# configuration keys/attributes
if media_item.media_type == MediaType.Radio:
full_track = media_item
else:
- full_track = await self.async_get_track(
- media_item.item_id, media_item.provider
+ full_track = (
+ await self.async_get_track(media_item.item_id, media_item.provider)
+ or media_item
)
# sort by quality and check track availability
for prov_media in sorted(
from enum import Enum
from typing import AsyncGenerator, List, Optional, Tuple
-from aiofile import AIOFile, Reader
+import aiofiles
from music_assistant.constants import (
CONF_MAX_SAMPLE_RATE,
EVENT_STREAM_ENDED,
audio_data += chunk
# stream from file
elif stream_type == StreamType.FILE:
- async with AIOFile(stream_path) as afp:
- async for chunk in Reader(afp):
+ async with aiofiles.open(stream_path) as afp:
+ async for chunk in afp:
yield chunk
if needs_analyze and len(audio_data) < 100000000:
audio_data += chunk
aiohttp[speedups]==3.7.3
pychromecast==8.1.0
asyncio-throttle==1.0.1
-aiofile==3.3.3
+aiofiles==0.6.0
aiosqlite==0.16.0
pytaglib==1.4.6
python-slugify==4.0.1