scql icon indicating copy to clipboard operation
scql copied to clipboard

bash build.sh构建scql镜像报错

Open guanglaiguo opened this issue 1 year ago • 40 comments

Issue Type

Others

Have you searched for existing issues?

Yes

Link to Relevant Documentation

https://github.com/secretflow/scql/tree/main/docker

Question Details

从github上下载了scql源码压缩包scql-main.zip后解压,并在scql-main/docker目录下执行bash build.sh构建scql镜像时报错,如下:
[root@localhost docker]# bash build.sh 
+++ dirname build.sh
++ cd .
++ pwd
+ SCRIPT_DIR=/scql-main/docker
++ cd /scql-main/docker/..
++ pwd
+ WORK_DIR=/scql-main
+ echo 'build image scql:latest'
build image scql:latest
+ MOUNT_OPTIONS=
+ false
++ arch
+ MACHINE_TYPE=x86_64
+ HOST_PLATFORM=
+ '[' x86_64 == x86_64 ']'
+ HOST_PLATFORM=linux/amd64
+ '[' -z '' ']'
+ TARGET_PLATFORM=linux/amd64
+ BUILDER=secretflow/scql-ci:latest
+ '[' ubuntu == anolis ']'
++ docker run -it --rm --detach --mount type=bind,source=/scql-main,target=/home/admin/dev/ -w /home/admin/dev secretflow/scql-ci:latest tail -f /dev/null
Unable to find image 'secretflow/scql-ci:latest' locally
docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).
See 'docker run --help'.
+ container_id=

请问,这个问题如何解决??

guanglaiguo avatar Sep 24 '24 03:09 guanglaiguo

这个一个是网络问题,原因是拉不到secretflow/scql-ci:latest这个镜像导致docker报错。 你可以尝试参考链接中的dockerfile自行构建scql-ci镜像来解决这个问题。

wangzul avatar Sep 24 '24 03:09 wangzul

@wangzul 这个网络问题有直接的解决方案么?本人技术小白,参考dockerfile自行构建scql-ci镜像这种方式能否具体说一下流程呢?感谢感谢~

guanglaiguo avatar Sep 24 '24 06:09 guanglaiguo

@wangzul 这个网络问题有直接的解决方案么?本人技术小白,参考dockerfile自行构建scql-ci镜像这种方式能否具体说一下流程呢?感谢感谢~

我想了解一下你这边为什么要构建镜像。

wangzul avatar Sep 24 '24 07:09 wangzul

@wangzul 这个网络问题有直接的解决方案么?本人技术小白,参考dockerfile自行构建scql-ci镜像这种方式能否具体说一下流程呢?感谢感谢~

你可以尝试拉取一下ubuntu:jammy镜像 docker pull ubuntu:jammy 如果可行的话在尝试构建dockerfile

wangzul avatar Sep 24 '24 07:09 wangzul

@wangzul 考虑到后续可能会根据实际需求修改scql源码,所以在尝试构建新的镜像

guanglaiguo avatar Sep 25 '24 01:09 guanglaiguo

@wangzul 考虑到后续可能会根据实际需求修改scql源码,所以在尝试构建新的镜像

自行查询如何配置一下docker 配置完成在尝试能否拉下来镜像docker pull secretflow/scql-ci:latest

wangzul avatar Sep 25 '24 02:09 wangzul

@wangzul 直接注册国内镜像源配置完docker后,拉取镜像失败呢? 微信图片_20240925142154

guanglaiguo avatar Sep 25 '24 06:09 guanglaiguo

@wangzul 直接注册国内镜像源配置完docker后,拉取镜像失败呢? 微信图片_20240925142154

可以查看那个网站看一下评论,看有没有其他方法,重新调整后 执行docker pull secretflow/scql-ci:latest docker pull ubuntu:jammy 看那个能拉下最好尝试3-5次

wangzul avatar Sep 25 '24 06:09 wangzul

@wangzul 注册国内镜像源后拉取docker pull secretflow/scql-ci:latest不行,但是docker pull ubuntu:jammy可以 [root@localhost /]# docker pull ubuntu:jammy jammy: Pulling from library/ubuntu 6414378b6477: Pull complete Digest: sha256:58b87898e82351c6cf9cf5b9f3c20257bb9e2dcf33af051e12ce532d7f94e3fe Status: Downloaded newer image for ubuntu:jammy docker.io/library/ubuntu:jammy

guanglaiguo avatar Sep 25 '24 06:09 guanglaiguo

@wangzul 注册国内镜像源后拉取docker pull secretflow/scql-ci:latest不行,但是docker pull ubuntu:jammy可以 [root@localhost /]# docker pull ubuntu:jammy jammy: Pulling from library/ubuntu 6414378b6477: Pull complete Digest: sha256:58b87898e82351c6cf9cf5b9f3c20257bb9e2dcf33af051e12ce532d7f94e3fe Status: Downloaded newer image for ubuntu:jammy docker.io/library/ubuntu:jammy

