144 lines (123 loc) · 7.48 KB
/
build-graphscope-images-linux.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
name: Build GraphScope Images on Linux
# on: [push, pull_request]
on:
workflow_dispatch:
schedule:
# The notifications for scheduled workflows are sent to the user who
# last modified the cron syntax in the workflow file.
# Trigger the workflow at 03:00(CST) every day.
- cron: '00 19 * * *'
push:
tags:
- "v*"
env:
REGISTRY: registry.cn-hongkong.aliyuncs.com
jobs:
build-image:
if: (github.ref == 'refs/heads/main' && github.repository == 'alibaba/GraphScope') || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope')
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Add envs to GITHUB_ENV
run: |
short_sha=$(git rev-parse --short HEAD)
echo "SHORT_SHA=${short_sha}" >> $GITHUB_ENV
- name: Build GraphScope Image
run: |
cd ${GITHUB_WORKSPACE}/k8s
make coordinator CI=false
make analytical CI=false
make analytical-java CI=false
make interactive-frontend CI=false
make interactive-executor CI=false
make learning CI=false
# make jupyter-image
# cd ${GITHUB_WORKSPACE}
# docker build --build-arg CI=${CI} -t graphscope/jupyter:${SHORT_SHA} -f ./k8s/internal/jupyter.Dockerfile .
# dataset image doesn't changed, we can just use the latest one
# make dataset-image
- name: Release Nightly Image
if: ${{ github.ref == 'refs/heads/main' && github.repository == 'alibaba/GraphScope' }}
env:
docker_password: ${{ secrets.DOCKER_PASSWORD }}
docker_username: ${{ secrets.DOCKER_USER }}
run: |
echo "${docker_password}" | sudo docker login --username="${docker_username}" ${{ env.REGISTRY }} --password-stdin
# docker tag: 0.15.0 -> 0.15.0a20220808
time=$(date "+%Y%m%d")
version=$(cat ${GITHUB_WORKSPACE}/VERSION)
tag="${version}a${time}"
# graphscope image
sudo docker tag graphscope/coordinator:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/coordinator:${tag}
sudo docker tag graphscope/analytical:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/analytical:${tag}
sudo docker tag graphscope/analytical-java:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/analytical-java:${tag}
sudo docker tag graphscope/interactive-frontend:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/interactive-frontend:${tag}
sudo docker tag graphscope/interactive-executor:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/interactive-executor:${tag}
sudo docker tag graphscope/learning:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/learning:${tag}
sudo docker push ${{ env.REGISTRY }}/graphscope/coordinator:${tag}
sudo docker push ${{ env.REGISTRY }}/graphscope/analytical:${tag}
# sudo docker push ${{ env.REGISTRY }}/graphscope/analytical-java:${tag}
sudo docker push ${{ env.REGISTRY }}/graphscope/interactive-frontend:${tag}
sudo docker push ${{ env.REGISTRY }}/graphscope/interactive-executor:${tag}
sudo docker push ${{ env.REGISTRY }}/graphscope/learning:${tag}
# jupyter image
# sudo docker tag graphscope/jupyter:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/jupyter:${tag}
# sudo docker push ${{ env.REGISTRY }}/graphscope/jupyter:${tag}
# dataset image
# sudo docker tag graphscope/dataset:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/dataset:${tag}
# sudo docker push ${{ env.REGISTRY }}/graphscope/dataset:${tag}
- name: Extract Tag Name
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }}
id: tag
run: echo "TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Release Image
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }}
env:
docker_password: ${{ secrets.DOCKER_PASSWORD }}
docker_username: ${{ secrets.DOCKER_USER }}
run: |
echo "${docker_password}" | sudo docker login --username="${docker_username}" ${{ env.REGISTRY }} --password-stdin
# Release version tag
tag=${{ steps.tag.outputs.TAG }}
# graphscope image
sudo docker tag graphscope/coordinator:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/coordinator:${tag}
sudo docker tag graphscope/analytical:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/analytical:${tag}
sudo docker tag graphscope/analytical-java:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/analytical-java:${tag}
sudo docker tag graphscope/interactive-frontend:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/interactive-frontend:${tag}
sudo docker tag graphscope/interactive-executor:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/interactive-executor:${tag}
sudo docker tag graphscope/learning:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/learning:${tag}
sudo docker push ${{ env.REGISTRY }}/graphscope/coordinator:${tag}
sudo docker push ${{ env.REGISTRY }}/graphscope/analytical:${tag}
sudo docker push ${{ env.REGISTRY }}/graphscope/analytical-java:${tag}
sudo docker push ${{ env.REGISTRY }}/graphscope/interactive-frontend:${tag}
sudo docker push ${{ env.REGISTRY }}/graphscope/interactive-executor:${tag}
sudo docker push ${{ env.REGISTRY }}/graphscope/learning:${tag}
# jupyter image
# sudo docker tag graphscope/jupyter:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/jupyter:${tag}
# sudo docker tag graphscope/jupyter:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/jupyter:latest
# sudo docker push ${{ env.REGISTRY }}/graphscope/jupyter:${tag}
# dataset image
# Note! dataset image are built mannually just use the latest one.
sudo docker pull ${{ env.REGISTRY }}/graphscope/dataset:latest
sudo docker tag ${{ env.REGISTRY }}/graphscope/dataset:latest ${{ env.REGISTRY }}/graphscope/dataset:${tag}
sudo docker push ${{ env.REGISTRY }}/graphscope/dataset:${tag}
# Release the latest tag
tag=latest
# graphscope image
sudo docker tag graphscope/coordinator:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/coordinator:${tag}
sudo docker tag graphscope/analytical:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/analytical:${tag}
sudo docker tag graphscope/analytical-java:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/analytical-java:${tag}
sudo docker tag graphscope/interactive-frontend:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/interactive-frontend:${tag}
sudo docker tag graphscope/interactive-executor:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/interactive-executor:${tag}
sudo docker tag graphscope/learning:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/learning:${tag}
sudo docker push ${{ env.REGISTRY }}/graphscope/coordinator:${tag}
sudo docker push ${{ env.REGISTRY }}/graphscope/analytical:${tag}
sudo docker push ${{ env.REGISTRY }}/graphscope/analytical-java:${tag}
sudo docker push ${{ env.REGISTRY }}/graphscope/interactive-frontend:${tag}
sudo docker push ${{ env.REGISTRY }}/graphscope/interactive-executor:${tag}
sudo docker push ${{ env.REGISTRY }}/graphscope/learning:${tag}
# jupyter image
# sudo docker tag graphscope/jupyter:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/jupyter:${tag}
# sudo docker push ${{ env.REGISTRY }}/graphscope/jupyter:${tag}