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

添加新组件打包镜像失败 #192

Open
beng003 opened this issue Jan 6, 2025 · 4 comments
Open

添加新组件打包镜像失败 #192

beng003 opened this issue Jan 6, 2025 · 4 comments

Comments

@beng003
Copy link

beng003 commented Jan 6, 2025

Issue Type

Others

Have you searched for existing documents and issues?

Yes

OS Platform and Distribution

Linux Ubuntu 18.04

All_in_one Version

v1.10.0b0

Module type

secretflow

Module version

v1.10.0b1

What happend and What you expected to happen.

在老版本中,采用以前的方法添加新组件打包镜像失败,显示库yacl问题,但是直接git clone可以下载yacl库

具体参考

Log output.

部分日志如下
copying benchmark_examples/autoattack/applications/image/cifar10/cnn/__init__.py -> build/lib.linux-x86_64-cpython-310/benchmark_examples/autoattack/applications/image/cifar10/cnn
creating build/lib.linux-x86_64-cpython-310/benchmark_examples/autoattack/applications/image/cifar10/resnet20
copying benchmark_examples/autoattack/applications/image/cifar10/resnet20/cifar10_resnet20.py -> build/lib.linux-x86_64-cpython-310/benchmark_examples/autoattack/applications/image/cifar10/resnet20
copying benchmark_examples/autoattack/applications/image/cifar10/resnet20/__init__.py -> build/lib.linux-x86_64-cpython-310/benchmark_examples/autoattack/applications/image/cifar10/resnet20
copying secretflow/distributed/fed/proxy/grpc/fed_pb2.pyi -> build/lib.linux-x86_64-cpython-310/secretflow/distributed/fed/proxy/grpc
running build_ext
bazel build //secretflow_lib/binding:_lib.so --symlink_prefix=build/temp.linux-x86_64-cpython-310/bazel- --compilation_mode=opt --config=avx
2025/01/06 06:41:46 Downloading https://releases.bazel.build/6.5.0/release/bazel-6.5.0-linux-x86_64...
Downloading: 52 MB out of 52 MB (100%) 
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
INFO: Repository yacl instantiated at:
  /home/admin/src_copied/WORKSPACE:19:15: in <toplevel>
Repository rule git_repository defined at:
  /root/.cache/bazel/_bazel_root/2e9839e637bbe387e275e64e16628705/external/bazel_tools/tools/build_defs/repo/git.bzl:181:33: in <toplevel>