docker pull openanolis/anolisos:8.6 能拉下来吗?如果不能的话尝试拉取centos:centos8

上方条件满足才可 先构建ubuntu-base-ci.DockerFile代码拉到本地使用docker build -t secretflow/ubuntu-base-ci:latest -f ubuntu-base-ci.DockerFile .

重复上方操作构建scql-ci docker build -t secretflow/scql-ci:latest -f scql-ci.DockerFile .

注意docker build 最后有个点也是命令的一部分,2这个镜像如果都可以构建成功就可以尝试重新构建scql

wangzul avatar Sep 25 '24 06:09 wangzul

@wangzul 刚试了一下,docker pull openanolis/anolisos:8.6不行,docker pull centos:centos8可以 [root@localhost /]# docker pull openanolis/anolisos:8.6 Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) [root@localhost /]# docker pull centos:centos8 centos8: Pulling from library/centos a1d0c7532777: Pull complete Digest: sha256:a27fd8080b517143cbbbab9dfb7c8571c40d67d534bbdee55bd6c473f432b177 Status: Downloaded newer image for centos:centos8 docker.io/library/centos:centos8 那我是不是可以按照您说的两步操作构建scql了?

guanglaiguo avatar Sep 25 '24 06:09 guanglaiguo

@wangzul 刚试了一下,docker pull openanolis/anolisos:8.6不行,docker pull centos:centos8可以 [root@localhost /]# docker pull openanolis/anolisos:8.6 Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) [root@localhost /]# docker pull centos:centos8 centos8: Pulling from library/centos a1d0c7532777: Pull complete Digest: sha256:a27fd8080b517143cbbbab9dfb7c8571c40d67d534bbdee55bd6c473f432b177 Status: Downloaded newer image for centos:centos8 docker.io/library/centos:centos8 那我是不是可以按照您说的两步操作构建scql了?

是的,2个镜像构建成功后修改一下这个文件的基础镜像改为centos:centos8 image

wangzul avatar Sep 25 '24 07:09 wangzul

@wangzul 在第一步执行docker build -t secretflow/ubuntu-base-ci:latest -f ubuntu-base-ci.DockerFile .构建secretflow/ubuntu-base-ci:latest时报错了: [root@localhost dockerfiles]# pwd /devtools-main/dockerfiles [root@localhost dockerfiles]# docker build -t secretflow/ubuntu-base-ci:latest -f ubuntu-base-ci.DockerFile . [+] Building 7.1s (6/11) docker:default => [internal] load build definition from ubuntu-base-ci.DockerFile 0.0s => => transferring dockerfile: 2.05kB 0.0s => [internal] load metadata for docker.io/library/ubuntu:jammy 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [1/8] FROM docker.io/library/ubuntu:jammy 0.0s => CACHED [2/8] RUN ln -sf /bin/bash /bin/sh 0.0s => ERROR [3/8] RUN apt update && apt upgrade -y && apt install -y gcc-11 g++-11 lib 7.1s

[3/8] RUN apt update && apt upgrade -y && apt install -y gcc-11 g++-11 libasan6 git wget curl unzip autoconf make lld-15 cmake ninja-build vim-common libgl1 libglib2.0-0 && DEBIAN_FRONTEND=noninteractive apt install -y tzdata && apt clean && update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100 && update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 && update-alternatives --install /usr/bin/ld.lld ld.lld /usr/bin/ld.lld-15 100: 0.143 0.143 WARNING: apt does not have a stable CLI interface. Use with caution in scripts. 0.143 1.013 Get:1 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB] 1.296 Get:2 http://security.ubuntu.com/ubuntu jammy-security InRelease [129 kB] 2.547 Get:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [128 kB] 2.927 Get:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [127 kB] 3.284 Get:5 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [17.5 MB] 5.970 Get:6 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1792 kB] 6.162 Get:7 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [266 kB] 6.175 Get:8 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 Packages [164 kB] 6.241 Get:9 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [81.4 kB] 6.248 Get:10 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [33.7 kB] 6.543 Reading package lists... 6.998 E: Release file for http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease is not valid yet (invalid for another 5d 15h 51min 20s). Updates for this repository will not be applied. 6.999 E: Release file for http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease is not valid yet (invalid for another 5d 15h 52min 44s). Updates for this repository will not be applied.


ubuntu-base-ci.DockerFile:10

9 |
10 | >>> RUN apt update
11 | >>> && apt upgrade -y
12 | >>> && apt install -y gcc-11 g++-11 libasan6
13 | >>> git wget curl unzip autoconf make lld-15
14 | >>> cmake ninja-build vim-common libgl1 libglib2.0-0
15 | >>> && DEBIAN_FRONTEND=noninteractive apt install -y tzdata
16 | >>> && apt clean
17 | >>> && update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100
18 | >>> && update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100
19 | >>> && update-alternatives --install /usr/bin/ld.lld ld.lld /usr/bin/ld.lld-15 100 20 |

