tencent-ailab / hok_env

Honor of Kings AI Open Environment of Tencent
https://aiarena.tencent.com/aiarena/en/open-gamecore
Apache License 2.0
590 stars 68 forks source link

"failed to solve: gamecore: pull access denied, repository does not exist or may require authorization" #47

Closed haopan27 closed 4 months ago

haopan27 commented 4 months ago

Following the doc run_windows_gamecore_on_linux and executing the following commands,

base_image=tencentailab/hok_env:cpu_v2.0.1
target_image=gamecore

docker build -f ./dockerfile/dockerfile.gamecore -t ${target_image} --build-arg BASE_IMAGE=${base_image} .

I encountered the error message below:

[+] Building 2.1s (4/4) FINISHED                                                                                                                                                                                              docker:default
 => [internal] load build definition from dockerfile.gamecore                                                                                                                                                                           0.2s
 => => transferring dockerfile: 1.63kB                                                                                                                                                                                                  0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                       0.3s
 => => transferring context: 231B                                                                                                                                                                                                       0.0s
 => ERROR [internal] load metadata for docker.io/library/gamecore:latest                                                                                                                                                                1.5s
 => CANCELED [internal] load metadata for docker.io/tencentailab/hok_env:cpu_v2.0.1                                                                                                                                                     1.5s
------
 > [internal] load metadata for docker.io/library/gamecore:latest:
------
dockerfile.gamecore:35
--------------------
  33 |     ENV WINEDEBUG=-all
  34 |
  35 | >>> COPY --from=gamecore /tmp/hok_env-master/rl_framework/gamecore/ /tmp/hok_env-master/rl_framework/gamecore/
  36 |     COPY ./license.dat /tmp/hok_env-master/rl_framework/gamecore/core_assets/
  37 |
--------------------
ERROR: failed to solve: gamecore: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed

I did change certain paths in dockerfile.gamecore to match my setup but I don't think this was to blame. Also I tried changing an web address in dockerfile.gamecore to "https://mirrors.tuna.tsinghua.edu.cn/wine-builds/ubuntu/dists/focal/main/", but that didn't fix anything unfortunately. Could anyone please advice how to proceed from here?

hongyangqin commented 4 months ago

Here, multi-stage builds are used, so the "gamecore" image should be built before the final image. The latest Docker client enables BUILDKIT by default, which (maybe) will skip the gamecore stage and cause it to pull a non-existent gamecore image from the remote repository.

Try:

base_image=tencentailab/hok_env:cpu_v2.0.1
target_image=final_gamecore
internal_image=gamecore

docker build -f ./dockerfile/dockerfile.gamecore --target gamecore -t ${internal_image} --build-arg BASE_IMAGE=${base_image} .
docker build -f ./dockerfile/dockerfile.gamecore -t ${target_image} --build-arg BASE_IMAGE=${base_image} .
haopan27 commented 4 months ago

Thanks for the response. With the new set of commands it seemed the build process was successful, at least there was no more error messages. Although I am not certain if the image was built as intended: inside the docker container, the rl_framework folder is yet again missing the gamecore folder, for which I might write another issue about.

hongyangqin commented 4 months ago

@haopan27 The target_image changed above, so the following docker run command should also update the image name.

- docker run -d --name gamecore --network host -e SIMULATOR_USE_WINE=1 -it gamecore sh /rl_framework/remote-gc-server/run_and_monitor_gamecore_server.sh
+ docker run -d --name gamecore --network host -e SIMULATOR_USE_WINE=1 -it final_gamecore sh /rl_framework/remote-gc-server/run_and_monitor_gamecore_server.sh
haopan27 commented 4 months ago

This actually reminded me that the last command you provided, docker build -f ./dockerfile/dockerfile.gamecore -t ${target_image} --build-arg BASE_IMAGE=${base_image} . wasn't completed with success, with the following message: Screen Shot 2024-03-01 at 14 45 37

I initially blamed apt because I am on Centos7 (one should use yum instead). So I substituted yum in inside the dockerfile.gamecore file, but then I was met with yum: command not found which was weird since yum was indeed installed properly. Even if this issue was gone, there's perhaps an even bigger one: I didn't find anything related to wine installation for Centos from this link in the doc run_windows_gamecore_on_linux. Surely one can still install wine, by following, say, this article. But I do not wish to wander too far and could use some of the help here. Really appreciate it.