Closed liangyuanpeng closed 1 month ago
看着没问题,等action approval了过一遍没问题就可以合入了 @qiangxuhui cc
没有发现什么问题,目前是没有修改内容的情况下重新push了一次.
https://github.com/Loongson-Cloud-Community/dockerfiles/actions/runs/9850771998/job/27205536196
...
go: downloading github.com/go-logr/logr v1.3.0
go: downloading github.com/cenkalti/backoff/v4 v4.2.1
2024-07-09 04:50:14,551 - [lmake:316] - ERROR - [pr_number=246] - [pr_number-246] cmd(make image -C kubernetes/etcd/3.5.14) executed failed
Traceback (most recent call last):
File "/usr/bin/lmake", line 314, in <module>
ops[op].execute()
File "/usr/bin/lmake", line 288, in execute
cr_repo.execute_build()
File "/usr/bin/lmake", line 93, in execute_build
command.execute()
File "/ci/lmake/util/command.py", line 24, in execute
self._execute_with_file()
File "/ci/lmake/util/command.py", line 59, in _execute_with_file
raise ShellExecuteException("", cmd, sub_proc.returncode)
util.error.ShellExecuteException: ('', 'make image -C kubernetes/etcd/3.5.14', 2)
go: downloading github.com/go-logr/stdr v1.2.2
go: downloading github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0
go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.1
go: downloading golang.org/x/text v0.14.0
go: downloading go1.21.10 (linux/loong64)
make: *** [Makefile:25: build] Error 139
make: *** [Makefile:27:build] 错误 2
make: 离开目录“/ci/runner/_work/dockerfiles/dockerfiles/kubernetes/etcd/3.5.14”
如果有类似 /retest
的评论命令可以触发重新跑一次 github action 就好了,如果需要的话我可以帮忙实现,因为我做过这样的事情并且正在使用, 参考实验PR https://github.com/liangyuanpeng/karmada/pull/31
cc @qiangxuhui
报错在这句 go: downloading go1.21.10 (linux/loong64)
报错在这句 go: downloading go1.21.10 (linux/loong64)
是的,看到了是这一句但没想到可能的原因.
注意:本PR我还没有在龙芯机器上测试过, 计划用qemu来虚拟一台龙芯架构机器,但可能还没那么快(:
@liangyuanpeng 我在构建机器上测试了一下: go: downloading go1.21.10 (linux/loong64)
不能通过,因该是下载超时了
@liangyuanpeng 可以考虑修改一下etcd
构建命令为:
FORCE_HOST_GO=1 make build
参考./scripts/test_lib.sh
的determine_go_version
函数:
function determine_go_version {
# Borrowing from how Kubernetes does this:
# https://github.com/kubernetes/kubernetes/blob/17854f0e0a153b06f9d0db096e2cd8ab2fa89c11/hack/lib/golang.sh#L510-L520
#
# default GO_VERSION to content of .go-version
GO_VERSION="${GO_VERSION:-"$(cat "${ETCD_ROOT_DIR}/.go-version")"}"
if [ "${GOTOOLCHAIN:-auto}" != 'auto' ]; then
# no-op, just respect GOTOOLCHAIN
:
elif [ -n "${FORCE_HOST_GO:-}" ]; then
export GOTOOLCHAIN='local' # 这里可以强制使用本地golang
else
GOTOOLCHAIN="go${GO_VERSION}"
export GOTOOLCHAIN
fi
}
更新: 为 make build 添加 FORCE_HOST_GO=1, 使用本地go版本.
在本地基于 docker qemu 方式成功 make build
docker run --rm --privileged registry.aliyuncs.com/zhangguanzhang/qemu-user-static --reset -p yes
make build
但构建容器镜像时由于权限失败了:
$: make image
...
BASE_IMG=cr.loongnix.cn/prometheus/busybox:glibc \
make -C src/etcd build-docker-release-main
make[1]: Entering directory '/home/lan/loongson-dockerfiles/kubernetes/etcd/3.5.14/src/etcd'
ETCD_VERSION: bf51a53
cp ./Dockerfile-release.loong64 ./bin/Dockerfile-release.loong64
cp: cannot create regular file './bin/Dockerfile-release.loong64': Permission denied
已检查新增的Dockerfile-release.loong64与etcd原有的其他Dockerfile权限是一样的, 不确认是否是 qemu 模拟造成的差异.
给 src 目录赋予 777 权限后 make image
本地测试成功
code | level | alerts |
---|---|---|
CIS-DI-0001 | WARN | Last user should not be root |
CIS-DI-0005 | INFO | export DOCKER_CONTENT_TRUST=1 before docker pull/build |
CIS-DI-0006 | INFO | not found HEALTHCHECK statement |
cc @zhangguanzhang
帮忙确认下,感谢.