ERROR: failed to solve: process "/bin/sh -c apt update && apt upgrade -y && apt install -y gcc-11 g++-11 libasan6 git wget curl unzip autoconf make lld-15 cmake ninja-build vim-common libgl1 libglib2.0-0 && DEBIAN_FRONTEND=noninteractive apt install -y tzdata && apt clean && update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100 && update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 && update-alternatives --install /usr/bin/ld.lld ld.lld /usr/bin/ld.lld-15 100" did not complete successfully: exit code: 100

请问,这是什么问题呢?

guanglaiguo avatar Sep 25 '24 07:09 guanglaiguo

ERROR: failed to solve: process "/bin/sh -c apt update && apt upgrade -y && apt install -y gcc-11 g++-11 libasan6 git wget curl unzip autoconf make lld-15 cmake ninja-build vim-common libgl1 libglib2.0-0 && DEBIAN_FRONTEND=noninteractive apt install -y tzdata && apt clean && update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100 && update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 && update-alternatives --install /usr/bin/ld.lld ld.lld /usr/bin/ld.lld-15 100" did not complete successfully: exit code: 100

docker build --no-cache -t secretflow/ubuntu-base-ci:latest -f ubuntu-base-ci.DockerFile . 再试一次

wangzul avatar Sep 25 '24 07:09 wangzul

@wangzul 还是不行。我gpt了一下,给的解释是:,Docker 构建过程中在执行 apt update 时遇到了问题。具体来说,安全更新和常规更新的发布文件尚未有效(它们将在未来几天内变得有效)。这通常是由于系统时间不正确或者镜像中的软件源配置指向了未来的版本。

guanglaiguo avatar Sep 25 '24 07:09 guanglaiguo

@wangzul 还是不行。我gpt了一下,给的解释是:,Docker 构建过程中在执行 apt update 时遇到了问题。具体来说,安全更新和常规更新的发布文件尚未有效(它们将在未来几天内变得有效)。这通常是由于系统时间不正确或者镜像中的软件源配置指向了未来的版本。

Dockerfile是没问题已经验证过的,你检查一下系统时间看看。

wangzul avatar Sep 25 '24 07:09 wangzul

@wangzul 使用date检查系统时间如下: [root@localhost dockerfiles]# date 2024年 09月 19日 星期四 22:30:40 CST 这是不是表明系统时间不正确,需要校正为当前时间?然后再尝试重新构建

guanglaiguo avatar Sep 25 '24 07:09 guanglaiguo

@wangzul 使用date检查系统时间如下: [root@localhost dockerfiles]# date 2024年 09月 19日 星期四 22:30:40 CST 这是不是表明系统时间不正确,需要校正为当前时间?然后再尝试重新构建

你试一下,应该是时间的问题。

wangzul avatar Sep 25 '24 08:09 wangzul

@wangzul 经验证是时间问题,执行如下系统时间修正后,2个镜像secretflow/ubuntu-base-ci:latest和secretflow/scql-ci:latest可以依次顺利构建。 timedatectl set-ntp false timedatectl set-time "2024-09-25 16:25:00" timedatectl set-ntp true

另外,您说构建完成后,需要修改scql-anolis.Dockerfile内容如下 Snipaste_2024-09-25_16-44-49 请问, scql-anolis.Dockerfile文件名需要修改么? 上述工作完成后,是不是就可以直接执行bash build.sh了?

guanglaiguo avatar Sep 25 '24 08:09 guanglaiguo

@wangzul 经验证是时间问题,执行如下系统时间修正后,2个镜像secretflow/ubuntu-base-ci:latest和secretflow/scql-ci:latest可以依次顺利构建。 timedatectl set-ntp false timedatectl set-time "2024-09-25 16:25:00" timedatectl set-ntp true

另外,您说构建完成后,需要修改scql-anolis.Dockerfile内容如下 Snipaste_2024-09-25_16-44-49 请问, scql-anolis.Dockerfile文件名需要修改么? 上述工作完成后,是不是就可以直接执行bash build.sh了?

先修改scql-anolis.Dockerfile文件中第一行openanolis/anolisos:8.6 替换为centos:centos8 防止拉不下anolisos:8.6报错,修改完成后执行build.sh

wangzul avatar Sep 25 '24 08:09 wangzul

