Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions on using Dockerfile and Ubuntu #82

Closed
noyuzrad opened this issue Apr 4, 2022 · 14 comments
Closed

Questions on using Dockerfile and Ubuntu #82

noyuzrad opened this issue Apr 4, 2022 · 14 comments
Assignees

Comments

@noyuzrad
Copy link

noyuzrad commented Apr 4, 2022

Hi

I tried pip install but it seems that pip does recognize the package.
Also tried to git clone and follow docker installation but failed with errors

Any advice?

@DBraun DBraun self-assigned this Apr 4, 2022
@DBraun
Copy link
Owner

DBraun commented Apr 4, 2022

Hi, sorry the README was misleading about pip on Linux (pip install is for windows/macOS only at the moment). I changed it now. Can you upload some of your log from using the dockerfile?

@noyuzrad
Copy link
Author

noyuzrad commented Apr 5, 2022

Thanks for replying. your package is great. I currently run it Windows but I need to use it on my server which runs ubuntu.
As for the problem I get the below log.
I tried to search it on google but got do dead end

Sending build context to Docker daemon 739.3MB
Step 1/15 : FROM ubuntu:21.04 as ubuntu_base
---> 7cc39f89fa58
Step 2/15 : ARG DEBIAN_FRONTEND=noninteractive
---> Using cache
---> 93c58662358e
Step 3/15 : RUN apt-get update -yq && apt-get install -yq --no-install-recommends ca-certificates build-essential clang pkg-config libboost-all-dev libboost-python-dev libfreetype6-dev libx11-dev libxinerama-dev libxrandr-dev libxcursor-dev mesa-common-dev libasound2-dev freeglut3-dev libxcomposite-dev libcurl4-gnutls-dev git cmake python3 python3.9-dev faust libsamplerate0 libsndfile1 llvm-11 llvm-11-dev && update-ca-certificates && apt-get clean -y
---> Running in 5c0de00836b6
Get:1 http://security.ubuntu.com/ubuntu hirsute-security InRelease [110 kB]
Get:2 http://archive.ubuntu.com/ubuntu hirsute InRelease [269 kB]
Err:1 http://security.ubuntu.com/ubuntu hirsute-security InRelease
gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
Get:3 http://archive.ubuntu.com/ubuntu hirsute-updates InRelease [115 kB]
Err:2 http://archive.ubuntu.com/ubuntu hirsute InRelease
gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
Get:4 http://archive.ubuntu.com/ubuntu hirsute-backports InRelease [101 kB]
Err:3 http://archive.ubuntu.com/ubuntu hirsute-updates InRelease
gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
Err:4 http://archive.ubuntu.com/ubuntu hirsute-backports InRelease
gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
Reading package lists...
W: GPG error: http://security.ubuntu.com/ubuntu hirsute-security InRelease: gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
E: The repository 'http://security.ubuntu.com/ubuntu hirsute-security InRelease' is not signed.
W: GPG error: http://archive.ubuntu.com/ubuntu hirsute InRelease: gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
E: The repository 'http://archive.ubuntu.com/ubuntu hirsute InRelease' is not signed.
W: GPG error: http://archive.ubuntu.com/ubuntu hirsute-updates InRelease: gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
E: The repository 'http://archive.ubuntu.com/ubuntu hirsute-updates InRelease' is not signed.
W: GPG error: http://archive.ubuntu.com/ubuntu hirsute-backports InRelease: gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed

E: The repository 'http://archive.ubuntu.com/ubuntu hirsute-backports InRelease' is not signed.
The command '/bin/sh -c apt-get update -yq && apt-get install -yq --no-install-recommends ca-certificates build-essential clang pkg-config libboost-all-dev libboost-python-dev libfreetype6-dev libx11-dev libxinerama-dev libxrandr-dev libxcursor-dev mesa-common-dev libasound2-dev freeglut3-dev libxcomposite-dev libcurl4-gnutls-dev git cmake python3 python3.9-dev faust libsamplerate0 libsndfile1 llvm-11 llvm-11-dev && update-ca-certificates && apt-get clean -y' returned a non-zero code: 100

@DBraun
Copy link
Owner

