forked from gnes-ai/gnes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.orange-ci.yml
164 lines (152 loc) · 5.36 KB
/
.orange-ci.yml
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
ok-stage: &ok_stage
- name: git comment
jobs:
- name: make comment
script: echo "looks good to me 👍" > comment.txt
- name: submit comment
type: git:comment
options:
fromFile: comment.txt
- name: make notification
script: echo "# ✅ 由$ORANGE_BUILD_USER提交的$ORANGE_MERGE_REQUEST_BRANCH分支刚刚测试通过!\n[点击查看](https://git.code.oa.com/ai-innersource/nes/)" > notify.md
- name: message
type: wework:message
options:
robot: f5ee526b-c6dc-4ef1-97c0-ac14594e57b0
fromFile: notify.md
install-deps: &install_deps
- name: install dependencies
jobs:
- name: setup cache to local
script: mkdir -p .cache && ln -snf $(pwd)/.cache $HOME/.cache
- name: show cache folders
script: printf "XDG_CACHE_HOME=$XDG_CACHE_HOME\nPIP_DOWNLOAD_CACHE=$PIP_DOWNLOAD_CACHE\n"
- name: show cpu flag
script: cat /proc/cpuinfo | grep flags
- name: install project deps
env:
INDEX_URL: http://mirrors.oa.com/pypi/web/simple/
TRUST_DOM: mirrors.oa.com
script: "pip install -e .[all] -i ${INDEX_URL} --extra-index-url ${INDEX_URL} --trusted-host ${TRUST_DOM}"
- name: check tensorflow works correctly
script: "python -c 'import tensorflow as tf; print(tf.__version__); a=tf.constant(1, tf.int32); print(tf.Session().run(a))'"
pylint: &pylint
- name: check code style
script: pylint gnes/**/*.py --exit-zero
unit-test: &unit_test
- name: run unit test
script: python -m unittest tests/*.py
basic-pipeline: &bp1
network: idc-ai-sse4
docker:
image: docker.oa.com:8080/public/ailab-faiss-bert-elmo-openai-w2v:latest
env:
GNES_ENV_SET: orange-ci
PIP_DOWNLOAD_CACHE: ${pwd}.cache/pip_download_cache
XDG_CACHE_HOME: ${pwd}.cache/pip
cacheFrom: .orange-ci.cache
stages:
- <<: *install_deps
- <<: *pylint
- <<: *unit_test
- <<: *ok_stage
notify-pipeline1: &np1
network: devnet
stages:
- name: make notification
script: echo "# 🚀 NES的Master分支刚刚更新了!\n此次更新由$ORANGE_BUILD_USER提交的$ORANGE_MERGE_REQUEST_BRANCH合并后触发,[点击查看](https://git.code.oa.com/ai-innersource/nes/)" > notify.md
- name: send mail
type: mail:send
options:
title: 🚀 NES的Master分支刚刚更新!
to:
- hanhxiao
- larryjfyan
- madwang
type: markdown
fromFile: notify.md
- name: message
type: wework:message
options:
robot: f5ee526b-c6dc-4ef1-97c0-ac14594e57b0
fromFile: notify.md
docker-stage: &docker_stage
- name: docker push
jobs:
- name: docker login
script: docker login -u $DOCKER_USER -p $DOCKER_PWD docker.oa.com:8080
- name: push docker
script: export DOCKER_NAMESPACE="docker.oa.com:8080/public" && bash docker-push.sh $GIT_TAG
- name: make notification
script: export DOCKER_NAMESPACE="docker.oa.com:8080/public" && echo "# 🗳️ NES容器的$GIT_TAG版本刚刚更新至$DOCKER_NAMESPACE!\n运行此版本:\ndocker pull $DOCKER_NAMESPACE/$PROJ_NAME:$GIT_TAG && docker run -v /data1/cips/data:/ext_data -it $DOCKER_NAMESPACE/$PROJ_NAME:$GIT_TAG bash" >>notify.md
- name: docker login
script: docker login -u $TCLOUD_USER -p $TCLOUD_PWD ccr.ccs.tencentyun.com
- name: push docker
script: export DOCKER_NAMESPACE="ccr.ccs.tencentyun.com/gnes" && bash docker-push.sh $GIT_TAG
- name: make notification
script: export DOCKER_NAMESPACE="ccr.ccs.tencentyun.com/gnes" && echo "# 🗳️ NES容器的$GIT_TAG版本刚刚更新至$DOCKER_NAMESPACE!\n运行此版本:\ndocker pull $DOCKER_NAMESPACE/$PROJ_NAME:$GIT_TAG && docker run -v /data1/cips/data:/ext_data -it $DOCKER_NAMESPACE/$PROJ_NAME:$GIT_TAG bash" >> notify.md
release-stage: &release_stage1
- name: notify about release
jobs:
- name: send mail
type: mail:send
options:
title: 🗳️ NES容器的$GIT_TAG刚刚更新!
to:
- hanhxiao
- larryjfyan
- madwang
type: markdown
fromFile: notify.md
- name: message
type: wework:message
options:
robot: f5ee526b-c6dc-4ef1-97c0-ac14594e57b0
fromFile: notify.md
release-stage2: &release_stage2
- name: notify about release
jobs:
- name: send mail
type: mail:send
options:
title: 🗳️ NES容器的$GIT_TAG刚刚更新!
to:
- g_AIPD_SC_RELEVANCE
type: markdown
fromFile: notify.md
- name: message
type: wework:message
options:
robot: 33f48450-4e17-4e99-b476-b1c97ea233c6
fromFile: notify.md
docker-pipeline1: &dp1
network: devnet
services:
- docker
envFrom: https://git.code.oa.com/hanhxiao/nes-keys/blob/master/env
env:
PROJ_NAME: aipd-gnes
GIT_TAG: master
stages:
- <<: *docker_stage
- <<: *release_stage1
docker-pipeline2: &dp2
network: devnet
services:
- docker
envFrom: https://git.code.oa.com/hanhxiao/nes-keys/blob/master/env
env:
PROJ_NAME: aipd-gnes
GIT_TAG: $ORANGE_BRANCH
stages:
- <<: *docker_stage
- <<: *release_stage2
master:
merge_request:
- <<: *bp1
push:
- <<: *np1
- <<: *dp1
"**":
tag_push:
- <<: *dp2