ERROR: An error occurred during the fetch of repository 'yacl':
   Traceback (most recent call last):
        File "/root/.cache/bazel/_bazel_root/2e9839e637bbe387e275e64e16628705/external/bazel_tools/tools/build_defs/repo/git.bzl", line 175, column 35, in _git_repository_implementation
                update = _clone_or_update_repo(ctx)
        File "/root/.cache/bazel/_bazel_root/2e9839e637bbe387e275e64e16628705/external/bazel_tools/tools/build_defs/repo/git.bzl", line 36, column 20, in _clone_or_update_repo
                git_ = git_repo(ctx, directory)
        File "/root/.cache/bazel/_bazel_root/2e9839e637bbe387e275e64e16628705/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 91, column 12, in git_repo
                _update(ctx, git_repo)
        File "/root/.cache/bazel/_bazel_root/2e9839e637bbe387e275e64e16628705/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 109, column 10, in _update
                fetch(ctx, git_repo)
        File "/root/.cache/bazel/_bazel_root/2e9839e637bbe387e275e64e16628705/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 143, column 13, in fetch
                _git(
        File "/root/.cache/bazel/_bazel_root/2e9839e637bbe387e275e64e16628705/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 179, column 15, in _git
                _error(ctx.name, start + list(args), st.stderr)
        File "/root/.cache/bazel/_bazel_root/2e9839e637bbe387e275e64e16628705/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 200, column 9, in _error
                fail("error running '%s' while working with @%s:\n%s" % (command_text, name, stderr))
Error in fail: error running 'git fetch origin refs/heads/*:refs/remotes/origin/* refs/tags/*:refs/tags/*' while working with @yacl:
fatal: unable to access 'https://github.com/secretflow/yacl.git/': Could not resolve host: github.com; Unknown error
ERROR: /home/admin/src_copied/WORKSPACE:19:15: fetching git_repository rule //external:yacl: Traceback (most recent call last):
        File "/root/.cache/bazel/_bazel_root/2e9839e637bbe387e275e64e16628705/external/bazel_tools/tools/build_defs/repo/git.bzl", line 175, column 35, in _git_repository_implementation
                update = _clone_or_update_repo(ctx)
        File "/root/.cache/bazel/_bazel_root/2e9839e637bbe387e275e64e16628705/external/bazel_tools/tools/build_defs/repo/git.bzl", line 36, column 20, in _clone_or_update_repo
                git_ = git_repo(ctx, directory)
        File "/root/.cache/bazel/_bazel_root/2e9839e637bbe387e275e64e16628705/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 91, column 12, in git_repo
                _update(ctx, git_repo)
        File "/root/.cache/bazel/_bazel_root/2e9839e637bbe387e275e64e16628705/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 109, column 10, in _update
                fetch(ctx, git_repo)
        File "/root/.cache/bazel/_bazel_root/2e9839e637bbe387e275e64e16628705/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 143, column 13, in fetch
                _git(
        File "/root/.cache/bazel/_bazel_root/2e9839e637bbe387e275e64e16628705/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 179, column 15, in _git
                _error(ctx.name, start + list(args), st.stderr)
        File "/root/.cache/bazel/_bazel_root/2e9839e637bbe387e275e64e16628705/external/bazel_tools/tools/build_defs/repo/git_worker.bzl", line 200, column 9, in _error
                fail("error running '%s' while working with @%s:\n%s" % (command_text, name, stderr))
Error in fail: error running 'git fetch origin refs/heads/*:refs/remotes/origin/* refs/tags/*:refs/tags/*' while working with @yacl:
fatal: unable to access 'https://github.com/secretflow/yacl.git/': Could not resolve host: github.com; Unknown error
ERROR: Error computing the main repository mapping: no such package '@yacl//bazel': error running 'git fetch origin refs/heads/*:refs/remotes/origin/* refs/tags/*:refs/tags/*' while working with @yacl:
fatal: unable to access 'https://github.com/secretflow/yacl.git/': Could not resolve host: github.com; Unknown error
Loading: 
error: command '/usr/bin/bazel' failed with exit code 1
@beng003
Copy link
Author

beng003 commented Jan 6, 2025

在终端可以直接克隆但是打包镜像不行

(beng003_sf) beng003@vulmtc:~/work/develop_script$ git clone https://github.com/secretflow/yacl.git/
Cloning into 'yacl'...
remote: Enumerating objects: 6162, done.
remote: Counting objects: 100% (705/705), done.
remote: Compressing objects: 100% (180/180), done.
remote: Total 6162 (delta 590), reused 529 (delta 524), pack-reused 5457 (from 2)
Receiving objects: 100% (6162/6162), 5.05 MiB | 3.34 MiB/s, done.
Resolving deltas: 100% (4331/4331), done.
(beng003_sf) beng003@vulmtc:~/work/develop_script$ 

@beng003 beng003 closed this as completed Jan 9, 2025
@beng003 beng003 reopened this Jan 13, 2025
@beng003 beng003 changed the title 添加新功能打包镜像失败 添加新组件打包镜像失败 Jan 13, 2025
@wangzul
Copy link

wangzul commented Jan 14, 2025

All_in_one Version
v1.10.0b0

Module type
secretflow

Module version
v0.11.0b0

目前构建的Secretflow 的镜像是基于那个分支或Tag?

@beng003
Copy link
Author

beng003 commented Jan 14, 2025

All_in_one Version
v1.10.0b0

Module type
secretflow

Module version
v0.11.0b0

目前构建的Secretflow 的镜像是基于那个分支或Tag?

基于secretflow tag v1.10.0b1,不好意思,之前写错了

@wangzul
Copy link

wangzul commented Jan 14, 2025

看起来是网络原因,你可以尝试修改下脚本后多次尝试几次,看能否解决你的问题。
https://github.com/secretflow/secretflow/blob/v1.10.0b1/docker/dev/build.sh#L95

#build.sh调整
#容器是否存在
if  docker ps -a --filter "name=xxxx" -q; then
  #存在则重启容器防止容器处于stop状态
  docker restart xxxx
else
  docker run -idt --name xxxx -e SF_BUILD_DOCKER_NAME=${IMAGE_NAME} --mount type=bind,source="$(pwd)/../../../secretflow",target=/home/admin/src -w /home/admin --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --cap-add=NET_ADMIN --privileged=true secretflow/release-ci:latest
fi
docker exec -it xxxx /home/admin/src/docker/dev/entry.sh

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

2 participants