From 62991a6b69fc918b9ba7756c29c129c66063c93e Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Sat, 19 Dec 2020 23:46:45 +0100 Subject: [PATCH] fix frontend and docker build --- .github/workflows/docker-build-multiarch.yml | 14 ++------------ Dockerfile | 2 ++ music_assistant/constants.py | 2 +- music_assistant/managers/streams.py | 4 ++-- music_assistant/web/server.py | 4 ---- 5 files changed, 7 insertions(+), 19 deletions(-) diff --git a/.github/workflows/docker-build-multiarch.yml b/.github/workflows/docker-build-multiarch.yml index 731cdc27..986c7e09 100644 --- a/.github/workflows/docker-build-multiarch.yml +++ b/.github/workflows/docker-build-multiarch.yml @@ -34,7 +34,7 @@ jobs: # If this is git tag, use the tag name as a docker tag elif [[ $GITHUB_REF == refs/tags/* ]]; then - VERSION=${GITHUB_REF} + VERSION=${GITHUB_REF#refs/tags/} fi TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:${SHORTREF}" @@ -65,22 +65,12 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - name: Build uses: docker/build-push-action@v2 with: builder: ${{ steps.buildx.outputs.name }} context: . file: ./Dockerfile - platforms: linux/amd64,linux/arm/v7,linux/arm/v6,linux/arm64 + platforms: linux/amd64,linux/arm/v7,linux/arm64 push: true tags: ${{ steps.prep.outputs.tags }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 04c6371c..05f2009f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,6 +25,8 @@ RUN curl -L -s https://github.com/jemalloc/jemalloc/releases/download/${JEMALLOC | 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 diff --git a/music_assistant/constants.py b/music_assistant/constants.py index f1621681..930e0c1e 100755 --- a/music_assistant/constants.py +++ b/music_assistant/constants.py @@ -1,6 +1,6 @@ """All constants for Music Assistant.""" -__version__ = "0.0.75" +__version__ = "0.0.76" REQUIRED_PYTHON_VER = "3.7" # configuration keys/attributes diff --git a/music_assistant/managers/streams.py b/music_assistant/managers/streams.py index b1f0942a..09141af8 100755 --- a/music_assistant/managers/streams.py +++ b/music_assistant/managers/streams.py @@ -308,13 +308,13 @@ class StreamManager: player_id, ) # run garbage collect manually to avoid too much memory fragmentation - gc.collect() + self.mass.add_job(gc.collect) # end of queue reached, pass last fadeout bits to final output yield last_fadeout_data del last_fadeout_data # END OF QUEUE STREAM # run garbage collect manually to avoid too much memory fragmentation - gc.collect() + self.mass.add_job(gc.collect) LOGGER.info("streaming of queue for player %s completed", player_id) async def async_stream_queue_item( diff --git a/music_assistant/web/server.py b/music_assistant/web/server.py index 67dcc4bd..99a5ce32 100755 --- a/music_assistant/web/server.py +++ b/music_assistant/web/server.py @@ -175,10 +175,6 @@ class WebServer: async def async_index(self, request: web.Request): """Get the index page, redirect if we do not have a web directory.""" # pylint: disable=unused-argument - if not self.mass.config.stored_config["initialized"]: - return web.FileResponse( - os.path.join(os.path.dirname(os.path.abspath(__file__)), "setup.html") - ) html_app = os.path.join( os.path.dirname(os.path.abspath(__file__)), "static/index.html" ) -- 2.34.1