forked from IllinoisSocialMediaMacroscope/smm-analytics
-
Notifications
You must be signed in to change notification settings - Fork 0
241 lines (228 loc) · 9.42 KB
/
docker.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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
name: CI
on:
push:
branches:
- main
- develop
- 'release/*'
tags:
- '*'
pull_request:
env:
MAIN_REPO: ncsa/standalone-smm-analytics
jobs:
# ----------------------------------------------------------------------
# DOCKER BUILD
# ----------------------------------------------------------------------
docker:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
name:
- autophrase
- histogram
- check_screen_name
- classification_predict
- classification_train
- classification_split
- collect_reddit_comment
- crimson_hexagon_monitors
- image_crawler
- name_entity_recognition
- network_analysis
- preprocessing
- screen_name_prompt
- sentiment_analysis
- topic_modeling
- clowder_create_collection
- clowder_create_dataset
- clowder_create_space
- clowder_list
- clowder_upload_file
include:
- name: autophrase
dockerfile: Dockerfile
workdir: containerized_analytics/smile/autophrase
docker_repo_tag: socialmediamacroscope/autophrase
github_repo_tag: ncsa/autophrase
- name: histogram
dockerfile: Dockerfile
workdir: containerized_analytics/smile/histogram
docker_repo_tag: socialmediamacroscope/histogram
github_repo_tag: ncsa/histogram
- name: check_screen_name
dockerfile: Dockerfile
workdir: containerized_analytics/smile/check_screen_name
docker_repo_tag: socialmediamacroscope/check_screen_name
github_repo_tag: ncsa/check_screen_name
- name: classification_predict
dockerfile: Dockerfile
workdir: containerized_analytics/smile/classification_predict
docker_repo_tag: socialmediamacroscope/classification_predict
github_repo_tag: ncsa/classification_predict
- name: classification_train
dockerfile: Dockerfile
workdir: containerized_analytics/smile/classification_train
docker_repo_tag: socialmediamacroscope/classification_train
github_repo_tag: ncsa/classification_train
- name: classification_split
dockerfile: Dockerfile
workdir: containerized_analytics/smile/classification_split
docker_repo_tag: socialmediamacroscope/classification_split
github_repo_tag: ncsa/classification_split
- name: collect_reddit_comment
dockerfile: Dockerfile
workdir: containerized_analytics/smile/collect_reddit_comment
docker_repo_tag: socialmediamacroscope/collect_reddit_comment
github_repo_tag: ncsa/collect_reddit_comment
- name: crimson_hexagon_monitors
dockerfile: Dockerfile
workdir: containerized_analytics/smile/crimson_hexagon_monitors
docker_repo_tag: socialmediamacroscope/crimson_hexagon_monitors
github_repo_tag: ncsa/crimson_hexagon_monitors
- name: image_crawler
dockerfile: Dockerfile
workdir: containerized_analytics/smile/image_crawler
docker_repo_tag: socialmediamacroscope/image_crawler
github_repo_tag: ncsa/image_crawler
- name: name_entity_recognition
dockerfile: Dockerfile
workdir: containerized_analytics/smile/name_entity_recognition
docker_repo_tag: socialmediamacroscope/name_entity_recognition
github_repo_tag: ncsa/name_entity_recognition
- name: network_analysis
dockerfile: Dockerfile
workdir: containerized_analytics/smile/network_analysis
docker_repo_tag: socialmediamacroscope/network_analysis
github_repo_tag: ncsa/network_analysis
- name: preprocessing
dockerfile: Dockerfile
workdir: containerized_analytics/smile/preprocessing
docker_repo_tag: socialmediamacroscope/preprocessing
github_repo_tag: ncsa/preprocessing
- name: screen_name_prompt
dockerfile: Dockerfile
workdir: containerized_analytics/smile/screen_name_prompt
docker_repo_tag: socialmediamacroscope/screen_name_prompt
github_repo_tag: ncsa/screen_name_prompt
- name: sentiment_analysis
dockerfile: Dockerfile
workdir: containerized_analytics/smile/sentiment_analysis
docker_repo_tag: socialmediamacroscope/sentiment_analysis
github_repo_tag: ncsa/sentiment_analysis
- name: topic_modeling
dockerfile: Dockerfile
workdir: containerized_analytics/smile/topic_modeling
docker_repo_tag: socialmediamacroscope/topic_modeling
github_repo_tag: ncsa/topic_modeling
- name: clowder_create_collection
dockerfile: Dockerfile
workdir: containerized_analytics/clowder/clowder_create_collection
docker_repo_tag: socialmediamacroscope/clowder_create_collection
github_repo_tag: ncsa/clowder_create_collection
- name: clowder_create_dataset
dockerfile: Dockerfile
workdir: containerized_analytics/clowder/clowder_create_dataset
docker_repo_tag: socialmediamacroscope/clowder_create_dataset
github_repo_tag: ncsa/clowder_create_dataset
- name: clowder_create_space
dockerfile: Dockerfile
workdir: containerized_analytics/clowder/clowder_create_space
docker_repo_tag: socialmediamacroscope/clowder_create_space
github_repo_tag: ncsa/clowder_create_space
- name: clowder_list
dockerfile: Dockerfile
workdir: containerized_analytics/clowder/clowder_list
docker_repo_tag: socialmediamacroscope/clowder_list
github_repo_tag: ncsa/clowder_list
- name: clowder_upload_file
dockerfile: Dockerfile
workdir: containerized_analytics/clowder/clowder_upload_file
docker_repo_tag: socialmediamacroscope/clowder_upload_file
github_repo_tag: ncsa/clowder_upload_file
steps:
# checkout source code
- uses: actions/checkout@v2
# calculate version information
- name: version information
run: |
if [ "${{ github.event.release.target_commitish }}" != "" ]; then
BRANCH="${{ github.event.release.target_commitish }}"
elif [[ "${{github.event_name}}" == "pull_request" ]]; then
BRANCH="PR-${{github.event.pull_request.number}}"
else
BRANCH=${GITHUB_REF##*/}
fi
echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV
if [ "$BRANCH" == "main" ]; then
CHANGELOG_FILE="${{ matrix.workdir }}/CHANGELOG.md"
if [ -e "$CHANGELOG_FILE" ]; then
VERSION=$(cat "$CHANGELOG_FILE" | grep -Eo '\[[0-9]+\.[0-9]+\.[0-9]+\]'| head -1 | tr -d '[]')
VERSIONS="latest"
OLDVERSION=""
TMPVERSION=$VERSION
while [ "$OLDVERSION" != "$TMPVERSION" ]; do
VERSIONS="${VERSIONS} ${TMPVERSION}"
OLDVERSION="${TMPVERSION}"
TMPVERSION=$(echo ${OLDVERSION} | sed 's/\.[0-9]*$//')
done
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "TAGS=${VERSIONS}" >> $GITHUB_ENV
else
echo "VERSION=latest" >> $GITHUB_ENV
echo "TAGS=latest" >> $GITHUB_ENV
fi
elif [ "$BRANCH" == "develop" ]; then
echo "VERSION=develop" >> $GITHUB_ENV
echo "TAGS=develop" >> $GITHUB_ENV
else
echo "VERSION=testing" >> $GITHUB_ENV
echo "TAGS=${BRANCH}" >> $GITHUB_ENV
fi
- name: Print Version tag
run: echo "${{ env.TAGS }}"
# login to registries
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build docker image
if: |
github.repository == env.MAIN_REPO &&
github.event_name == 'push' &&
(env.GITHUB_BRANCH == 'main' || env.GITHUB_BRANCH == 'develop')
uses: elgohr/[email protected]
with:
dockerfile: ${{ matrix.dockerfile }}
name: ${{ matrix.docker_repo_tag }}
no_push: true
workdir: ${{ matrix.workdir }}
- name: Publish doc image to Docker Hub
if: |
github.repository == env.MAIN_REPO &&
github.event_name == 'push' &&
env.GITHUB_BRANCH == 'main'
uses: elgohr/[email protected]
with:
registry: docker.io
name: ${{ matrix.docker_repo_tag }}
username: ${{ secrets.HUB_USERNAME }}
password: ${{ secrets.HUB_PASSWORD }}
tags: "${{ env.TAGS }}"
workdir: ${{ matrix.workdir }}
- name: Publish doc image to Github
if: |
github.repository == env.MAIN_REPO &&
github.event_name == 'push' &&
env.GITHUB_BRANCH == 'develop'
uses: elgohr/[email protected]
with:
registry: ghcr.io
name: ${{ matrix.github_repo_tag }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
tags: "${{ env.TAGS }}"
workdir: ${{ matrix.workdir }}