-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
shucheng
committed
Oct 25, 2022
1 parent
1c90a44
commit 1e922e3
Showing
4 changed files
with
306 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
kind: pipeline | ||
name: docker | ||
|
||
trigger: | ||
branch: | ||
- main | ||
|
||
workspace: | ||
path: /go/src/github.com/containerd/containerd | ||
|
||
volumes: | ||
- name: docker | ||
host: | ||
path: /var/run/docker.sock | ||
|
||
clone: | ||
disable: true | ||
|
||
steps: | ||
- name: s3-cache | ||
image: registry.cn-qingdao.aliyuncs.com/wod/devops-s3-cache:1.0 | ||
settings: | ||
restore: true | ||
path: /cache/open-beagle/containerd | ||
mount: | ||
- ./.git | ||
endpoint: https://cache.wodcloud.com | ||
access_key: | ||
from_secret: ACCESS_KEY_MINIO | ||
secret_key: | ||
from_secret: SECRET_KEY_MINIO | ||
|
||
- name: fetch | ||
image: registry.cn-qingdao.aliyuncs.com/wod/devops-git:1.0 | ||
settings: | ||
proxy: | ||
from_secret: SOCKS5_PROXY | ||
|
||
- name: golang | ||
image: registry.cn-qingdao.aliyuncs.com/wod/golang:1.19 | ||
environment: | ||
VERSION: v1.6.9-beagle | ||
commands: | ||
- bash ./.beagle/build.sh | ||
|
||
- name: docker-amd64 | ||
image: registry.cn-qingdao.aliyuncs.com/wod/devops-docker:1.0 | ||
volumes: | ||
- name: docker | ||
path: /var/run/docker.sock | ||
settings: | ||
dockerfile: .beagle/dockerfile | ||
base: registry.cn-qingdao.aliyuncs.com/wod/alpine:3-amd64 | ||
cwd: _output | ||
repo: wod/containerd | ||
version: v1.6.9 | ||
channel: amd64 | ||
args: 'TARGETOS=linux,TARGETARCH=amd64' | ||
registry: registry.cn-qingdao.aliyuncs.com | ||
registry_user: | ||
from_secret: REGISTRY_USER_ALIYUN | ||
registry_password: | ||
from_secret: REGISTRY_PASSWORD_ALIYUN | ||
|
||
- name: docker-arm64 | ||
image: registry.cn-qingdao.aliyuncs.com/wod/devops-docker:1.0 | ||
volumes: | ||
- name: docker | ||
path: /var/run/docker.sock | ||
settings: | ||
dockerfile: .beagle/dockerfile | ||
base: registry.cn-qingdao.aliyuncs.com/wod/alpine:3-arm64 | ||
cwd: _output | ||
repo: wod/containerd | ||
version: v1.6.9 | ||
channel: arm64 | ||
args: 'TARGETOS=linux,TARGETARCH=arm64' | ||
registry: registry.cn-qingdao.aliyuncs.com | ||
registry_user: | ||
from_secret: REGISTRY_USER_ALIYUN | ||
registry_password: | ||
from_secret: REGISTRY_PASSWORD_ALIYUN | ||
|
||
- name: docker-ppc64le | ||
image: registry.cn-qingdao.aliyuncs.com/wod/devops-docker:1.0 | ||
volumes: | ||
- name: docker | ||
path: /var/run/docker.sock | ||
settings: | ||
dockerfile: .beagle/dockerfile | ||
base: registry.cn-qingdao.aliyuncs.com/wod/alpine:3-ppc64le | ||
cwd: _output | ||
repo: wod/containerd | ||
version: v1.6.9 | ||
channel: ppc64le | ||
args: 'TARGETOS=linux,TARGETARCH=ppc64le' | ||
registry: registry.cn-qingdao.aliyuncs.com | ||
registry_user: | ||
from_secret: REGISTRY_USER_ALIYUN | ||
registry_password: | ||
from_secret: REGISTRY_PASSWORD_ALIYUN | ||
|
||
- name: docker-mips64le | ||
image: registry.cn-qingdao.aliyuncs.com/wod/devops-docker:1.0 | ||
volumes: | ||
- name: docker | ||
path: /var/run/docker.sock | ||
settings: | ||
dockerfile: .beagle/dockerfile | ||
base: registry.cn-qingdao.aliyuncs.com/wod/alpine:3-mips64le | ||
cwd: _output | ||
repo: wod/containerd | ||
version: v1.6.9 | ||
channel: mips64le | ||
args: 'TARGETOS=linux,TARGETARCH=mips64le' | ||
registry: registry.cn-qingdao.aliyuncs.com | ||
registry_user: | ||
from_secret: REGISTRY_USER_ALIYUN | ||
registry_password: | ||
from_secret: REGISTRY_PASSWORD_ALIYUN | ||
|
||
--- | ||
kind: secret | ||
name: SOCKS5_PROXY | ||
get: | ||
name: SOCKS5_PROXY | ||
path: devops-secrets | ||
|
||
--- | ||
kind: secret | ||
name: REGISTRY_USER_ALIYUN | ||
get: | ||
name: REGISTRY_USER_ALIYUN | ||
path: devops-secrets | ||
|
||
--- | ||
kind: secret | ||
name: REGISTRY_PASSWORD_ALIYUN | ||
get: | ||
name: REGISTRY_PASSWORD_ALIYUN | ||
path: devops-secrets | ||
|
||
--- | ||
kind: secret | ||
name: ACCESS_KEY_MINIO | ||
get: | ||
name: ACCESS_KEY_MINIO | ||
path: devops-secrets | ||
|
||
--- | ||
kind: secret | ||
name: SECRET_KEY_MINIO | ||
get: | ||
name: SECRET_KEY_MINIO | ||
path: devops-secrets | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# git | ||
|
||
```bash | ||
git remote add upstream git@github.com:containerd/containerd.git | ||
|
||
git fetch upstream | ||
|
||
git merge v1.6.9 | ||
``` | ||
|
||
## build | ||
|
||
```bash | ||
docker run -it --rm \ | ||
-v $PWD/:/go/src/github.com/containerd/containerd \ | ||
-w /go/src/github.com/containerd/containerd \ | ||
-e VERSION=v1.6.9-beagle \ | ||
registry.cn-qingdao.aliyuncs.com/wod/golang:1.19 \ | ||
bash .beagle/build.sh | ||
``` | ||
|
||
## test | ||
|
||
```bash | ||
file _output/linux-amd64/containerd | ||
|
||
# amd64-test | ||
docker run -it --rm \ | ||
-v $PWD/:/go/src/github.com/containerd/containerd \ | ||
-w /go/src/github.com/containerd/containerd \ | ||
registry.cn-qingdao.aliyuncs.com/wod/debian:bullseye-amd64 \ | ||
./_output/linux-amd64/containerd -v | ||
|
||
docker run -it --rm \ | ||
-v $PWD/:/go/src/github.com/containerd/containerd \ | ||
-w /go/src/github.com/containerd/containerd \ | ||
registry.cn-qingdao.aliyuncs.com/wod/alpine:3-amd64 \ | ||
./_output/linux-amd64/containerd -v | ||
|
||
# arm64-test | ||
docker run -it --rm \ | ||
-v $PWD/:/go/src/github.com/containerd/containerd \ | ||
-w /go/src/github.com/containerd/containerd \ | ||
registry.cn-qingdao.aliyuncs.com/wod/debian:bullseye-arm64 \ | ||
./_output/linux-arm64/containerd -v | ||
|
||
docker run -it --rm \ | ||
-v $PWD/:/go/src/github.com/containerd/containerd \ | ||
-w /go/src/github.com/containerd/containerd \ | ||
registry.cn-qingdao.aliyuncs.com/wod/alpine:3-arm64 \ | ||
./_output/linux-arm64/containerd -v | ||
|
||
# ppc64le-test | ||
docker run -it --rm \ | ||
-v $PWD/:/go/src/github.com/containerd/containerd \ | ||
-w /go/src/github.com/containerd/containerd \ | ||
registry.cn-qingdao.aliyuncs.com/wod/debian:bullseye-ppc64le \ | ||
./_output/linux-ppc64le/containerd -v | ||
|
||
docker run -it --rm \ | ||
-v $PWD/:/go/src/github.com/containerd/containerd \ | ||
-w /go/src/github.com/containerd/containerd \ | ||
registry.cn-qingdao.aliyuncs.com/wod/alpine:3-ppc64le \ | ||
./_output/linux-ppc64le/containerd -v | ||
|
||
# mips64le-test | ||
docker run -it --rm \ | ||
-v $PWD/:/go/src/github.com/containerd/containerd \ | ||
-w /go/src/github.com/containerd/containerd \ | ||
registry.cn-qingdao.aliyuncs.com/wod/debian:bullseye-mips64le \ | ||
./_output/linux-mips64le/containerd -v | ||
|
||
docker run -it --rm \ | ||
-v $PWD/:/go/src/github.com/containerd/containerd \ | ||
-w /go/src/github.com/containerd/containerd \ | ||
registry.cn-qingdao.aliyuncs.com/wod/alpine:3-mips64le \ | ||
./_output/linux-mips64le/containerd -v | ||
``` | ||
|
||
## cache | ||
|
||
```bash | ||
# 构建缓存-->推送缓存至服务器 | ||
docker run --rm \ | ||
-e PLUGIN_REBUILD=true \ | ||
-e PLUGIN_ENDPOINT=$PLUGIN_ENDPOINT \ | ||
-e PLUGIN_ACCESS_KEY=$PLUGIN_ACCESS_KEY \ | ||
-e PLUGIN_SECRET_KEY=$PLUGIN_SECRET_KEY \ | ||
-e PLUGIN_PATH="/cache/open-beagle/containerd" \ | ||
-e PLUGIN_MOUNT="./.git" \ | ||
-v $(pwd):$(pwd) \ | ||
-w $(pwd) \ | ||
registry.cn-qingdao.aliyuncs.com/wod/devops-s3-cache:1.0 | ||
|
||
# 读取缓存-->将缓存从服务器拉取到本地 | ||
docker run --rm \ | ||
-e PLUGIN_RESTORE=true \ | ||
-e PLUGIN_ENDPOINT=$PLUGIN_ENDPOINT \ | ||
-e PLUGIN_ACCESS_KEY=$PLUGIN_ACCESS_KEY \ | ||
-e PLUGIN_SECRET_KEY=$PLUGIN_SECRET_KEY \ | ||
-e PLUGIN_PATH="/cache/open-beagle/containerd" \ | ||
-v $(pwd):$(pwd) \ | ||
-w $(pwd) \ | ||
registry.cn-qingdao.aliyuncs.com/wod/devops-s3-cache:1.0 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -ex | ||
|
||
apt-get update | ||
apt-get install -y --no-install-recommends libbtrfs-dev | ||
|
||
export GO111MODULE=off | ||
export STATIC=true | ||
|
||
export GOARCH=amd64 | ||
make | ||
mkdir -p _output/linux-$GOARCH/ | ||
mv bin/* _output/linux-$GOARCH/ | ||
|
||
export GOARCH=arm64 | ||
export CC=aarch64-linux-gnu-gcc | ||
make | ||
mkdir -p _output/linux-$GOARCH/ | ||
mv bin/* _output/linux-$GOARCH/ | ||
|
||
export GOARCH=ppc64le | ||
export CC=powerpc64le-linux-gnu-gcc | ||
make | ||
mkdir -p _output/linux-$GOARCH/ | ||
mv bin/* _output/linux-$GOARCH/ | ||
|
||
export GOARCH=mips64le | ||
export CC=mips64el-linux-gnuabi64-gcc | ||
make | ||
mkdir -p _output/linux-$GOARCH/ | ||
mv bin/* _output/linux-$GOARCH/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
ARG BASE | ||
|
||
FROM $BASE | ||
|
||
ARG AUTHOR | ||
ARG VERSION | ||
|
||
LABEL maintainer=$AUTHOR version=$VERSION | ||
|
||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
COPY ./$TARGETOS-$TARGETARCH/ /usr/local/bin/ |