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

Error when trying to install desktop version #670

Open
TuMK24 opened this issue Aug 11, 2024 · 9 comments
Open

Error when trying to install desktop version #670

TuMK24 opened this issue Aug 11, 2024 · 9 comments

Comments

@TuMK24
Copy link

TuMK24 commented Aug 11, 2024

When I was trying to install the BOPTEST desktop version this week, I found that the docker have trouble finding the restapi.py file even though it is already in the directory. Because of this, the docker container can only run for 1 second and then it is shut down. Can anyone explain why?

@dhblum
Copy link
Collaborator

dhblum commented Aug 19, 2024

Can you please indicate your Operating System and version, BOPTEST version you used, and command(s) you ran to have the error?

@TuMK24
Copy link
Author

TuMK24 commented Aug 19, 2024

My operating system is Windows 11 Enterprise, version is 23H2. BOPTEST version is project1-boptest-0.6.0, which is v0.6.0. I just enter the directory where I install the "project1-boptest-0.6.0" file and then I enter ($env:TESTCASE="multizone_office_simple_air") -and (docker-compose up). And the docker runs for 1 second and it says restapi.py file doesn't exist. Then it basically shuts down.

@dhblum
Copy link
Collaborator

dhblum commented Aug 19, 2024

Thanks. Hm, could there be any issue with Docker accessing files on your hard drive to copy them into the container upon deployment, as defined in the docker-compose.yml here?

And/or, does the Docker image build first when you run that command? Is there any output from the docker build process to indicate an issue? But based on your report of reaspi.py not found (as part of this command, right?), I'm leaning towards something going wrong in Docker's ability to copy the right files into the container as I ask about above, rather than an issue with the image build itself.

@TuMK24
Copy link
Author

TuMK24 commented Aug 20, 2024

Now I even get a new error "- was unexpected at this time." I wonder what happens. Thanks for your help.

@dhblum
Copy link
Collaborator

dhblum commented Aug 20, 2024

Did you change anything to get that new error? What system or software is reporting that new error and in what context?

@TuMK24
Copy link
Author

TuMK24 commented Aug 23, 2024

I had success in installing the boptest v0.4.0, but not the newer versions. I will work on the 0.4.0 version then. Thanks for your help.

@PatrickHenkel1
Copy link

PatrickHenkel1 commented Oct 30, 2024

Hi, I have a similar issue on a Linux Machine (Ubuntu 20.04.6 LTS):
When I try to install the newest Boptest Version (current master) using 'docker-compose up', I get the following output:

Creating boptest_base_boptest_1 ... done
Attaching to boptest_base_boptest_1
boptest_1 | python: can't open file 'restapi.py': [Errno 2] No such file or directory
boptest_base_boptest_1 exited with code 2

When I checkout version v0.5.0 with commit 12ceafe I get the same error. When I checkout version v0.4.0 with commit 3a8c4db everything works fine.

@PatrickHenkel1
Copy link

I was able to fix the problem by changing the APP_PATH in the .env file to '/home/developer'

@dhblum
Copy link
Collaborator

dhblum commented Oct 30, 2024

Thanks for reporting @PatrickHenkel1. This is odd.

The APP_PATH is used to copy repo contents into the Docker container and you can see the Dockerfile creates the directory /home/user. When I checkout master and deploy e.g. TESTCASE=testcase1 docker compose up, and then shell into the running Docker container and look around a bit, I get:

user@4f74906fd899:~$ ls
__pycache__            doc       miniconda     restapi.py   wrapped_log.txt
boptest_testcase1.log  forecast  miniconda.sh  testcase.py  wrapped_result.mat
data                   kpis      models        version.txt
user@4f74906fd899:~$ pwd
/home/user

You can see the correct APP_PATH should be /home/user/restapi.py, not /home/developer/restapi.py as your fix would indicate.

If I change APP_PATH to /home/developer and try to TESTCASE=testcase1 docker compose up, I get:

$ TESTCASE=testcase1 docker compose up
WARN[0000] /home/dhbubu20/git/ibpsa/project1-boptest/project1-boptest/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion 
[+] Running 2/2
 ✔ Network boptest-net                   Created                                                                                             0.1s 
 ✔ Container project1-boptest-boptest-1  Created                                                                                             0.0s 
Attaching to boptest-1
boptest-1  | python: can't open file '/home/user/restapi.py': [Errno 2] No such file or directory
boptest-1 exited with code 2

That is, similar error you get before changing to /home/developer.

Now, the Dockerfile we use to create a Docker container used in unit testing and for test case compilation using JModelica, which is different from the runtime container to run a test case, actually does have a directory /home/developer.

I'm not exactly sure what's going on in your setup, but shedding some light in the hope we can figure it out.

Note that I'm doing this testing on Ubuntu 20.04.6 LTS with Docker version 27.3.1, build ce12230.

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

3 participants