forked from thu-pacman/chitu
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
140 lines (131 loc) · 3.97 KB
/
.gitlab-ci.yml
File metadata and controls
140 lines (131 loc) · 3.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
stages:
- sync-to-github
- sync-to-gitee
- build-and-push
sync-to-github:
stage: sync-to-github
tags:
- ${SYNC_TAGS}
script:
- sh -c "${SYNC_GITHUB_SHELL}"
only:
- public-main
when: always
sync-to-gitee:
stage: sync-to-gitee
tags:
- ${SYNC_TAGS}
script:
- sh -c "${SYNC_GITEE_SHELL}"
only:
- public-main
when: always
sync-to-wisemodel:
stage: sync-to-gitee
tags:
- ${SYNC_TAGS}
script:
- sh -c "${SYNC_WISEMODEL_SHELL}"
only:
- public-main
when: always
.build-image-template: &build-platform-template
stage: build-and-push
only:
- public-main
before_script:
- echo "Building and pushing ${PLATFORM} platform image"
- echo "CLOUD_REGISTRY_PASSWORD:$CLOUD_REGISTRY_PASSWORD"
- echo "CLOUD_USERNAME:$CLOUD_USERNAME"
- echo "CLOUD_REGISTRY:$CLOUD_REGISTRY"
- echo "CI_COMMIT_TAG:$CI_COMMIT_TAG"
- echo "$CLOUD_REGISTRY_PASSWORD" | docker login -u "$CLOUD_USERNAME" --password-stdin "$CLOUD_REGISTRY"
script:
- eval "$BUILD_SCRIPT"
- echo "${PLATFORM} image built successfully:${CLOUD_REGISTRY}/public/chitu-${PLATFORM}:${CI_COMMIT_TAG}"
- echo "Pushing ${PLATFORM} image to cloud registry..."
- docker push ${CLOUD_REGISTRY}/public/chitu-${PLATFORM}:${CI_COMMIT_TAG}
- echo "${PLATFORM} image pushed successfully!"
- |
echo "Tagging and pushing as latest for stable release:${CI_COMMIT_TAG}"
docker tag ${CLOUD_REGISTRY}/public/chitu-${PLATFORM}:${CI_COMMIT_TAG} ${CLOUD_REGISTRY}/public/chitu-${PLATFORM}:latest
docker push ${CLOUD_REGISTRY}/public/chitu-${PLATFORM}:latest
after_script:
- docker logout $CLOUD_REGISTRY
when: manual
# NVIDIA平台构建
build-image-nvidia:
<<: *build-platform-template
tags:
- h20
variables:
PLATFORM: "nvidia"
BUILD_SCRIPT: |
docker build \
--build-arg torch_cuda_arch_list='9.0+PTX' \
--build-arg optional_deps='flash_attn,flashinfer,flash_mla,deep_gemm,quant,cpu' \
--build-arg enable_editable_install=false \
--build-arg enable_cython=true \
--build-arg enable_test=true \
-t ${CLOUD_REGISTRY}/public/chitu-${PLATFORM}:${CI_COMMIT_TAG} \
.
# Muxi平台构建
build-image-muxi:
<<: *build-platform-template
tags:
- muxi
variables:
PLATFORM: "muxi"
BUILD_SCRIPT: |
bash ./script/two-stage-docker-build.sh \
'muxi.Dockerfile' \
'muxi_layout_kernels' \
'' \
'false' \
'true' \
'true' \
${CLOUD_REGISTRY}/public/chitu-${PLATFORM} \
"${CI_COMMIT_TAG}" \
docker run \
--device=/dev/dri \
--device=/dev/mxcd \
--group-add video \
--privileged=true \
--security-opt seccomp=unconfined \
--security-opt apparmor=unconfined \
--shm-size '100gb' \
--ulimit memlock=-1
# Ascend平台构建
build-image-ascend:
<<: *build-platform-template
tags:
- huawei-4-910B
variables:
PLATFORM: "ascend"
BUILD_SCRIPT: |
bash ./script/two-stage-docker-build.sh \
'ascend.Dockerfile' \
'' \
'' \
'false' \
'true' \
'true' \
${CLOUD_REGISTRY}/public/chitu-${PLATFORM} \
"${CI_COMMIT_TAG}" \
grun 8 docker run \
--device /dev/davinci0 \
--device /dev/davinci1 \
--device /dev/davinci2 \
--device /dev/davinci3 \
--device /dev/davinci4 \
--device /dev/davinci5 \
--device /dev/davinci6 \
--device /dev/davinci7 \
--device /dev/davinci_manager \
--device /dev/devmm_svm \
--device /dev/hisi_hdc \
-v /usr/local/dcmi:/usr/local/dcmi \
-v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi \
-v /usr/local/Ascend/driver/lib64/:/usr/local/Ascend/driver/lib64/ \
-v /usr/local/Ascend/driver/version.info:/usr/local/Ascend/driver/version.info \
-v /etc/ascend_install.info:/etc/ascend_install.info