DBraun commented Apr 5, 2022

Can you try some of the suggestions here? https://stackoverflow.com/a/51752997

@noyuzrad
Copy link
Author

noyuzrad commented Apr 6, 2022

This did not help

also see that from the error:
W: GPG error: http://security.ubuntu.com/ubuntu hirsute-security InRelease: gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed E: The repository 'http://security.ubuntu.com/ubuntu hirsute-security InRelease' is not signed.

the required packages are gpgv not gnup as in your link. One way or another I installed them all using
sudo apt-get install -y gpgv1

still got failed..

@DBraun
Copy link
Owner

DBraun commented Apr 6, 2022

Is your version of docker recent? https://stackoverflow.com/a/70834272

@noyuzrad
Copy link
Author

noyuzrad commented Apr 6, 2022

yes, I did come across this stackoverflow page as well.
running the commands yields

`Client:
Version: 18.09.4
API version: 1.39
Go version: go1.10.8
Git commit: d14af54266
Built: Wed Mar 27 18:35:44 2019
OS/Arch: linux/amd64
Experimental: false

Server: Docker Engine - Community
Engine:
Version: 18.09.4
API version: 1.39 (minimum version 1.12)
Go version: go1.10.8
Git commit: d14af54
Built: Wed Mar 27 18:01:48 2019
OS/Arch: linux/amd64
Experimental: false
`

@DBraun
Copy link
Owner

DBraun commented Apr 7, 2022

Maybe 18.09.4 is too low? This is the output from the Dockerfile GitHub continuous integration:

2022-04-04T22:20:35.6241368Z Requested labels: ubuntu-latest
2022-04-04T22:20:35.6241415Z Job defined at: DBraun/DawDreamer/.github/workflows/all.yml@refs/tags/v0.6.1
2022-04-04T22:20:35.6241438Z Waiting for a runner to pick up this job...
2022-04-04T22:20:37.3538640Z Job is waiting for a hosted runner to come online.
2022-04-04T22:20:40.4808991Z Job is about to start running on the hosted runner: GitHub Actions 6 (hosted)
2022-04-04T22:20:44.3474742Z Current runner version: '2.289.2'
2022-04-04T22:20:44.3504176Z ##[group]Operating System
2022-04-04T22:20:44.3504720Z Ubuntu
2022-04-04T22:20:44.3505025Z 20.04.4
2022-04-04T22:20:44.3505319Z LTS
2022-04-04T22:20:44.3505595Z ##[endgroup]
2022-04-04T22:20:44.3506036Z ##[group]Virtual Environment
2022-04-04T22:20:44.3506452Z Environment: ubuntu-20.04
2022-04-04T22:20:44.3506766Z Version: 20220330.0
2022-04-04T22:20:44.3507336Z Included Software: https://github.com/actions/virtual-environments/blob/ubuntu20/20220330.0/images/linux/Ubuntu2004-Readme.md
2022-04-04T22:20:44.3508137Z Image Release: https://github.com/actions/virtual-environments/releases/tag/ubuntu20%2F20220330.0
2022-04-04T22:20:44.3508595Z ##[endgroup]
2022-04-04T22:20:44.3508988Z ##[group]Virtual Environment Provisioner
2022-04-04T22:20:44.3509386Z 1.0.0.0-main-20220307-1
2022-04-04T22:20:44.3509754Z ##[endgroup]
2022-04-04T22:20:44.3510783Z ##[group]GITHUB_TOKEN Permissions
2022-04-04T22:20:44.3511467Z Actions: write
2022-04-04T22:20:44.3511972Z Checks: write
2022-04-04T22:20:44.3512369Z Contents: write
2022-04-04T22:20:44.3512721Z Deployments: write
2022-04-04T22:20:44.3513082Z Discussions: write
2022-04-04T22:20:44.3513384Z Issues: write
2022-04-04T22:20:44.3513709Z Metadata: read
2022-04-04T22:20:44.3514081Z Packages: write
2022-04-04T22:20:44.3514375Z Pages: write
2022-04-04T22:20:44.3514715Z PullRequests: write
2022-04-04T22:20:44.3515108Z RepositoryProjects: write
2022-04-04T22:20:44.3515468Z SecurityEvents: write
2022-04-04T22:20:44.3515853Z Statuses: write
2022-04-04T22:20:44.3516196Z ##[endgroup]
2022-04-04T22:20:44.3519900Z Secret source: Actions
2022-04-04T22:20:44.3520482Z Prepare workflow directory
2022-04-04T22:20:44.4351298Z Prepare all required actions
2022-04-04T22:20:44.4534034Z Getting action download info
2022-04-04T22:20:44.6538806Z Download action repository 'actions/checkout@v2' (SHA:ec3a7ce113134d7a93b817d10a8272cb61118579)
2022-04-04T22:20:45.6050054Z Download action repository 'actions/setup-python@v2' (SHA:7f80679172b057fc5e90d70d197929d454754a5a)

