deezer / deezer/spleeter

[Bug] Model download URL points to wrong location when splitting on Github Actions runner

Open
#781 0 comments 0 reactions 0 assignees View on GitHub
bug invalid
Dominant language
Python
Stars
28.4k
Forks
3.1k
PR merge metrics
No merged PRs in 30d

Description

- [x] I didn't find a similar issue already open.
- [x] I read the documentation (README AND Wiki)
- [x] I have installed FFMpeg
- [x] My problem is related to Spleeter only, not a derivative product (such as Webapplication, or GUI provided by others)

## Description

Any attempt to run `spleeter` on a [Github Actions runner](https://github.com/features/actions) results in a 404 GET failure at the step for downloading the pre-trained model from spleeter's URL (https://github.com/deezer/spleeter/releases).

Instead, the job attempts to fetch the pretrained model from the current Github repo's URL (https://github.com/my-org/myrepo/releases) , which is non-existent, and returns a `404 Not Found`.

![404 attempting to download model from local repo instead of from spleeter releases](https://user-images.githubusercontent.com/887849/186705498-deb96690-6e35-4a29-bed4-2156e8f3326c.png)

## Root Cause

Spleeter uses the [following environment variables(https://github.com/deezer/spleeter/blob/master/spleeter/model/provider/github.py#L88-L90) for building the fetch URL for its pre-trained, published models:

* `GITHUB_HOST`
* `GITHUB_REPOSITORY`
* `GITHUB_RELEASE`

Unfortunately, `GITHUB_REPOSITORY` is [a reserved environment variable](https://docs.github.com/en/actions/learn-github-actions/environment-variables#:~:text=GITHUB_REPOSITORY,Hello%2DWorld.) in the context of Github Actions, and gets picked up at runtime, resulting in an incorrect destination model URL.

## Solution Options

One alternative is to explicitly set `GITHUB_REPOSITORY` at the time of invocation of spleeter.
```
$ GITHUB_REPOSITORY="deezer/spleeter" poetry run python lib/stem_split.py
```
However, this could introduce undesired side-effects in the Github Action by overriding what should be the original expected value that's set by the environment by default.

A more appropriate solution would be to make the internal usage of spleeter-specific Github environment variables even more distinct, than the current, generic, conflicting names.

## Environment

| | |
| ----------------- | ------------------------------- |
| OS | Linux |
| Installation type | poetry |
| RAM available | plenty |
| Hardware spec | CPU |

Contributor guide

Open the contributing guide

Research direction

Start in spleeter/model/provider/github.py, where GITHUB_HOST, GITHUB_REPOSITORY, and GITHUB_RELEASE are used to build the pretrained-model URL. Review the invocation shown in lib/stem_split.py and reproduce the download on a GitHub Actions runner. Done means the model URL still targets the Spleeter releases when GitHub Actions variables are present, without overriding the runner's environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, python
Domain
devops, machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.