@wangzul 执行bash build.sh后,报错如下: [root@localhost docker]# bash build.sh +++ dirname build.sh ++ cd . ++ pwd

  • SCRIPT_DIR=/scql-main/docker ++ cd /scql-main/docker/.. ++ pwd
  • WORK_DIR=/scql-main
  • echo 'build image scql:latest' build image scql:latest
  • MOUNT_OPTIONS=
  • false ++ arch
  • MACHINE_TYPE=x86_64
  • HOST_PLATFORM=
  • '[' x86_64 == x86_64 ']'
  • HOST_PLATFORM=linux/amd64
  • '[' -z '' ']'
  • TARGET_PLATFORM=linux/amd64
  • BUILDER=secretflow/scql-ci:latest
  • '[' ubuntu == anolis ']' ++ docker run -it --rm --detach --mount type=bind,source=/scql-main,target=/home/admin/dev/ -w /home/admin/dev secretflow/scql-ci:latest tail -f /dev/null
  • container_id=c68c98f194288c14be8234be3e6f4e3b4234a0907cc9fe44f785b493027dcf6c
  • trap 'docker stop c68c98f194288c14be8234be3e6f4e3b4234a0907cc9fe44f785b493027dcf6c' EXIT
  • docker exec -it c68c98f194288c14be8234be3e6f4e3b4234a0907cc9fe44f785b493027dcf6c bash -c 'git config --global --add safe.directory /home/admin/dev'
  • docker exec -it c68c98f194288c14be8234be3e6f4e3b4234a0907cc9fe44f785b493027dcf6c bash -c 'cd /home/admin/dev && make binary' rm -f bin/* rm -f *.coverprofile Found go go: github.com/golang/mock/[email protected]: github.com/golang/mock/[email protected]: Get "https://proxy.golang.org/github.com/golang/mock/mockgen/@v/v1.6.0.info": dial tcp 142.251.42.241:443: connect: connection refused make: *** [Makefile:85: GO-package] Error 1
  • docker stop c68c98f194288c14be8234be3e6f4e3b4234a0907cc9fe44f785b493027dcf6c c68c98f194288c14be8234be3e6f4e3b4234a0907cc9fe44f785b493027dcf6c 请问,是go出现问题了么?我设置了go环境变量export GOPROXY=https://goproxy.io,direct后也没用

guanglaiguo avatar Sep 25 '24 09:09 guanglaiguo

go env -w GOPROXY=https://goproxy.cn,direct/

image 复制121行至122行 代码修改-c 内容为go env -w GOPROXY=https://goproxy.cn,direct/ 试一下

wangzul avatar Sep 25 '24 09:09 wangzul

@wangzul 按照您的指示,修改如下 image

prepare for git command

docker exec -it ${container_id} bash -c "git config --global --add safe.directory /home/admin/dev" docker exec -it ${container_id} bash -c "go env -w GOPROXY=https://goproxy.cn,direct/"

build binary

docker exec -it ${container_id} bash -c "cd /home/admin/dev && make binary"

此后执行build.sh后,依然报错,看着不像是go的问题,log如下: Warning: skipping import of repository 'jsoncpp_git' because it already exists. WARNING: Download from https://golang.org/dl/?mode=json&include=all failed: class java.io.IOException connect timed out INFO: Repository lib25519 instantiated at: /home/admin/dev/WORKSPACE:33:10: in /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/yacl/bazel/repositories.bzl:44:14: in yacl_deps /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/yacl/bazel/repositories.bzl:394:10: in _lib25519 /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/bazel_tools/tools/build_defs/repo/utils.bzl:233:18: in maybe Repository rule http_archive defined at: /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/bazel_tools/tools/build_defs/repo/http.bzl:372:31: in WARNING: Download from https://lib25519.cr.yp.to/lib25519-20240321.tar.gz failed: class javax.net.ssl.SSLException Read timed out ERROR: An error occurred during the fetch of repository 'lib25519': Traceback (most recent call last): File "/root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/bazel_tools/tools/build_defs/repo/http.bzl", line 132, column 45, in _http_archive_impl download_info = ctx.download_and_extract( Error in download_and_extract: java.io.IOException: Error downloading [https://lib25519.cr.yp.to/lib25519-20240321.tar.gz] to /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/lib25519/temp6706480853811373433/lib25519-20240321.tar.gz: Read timed out ERROR: /home/admin/dev/WORKSPACE:33:10: fetching http_archive rule //external:lib25519: Traceback (most recent call last): File "/root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/bazel_tools/tools/build_defs/repo/http.bzl", line 132, column 45, in _http_archive_impl download_info = ctx.download_and_extract( Error in download_and_extract: java.io.IOException: Error downloading [https://lib25519.cr.yp.to/lib25519-20240321.tar.gz] to /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/lib25519/temp6706480853811373433/lib25519-20240321.tar.gz: Read timed out INFO: Repository boost instantiated at: /home/admin/dev/WORKSPACE:100:11: in /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/com_github_nelhage_rules_boost/boost/boost.bzl:156:10: in boost_deps /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/bazel_tools/tools/build_defs/repo/utils.bzl:233:18: in maybe Repository rule http_archive defined at: /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/bazel_tools/tools/build_defs/repo/http.bzl:372:31: in ERROR: /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/yacl/yacl/crypto/ecc/lib25519/BUILD.bazel:58:16: @yacl//yacl/crypto/ecc/lib25519:lib25519_group depends on @lib25519//:25519 in repository @lib25519 which failed to fetch. no such package '@lib25519//': java.io.IOException: Error downloading [https://lib25519.cr.yp.to/lib25519-20240321.tar.gz] to /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/lib25519/temp6706480853811373433/lib25519-20240321.tar.gz: Read timed out ERROR: Analysis of target '//engine/exe:scqlengine' failed; build aborted: INFO: Elapsed time: 519.473s INFO: 0 processes. FAILED: Build did NOT complete successfully (273 packages loaded, 40948 targets configured) Fetching https://github.com/.../boost-1.83.0/boost-1.83.0.tar.gz; 5.0 MiB (4.2%) 325s make: *** [Makefile:34: binary] Error 1

  • docker stop 7939d3b79d053a2612f54734f7a9e3d633763cd05ef6243aa55afcca0c1b5b5b 7939d3b79d053a2612f54734f7a9e3d633763cd05ef6243aa55afcca0c1b5b5b

不知道怎么解了。。

guanglaiguo avatar Sep 25 '24 09:09 guanglaiguo

@wangzul 按照您的指示,修改如下 image

prepare for git command

docker exec -it ${container_id} bash -c "git config --global --add safe.directory /home/admin/dev" docker exec -it ${container_id} bash -c "go env -w GOPROXY=https://goproxy.cn,direct/"

build binary

docker exec -it ${container_id} bash -c "cd /home/admin/dev && make binary"

此后执行build.sh后,依然报错,看着不像是go的问题,log如下: Warning: skipping import of repository 'jsoncpp_git' because it already exists. WARNING: Download from https://golang.org/dl/?mode=json&include=all failed: class java.io.IOException connect timed out INFO: Repository lib25519 instantiated at: /home/admin/dev/WORKSPACE:33:10: in /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/yacl/bazel/repositories.bzl:44:14: in yacl_deps /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/yacl/bazel/repositories.bzl:394:10: in _lib25519 /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/bazel_tools/tools/build_defs/repo/utils.bzl:233:18: in maybe Repository rule http_archive defined at: /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/bazel_tools/tools/build_defs/repo/http.bzl:372:31: in WARNING: Download from https://lib25519.cr.yp.to/lib25519-20240321.tar.gz failed: class javax.net.ssl.SSLException Read timed out ERROR: An error occurred during the fetch of repository 'lib25519': Traceback (most recent call last): File "/root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/bazel_tools/tools/build_defs/repo/http.bzl", line 132, column 45, in _http_archive_impl download_info = ctx.download_and_extract( Error in download_and_extract: java.io.IOException: Error downloading [https://lib25519.cr.yp.to/lib25519-20240321.tar.gz] to /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/lib25519/temp6706480853811373433/lib25519-20240321.tar.gz: Read timed out ERROR: /home/admin/dev/WORKSPACE:33:10: fetching http_archive rule //external:lib25519: Traceback (most recent call last): File "/root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/bazel_tools/tools/build_defs/repo/http.bzl", line 132, column 45, in _http_archive_impl download_info = ctx.download_and_extract( Error in download_and_extract: java.io.IOException: Error downloading [https://lib25519.cr.yp.to/lib25519-20240321.tar.gz] to /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/lib25519/temp6706480853811373433/lib25519-20240321.tar.gz: Read timed out INFO: Repository boost instantiated at: /home/admin/dev/WORKSPACE:100:11: in /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/com_github_nelhage_rules_boost/boost/boost.bzl:156:10: in boost_deps /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/bazel_tools/tools/build_defs/repo/utils.bzl:233:18: in maybe Repository rule http_archive defined at: /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/bazel_tools/tools/build_defs/repo/http.bzl:372:31: in ERROR: /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/yacl/yacl/crypto/ecc/lib25519/BUILD.bazel:58:16: @yacl//yacl/crypto/ecc/lib25519:lib25519_group depends on @lib25519//:25519 in repository @lib25519 which failed to fetch. no such package '@lib25519//': java.io.IOException: Error downloading [https://lib25519.cr.yp.to/lib25519-20240321.tar.gz] to /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/lib25519/temp6706480853811373433/lib25519-20240321.tar.gz: Read timed out ERROR: Analysis of target '//engine/exe:scqlengine' failed; build aborted: INFO: Elapsed time: 519.473s INFO: 0 processes. FAILED: Build did NOT complete successfully (273 packages loaded, 40948 targets configured) Fetching https://github.com/.../boost-1.83.0/boost-1.83.0.tar.gz; 5.0 MiB (4.2%) 325s make: *** [Makefile:34: binary] Error 1

  • docker stop 7939d3b79d053a2612f54734f7a9e3d633763cd05ef6243aa55afcca0c1b5b5b 7939d3b79d053a2612f54734f7a9e3d633763cd05ef6243aa55afcca0c1b5b5b

不知道怎么解了。。

看起来你这是网络问题。推荐获取dockerId 通过docker exec -it xxx bash 在容器内部执行,多次尝试获取可以构建成功。最好是找一台对应网络访问良好的服务【编译需要拉取google依赖以及github相关的内容】

wangzul avatar Sep 25 '24 10:09 wangzul

@wangzul 按照您的指示,修改如下 image

prepare for git command

docker exec -it ${container_id} bash -c "git config --global --add safe.directory /home/admin/dev" docker exec -it ${container_id} bash -c "go env -w GOPROXY=https://goproxy.cn,direct/"

build binary

docker exec -it ${container_id} bash -c "cd /home/admin/dev && make binary"

此后执行build.sh后,依然报错,看着不像是go的问题,log如下: Warning: skipping import of repository 'jsoncpp_git' because it already exists. WARNING: Download from https://golang.org/dl/?mode=json&include=all failed: class java.io.IOException connect timed out INFO: Repository lib25519 instantiated at: /home/admin/dev/WORKSPACE:33:10: in /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/yacl/bazel/repositories.bzl:44:14: in yacl_deps /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/yacl/bazel/repositories.bzl:394:10: in _lib25519 /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/bazel_tools/tools/build_defs/repo/utils.bzl:233:18: in maybe Repository rule http_archive defined at: /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/bazel_tools/tools/build_defs/repo/http.bzl:372:31: in WARNING: Download from https://lib25519.cr.yp.to/lib25519-20240321.tar.gz failed: class javax.net.ssl.SSLException Read timed out ERROR: An error occurred during the fetch of repository 'lib25519': Traceback (most recent call last): File "/root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/bazel_tools/tools/build_defs/repo/http.bzl", line 132, column 45, in _http_archive_impl download_info = ctx.download_and_extract( Error in download_and_extract: java.io.IOException: Error downloading [https://lib25519.cr.yp.to/lib25519-20240321.tar.gz] to /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/lib25519/temp6706480853811373433/lib25519-20240321.tar.gz: Read timed out ERROR: /home/admin/dev/WORKSPACE:33:10: fetching http_archive rule //external:lib25519: Traceback (most recent call last): File "/root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/bazel_tools/tools/build_defs/repo/http.bzl", line 132, column 45, in _http_archive_impl download_info = ctx.download_and_extract( Error in download_and_extract: java.io.IOException: Error downloading [https://lib25519.cr.yp.to/lib25519-20240321.tar.gz] to /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/lib25519/temp6706480853811373433/lib25519-20240321.tar.gz: Read timed out INFO: Repository boost instantiated at: /home/admin/dev/WORKSPACE:100:11: in /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/com_github_nelhage_rules_boost/boost/boost.bzl:156:10: in boost_deps /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/bazel_tools/tools/build_defs/repo/utils.bzl:233:18: in maybe Repository rule http_archive defined at: /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/bazel_tools/tools/build_defs/repo/http.bzl:372:31: in ERROR: /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/yacl/yacl/crypto/ecc/lib25519/BUILD.bazel:58:16: @yacl//yacl/crypto/ecc/lib25519:lib25519_group depends on @lib25519//:25519 in repository @lib25519 which failed to fetch. no such package '@lib25519//': java.io.IOException: Error downloading [https://lib25519.cr.yp.to/lib25519-20240321.tar.gz] to /root/.cache/bazel/_bazel_root/eceb46742416a02f6a0f8d92bc74468c/external/lib25519/temp6706480853811373433/lib25519-20240321.tar.gz: Read timed out ERROR: Analysis of target '//engine/exe:scqlengine' failed; build aborted: INFO: Elapsed time: 519.473s INFO: 0 processes. FAILED: Build did NOT complete successfully (273 packages loaded, 40948 targets configured) Fetching https://github.com/.../boost-1.83.0/boost-1.83.0.tar.gz; 5.0 MiB (4.2%) 325s make: *** [Makefile:34: binary] Error 1

  • docker stop 7939d3b79d053a2612f54734f7a9e3d633763cd05ef6243aa55afcca0c1b5b5b 7939d3b79d053a2612f54734f7a9e3d633763cd05ef6243aa55afcca0c1b5b5b

不知道怎么解了。。

看起来你这是网络问题。推荐获取dockerId 通过docker exec -it xxx bash 在容器内部执行,多次尝试获取可以构建成功。最好是找一台对应网络访问良好的服务【编译需要拉取google依赖以及github相关的内容】

wangzul avatar Sep 25 '24 10:09 wangzul

@wangzul "推荐获取dockerId 通过docker exec -it xxx bash 在容器内部执行,多次尝试获取可以构建成功。"不太明白您提供的解决思路? 目前是在scql源码对应的scql-main/docker下执行bash build.sh进行的镜像构建。进入容器内部,是进入哪个容器,基于哪个镜像呢?在容器内部怎么执行bash build.sh呢?能否再详细说说步骤,感谢感谢!

下面是我的具体操作,不确定操作对不对~~感觉没有进容器内编译: docker cp /scql-main/docker 2dba37c5d773:/home #一个kuscia镜像 docker inspect 2dba37c5d773 |grep merged cd /var/lib/docker/overlay2/b6f823fed48e1284ce36ad9d95015095ad97c431bffa6654fd551dc2d8d40c19/merged cd home/docker bash build.sh 编译后,显示如下log: [root@localhost docker]# bash build.sh +++ dirname build.sh ++ cd . ++ pwd

  • SCRIPT_DIR=/var/lib/docker/overlay2/b6f823fed48e1284ce36ad9d95015095ad97c431bffa6654fd551dc2d8d40c19/merged/home/docker ++ cd /var/lib/docker/overlay2/b6f823fed48e1284ce36ad9d95015095ad97c431bffa6654fd551dc2d8d40c19/merged/home/docker/.. ++ pwd
  • WORK_DIR=/var/lib/docker/overlay2/b6f823fed48e1284ce36ad9d95015095ad97c431bffa6654fd551dc2d8d40c19/merged/home
  • echo 'build image scql:latest' build image scql:latest
  • MOUNT_OPTIONS=
  • false ++ arch
  • MACHINE_TYPE=x86_64
  • HOST_PLATFORM=
  • '[' x86_64 == x86_64 ']'
  • HOST_PLATFORM=linux/amd64
  • '[' -z '' ']'
  • TARGET_PLATFORM=linux/amd64
  • BUILDER=secretflow/scql-ci:latest
  • '[' ubuntu == anolis ']' ++ docker run -it --rm --detach --mount type=bind,source=/var/lib/docker/overlay2/b6f823fed48e1284ce36ad9d95015095ad97c431bffa6654fd551dc2d8d40c19/merged/home,target=/home/admin/dev/ -w /home/admin/dev secretflow/scql-ci:latest tail -f /dev/null
  • container_id=cf27be6c028f6e8416e74a76af64cb64186c2e8635096a53d2bda5c0d23cec72
  • trap 'docker stop cf27be6c028f6e8416e74a76af64cb64186c2e8635096a53d2bda5c0d23cec72' EXIT
  • docker exec -it cf27be6c028f6e8416e74a76af64cb64186c2e8635096a53d2bda5c0d23cec72 bash -c 'git config --global --add safe.directory /home/admin/dev'
  • docker exec -it cf27be6c028f6e8416e74a76af64cb64186c2e8635096a53d2bda5c0d23cec72 bash -c 'go env -w GOPROXY=https://goproxy.cn,direct/'
  • docker exec -it cf27be6c028f6e8416e74a76af64cb64186c2e8635096a53d2bda5c0d23cec72 bash -c 'cd /home/admin/dev && make binary' make: *** No rule to make target 'binary'. Stop.
  • docker stop cf27be6c028f6e8416e74a76af64cb64186c2e8635096a53d2bda5c0d23cec72 cf27be6c028f6e8416e74a76af64cb64186c2e8635096a53d2bda5c0d23cec72

guanglaiguo avatar Sep 26 '24 02:09 guanglaiguo

@wangzul "推荐获取dockerId 通过docker exec -it xxx bash 在容器内部执行,多次尝试获取可以构建成功。"不太明白您提供的解决思路? 目前是在scql源码对应的scql-main/docker下执行bash build.sh进行的镜像构建。进入容器内部,是进入哪个容器,基于哪个镜像呢?在容器内部怎么执行bash build.sh呢?能否再详细说说步骤,感谢感谢!

下面是我的具体操作,不确定操作对不对~~感觉没有进容器内编译: docker cp /scql-main/docker 2dba37c5d773:/home #一个kuscia镜像 docker inspect 2dba37c5d773 |grep merged cd /var/lib/docker/overlay2/b6f823fed48e1284ce36ad9d95015095ad97c431bffa6654fd551dc2d8d40c19/merged cd home/docker bash build.sh 编译后,显示如下log: [root@localhost docker]# bash build.sh +++ dirname build.sh ++ cd . ++ pwd

  • SCRIPT_DIR=/var/lib/docker/overlay2/b6f823fed48e1284ce36ad9d95015095ad97c431bffa6654fd551dc2d8d40c19/merged/home/docker ++ cd /var/lib/docker/overlay2/b6f823fed48e1284ce36ad9d95015095ad97c431bffa6654fd551dc2d8d40c19/merged/home/docker/.. ++ pwd
  • WORK_DIR=/var/lib/docker/overlay2/b6f823fed48e1284ce36ad9d95015095ad97c431bffa6654fd551dc2d8d40c19/merged/home
  • echo 'build image scql:latest' build image scql:latest
  • MOUNT_OPTIONS=
  • false ++ arch
  • MACHINE_TYPE=x86_64
  • HOST_PLATFORM=
  • '[' x86_64 == x86_64 ']'
  • HOST_PLATFORM=linux/amd64
  • '[' -z '' ']'
  • TARGET_PLATFORM=linux/amd64
  • BUILDER=secretflow/scql-ci:latest
  • '[' ubuntu == anolis ']' ++ docker run -it --rm --detach --mount type=bind,source=/var/lib/docker/overlay2/b6f823fed48e1284ce36ad9d95015095ad97c431bffa6654fd551dc2d8d40c19/merged/home,target=/home/admin/dev/ -w /home/admin/dev secretflow/scql-ci:latest tail -f /dev/null
  • container_id=cf27be6c028f6e8416e74a76af64cb64186c2e8635096a53d2bda5c0d23cec72
  • trap 'docker stop cf27be6c028f6e8416e74a76af64cb64186c2e8635096a53d2bda5c0d23cec72' EXIT
  • docker exec -it cf27be6c028f6e8416e74a76af64cb64186c2e8635096a53d2bda5c0d23cec72 bash -c 'git config --global --add safe.directory /home/admin/dev'
  • docker exec -it cf27be6c028f6e8416e74a76af64cb64186c2e8635096a53d2bda5c0d23cec72 bash -c 'go env -w GOPROXY=https://goproxy.cn,direct/'
  • docker exec -it cf27be6c028f6e8416e74a76af64cb64186c2e8635096a53d2bda5c0d23cec72 bash -c 'cd /home/admin/dev && make binary' make: *** No rule to make target 'binary'. Stop.
  • docker stop cf27be6c028f6e8416e74a76af64cb64186c2e8635096a53d2bda5c0d23cec72 cf27be6c028f6e8416e74a76af64cb64186c2e8635096a53d2bda5c0d23cec72

找到build.sh 中 container_id=$(docker run -it --rm --detach
--mount type=bind,source="${WORK_DIR}",target=/home/admin/dev/
-w /home/admin/dev ${MOUNT_OPTIONS}
$BUILDER tail -f /dev/null) 这段代码 将-it --rm 修改为 -dt --name xxxx 然后运行build.sh 失败了无所谓,然后通过docker exec -it xxx bash进入容器中运行 cd /home/admin/dev && make binary 通过多次重试的方法慢慢编译。如果你想了解使用的那个镜像可以在脚本开头set -eu 修改为set -eux 这样执行的时候会有输出你可以看到是那个镜像在生效

wangzul avatar Sep 26 '24 03:09 wangzul

@wangzul 找到build.sh 中 container_id=$(docker run -it --rm --detach --mount type=bind,source="${WORK_DIR}",target=/home/admin/dev/ -w /home/admin/dev ${MOUNT_OPTIONS} $BUILDER tail -f /dev/null) 这段代码 将-it --rm 修改为 -dt --name xxxx Snipaste_2024-09-26_15-49-42 然后运行build.sh 失败,log如下: Snipaste_2024-09-26_15-46-08 然后,通过docker exec -it xxx bash进入容器时,报错: Snipaste_2024-09-26_15-47-14 提示容器没有运行??

guanglaiguo avatar Sep 26 '24 07:09 guanglaiguo

@wangzul 找到build.sh 中 container_id=$(docker run -it --rm --detach --mount type=bind,source="${WORK_DIR}",target=/home/admin/dev/ -w /home/admin/dev ${MOUNT_OPTIONS} $BUILDER tail -f /dev/null) 这段代码 将-it --rm 修改为 -dt --name xxxx Snipaste_2024-09-26_15-49-42 然后运行build.sh 失败,log如下: Snipaste_2024-09-26_15-46-08 然后,通过docker exec -it xxx bash进入容器时,报错: Snipaste_2024-09-26_15-47-14 提示容器没有运行??

docker start xxx 启动一下容器,build.sh 脚本把容器stop了

wangzul avatar Sep 26 '24 07:09 wangzul

@wangzul 通过docker exec -it xxx bash进入容器中运行 cd /home/admin/dev && make binary 通过多次重试的方法慢慢编译,是指多重复编译几次么,有可能会出现编译fail的问题?? 我编译了1次,是fail的,log如下: Snipaste_2024-09-26_17-44-48

补充一下,我是用笔记本连接手机热点上网的,不知道是否有影响??

guanglaiguo avatar Sep 26 '24 09:09 guanglaiguo