It uses 20.04.4, which is still lower than 21.04 but it is higher than 18.09.4

@noyuzrad
Copy link
Author

noyuzrad commented Apr 7, 2022

Yes that was the problem. I thought I had the latest docker. maybe add the docker version for the prerequisites.
However now I don't succeed to import it to pycharm.
My project now look like
<root_directory>
-main.py

-README.md
-...

-...

trying to import via several commands:
import DawDreamer
import DawDreamer.dawdreamer
import dawdreamer
from Dawdreamer import dawdreamer
etc...
FAILS

How should that be imported into my project?
Sorry if its a newbie question but I just could not figure it out alone and no sources on the net

@DBraun
Copy link
Owner

DBraun commented Apr 7, 2022

import dawdreamer
or
import dawdreamer as daw
are the suggested way.

With PyCharm you have to configure the Python interpreter. Did this section work?

DawDreamer/Dockerfile

Lines 52 to 58 in 13cf58a

# Pytest Full Test
RUN apt install -y python3-pip
RUN python3.9 -m pip install librosa scipy numpy pytest
# Basic Import Test
WORKDIR /DawDreamer/tests
RUN python3.9 -c "import dawdreamer; print('DawDreamer was successfully imported in python3.')"

Can you do something like which python3.9 to find where Python is, and then make sure dawdreamer is installed in the lib/site-packages folder?

@DBraun
Copy link
Owner

DBraun commented Apr 7, 2022

bumping because I updated my answer above.

@noyuzrad
Copy link
Author

Still not working.

I attach my output for running the docker and trying to import.
As well, seems dawdreamer does not create its build in lib/site-packages of python3.9.
I tried also to use virtual environment in pycharm with python3.9, including global site-packages. DawDreamer is not imported.
I suspect that DawDreamer does not build at all, or installed to unknown destination.
Also maybe I don't make proper use of docker since I am new to it - should I activate some docker image/environment or something like that?
image

@DBraun
Copy link
Owner

DBraun commented Apr 11, 2022

It looks like you've built the docker image, but now you need to run it.

You can either plainly run it
docker run dawdreamer and then python my_script.py

or configure PyCharm to use it
https://www.jetbrains.com/help/pycharm/using-docker-as-a-remote-interpreter.html#run

@noyuzrad
Copy link
Author

Ok I managed to succeed! I had to dig inside docker as a first timer and it is not that simple.
My steps were to run a modified version of your run command, in order to communicate with the container:
docker run -it dawdreamer /bin/bash

Also, in order to run my script using DawDreamer, I had to

  1. share volume with the container using a fuller instruction:
    docker run -v "<path_to_local_volume>":"<path_at _the_container>" -it dawdreamer /bin/bash
  2. Add my imported packages to your DockerFile where pip install is..
  3. moreover, I had to place the dawdreamer.so file resided in the DawDreamer/tests folder into my own project root folder to be able to access it.

Phiuu that was quite a journey...
Not sure If I did it the most elegant or correct way, but I did.

Thanks for all the ongoing support!

@DBraun DBraun changed the title Can't install DawDreamer in Ubuntu Questions on using Dockerfile and Ubuntu Apr 13, 2022
@DBraun
Copy link
Owner

DBraun commented Apr 13, 2022

Great! If possible, please consider sharing your results when you're done 🎊

@DBraun DBraun closed this as completed Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants