AntelopeIO / DUNES

Docker Utilities for Node Execution
Other
26 stars 20 forks source link

Convert bootstrap shell and bat files to a common Python file. #208

Closed ScottBailey closed 1 year ago

ScottBailey commented 1 year ago

Will close #202

ScottBailey commented 1 year ago

@iamveritas Please review (run) OSX tests.

ScottBailey commented 1 year ago

That code is so pleasant to read now, thanks Scott.

However it seems, that if we have already existing image then running bootstrap.py doesn't change the leap version.

/edit Tested on Windows. It seems the same issue is for leap on Windows. However --cdt on Windows worked properly.

I'm not sure you are describing a defect. A running container uses the image it's started with. That's not necessarily something we can or should change...

I have added tests to start multiple containers and test that they include the correct versions of leap and cdt.

mikelik commented 1 year ago

However it seems, that if we have already existing image then running bootstrap.py doesn't change the leap version.

/edit Tested on Windows. It seems the same issue is for leap on Windows. However --cdt on Windows worked properly.

I'm not sure you are describing a defect. A running container uses the image it's started with. That's not necessarily something we can or should change...

You are right, bootstrap shouldn't change the existing container. I have checked this works as expected on Linux and Windows now - thanks.

mikelik commented 1 year ago

I run bootstrap.py successfully (it has created dunes:latest image) and after that when I'm starting the container:

mikel@msi:~/repo/DUNE$ docker start dunes_container
Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "exit": executable file not found in $PATH: unknown
Error: failed to start containers: dunes_container

The same happens when I'm starting tests or running ./dunes --start my_node. I'm running Ubuntu 20.

mikelik commented 1 year ago

I run bootstrap.py successfully (it has created dunes:latest image) and after that when I'm starting the container:

mikel@msi:~/repo/DUNE$ docker start dunes_container
Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "exit": executable file not found in $PATH: unknown
Error: failed to start containers: dunes_container

The same happens when I'm starting tests or running ./dunes --start my_node. I'm running Ubuntu 20.

I managed to fix this, so please disregard above comment. I think the reason was that I had some leftovers from tests in src/plugin (probably because I cancelled a running test and it didn't clean up). Anyway after starting from scratch it works.

mikelik commented 1 year ago

How does it work currently if I simply run pytest? I see that by default test_bootstrap.py is executed if no flag is provided (this test is destructive). I thought it shouldn't be executed by default, should it?

mikelik commented 1 year ago

How does it work currently if I simply run pytest? I see that by default test_bootstrap.py is executed if no flag is provided (this test is destructive). I thought it shouldn't be executed by default, should it?

This is fixed in https://github.com/AntelopeIO/DUNE/pull/208/commits/620ba5f4446e5d158026cce38af0ae5d874ff149