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

Issue building docker image with Dockerfile.base #1293

Closed
giogix2 opened this issue Nov 30, 2024 · 2 comments
Closed

Issue building docker image with Dockerfile.base #1293

giogix2 opened this issue Nov 30, 2024 · 2 comments
Labels
fixed This is fixed internally, and will be merged in the next github sync!

Comments

@giogix2
Copy link
Contributor

giogix2 commented Nov 30, 2024

I've used the docker installation for some local test following the instructions in Installing via Docker. I get an error when the Python requirements are installed, specifically:

1.035 Collecting ml-collections>=0.1.1 (from -r requirements.txt (line 17))
1.056   Downloading ml_collections-0.1.1.tar.gz (77 kB)
1.081   Preparing metadata (setup.py): started
1.146   Preparing metadata (setup.py): finished with status 'error'
1.149   error: subprocess-exited-with-error
1.149   
1.149   × python setup.py egg_info did not run successfully.
1.149   │ exit code: 1
1.149   ╰─> [10 lines of output]
1.149       Traceback (most recent call last):
1.149         File "<string>", line 2, in <module>
1.149         File "<pip-setuptools-caller>", line 14, in <module>
1.149         File "/usr/local/lib/python3.8/dist-packages/setuptools/__init__.py", line 27, in <module>
1.149           from .dist import Distribution
1.149         File "/usr/local/lib/python3.8/dist-packages/setuptools/dist.py", line 30, in <module>
1.149           from . import (
1.149         File "/usr/local/lib/python3.8/dist-packages/setuptools/_entry_points.py", line 45, in <module>
1.149           def validate(eps: metadata.EntryPoints):
1.149       AttributeError: module 'importlib_metadata' has no attribute 'EntryPoints'
1.149       [end of output]
1.149   
1.149   note: This error originates from a subprocess, and is likely not a problem with pip.
1.151 error: metadata-generation-failed
1.151 
1.151 × Encountered error while generating package metadata.
1.151 ╰─> See above for output.
1.151 
1.151 note: This is an issue with the package mentioned above, not pip.
1.151 hint: See above for details.

I was able to solve the problem forcing to reinstall importlib_metadata, as explained in this Stackoverflow post. Basically, I added the command RUN pip install importlib_metadata --force-reinstall before this line in the Dockerfile.base. Is this a known issue? I'm sure there's a more elegant way to fix this.

Unfortunately, after fixing this I get other compliler related issues. In particular, the compiler fails with spiel_utils.cc throwing the following complains:

3.450 In file included from /repo/open_spiel/spiel_utils.cc:15:
3.452 /repo/open_spiel/../open_spiel/spiel_utils.h:51:59: error: no template named 'unique_ptr' in namespace 'std'
3.452 std::ostream& operator<<(std::ostream& stream, const std::unique_ptr<T>& v);
3.452                                                      ~~~~~^
3.463 /repo/open_spiel/../open_spiel/spiel_utils.h:88:59: error: no template named 'unique_ptr' in namespace 'std'
3.463 std::ostream& operator<<(std::ostream& stream, const std::unique_ptr<T>& v) {

My clang++ version is 15.0.0.
This issue can be easily solved by adding the import #include <memory> in spiel_utils.h. I'm sure this is an issue specific with my compliler, but let me know if I should create a merge request adding this line in spiel_utils.h.

@lanctot
Copy link
Collaborator

lanctot commented Dec 1, 2024

Hi @giogix2 ,

We don't maintain the docker file, so someone may have run into this before but it's the first we're hearing about it. Thanks for reporting!

I'd encourage you to submit two PRs:

  • One that adds your command to Dockerfile.base (maybe with a comment pointing to this thread?)
  • The other that adds the missing #include <memory> to spiel_utils.cc

Appreciate this, thanks!

@lanctot lanctot added the fixed This is fixed internally, and will be merged in the next github sync! label Dec 10, 2024
@lanctot
Copy link
Collaborator

lanctot commented Dec 10, 2024

Will be fixed by #1294 and #1295 on next github sync, thanks!

@lanctot lanctot closed this as completed Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed This is fixed internally, and will be merged in the next github sync!
Projects
None yet
Development

No branches or pull requests

2 participants