Skip to content

Commit 0647d1f

Browse files
authored
feat: Introduce Official Docker Image (#1201)
* Feature(docker): Introduce official docker image * Feature(docker): Build :latest image for testing * Feature(docker): Introduce cubejs/cube:dev (for nightly releases and dev testing) * Feature: Build :dev image (aka nightly) for each commit on master * Feature: Push docker images on release * misc(ci): Use Node 12 for integration tests * Misc(druid): Add healthchecks for testing container * misc(ci): Rework timeouts - It's funny moment, but looks likes GitHub counts queued minutes in timeout, but I didnt find a proof
1 parent 672df3c commit 0647d1f

File tree

14 files changed

+4887
-10
lines changed

14 files changed

+4887
-10
lines changed

.dockerignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
**
2+
!package.json
3+
!yarn.lock
4+
!lerna.json
5+
!packages/
6+
7+
packages/*/node_modules/
8+
packages/cubejs-jdbc-driver
9+
packages/cubejs-serverless
10+
packages/cubejs-serverless-aws
11+
packages/cubejs-serverless-google
12+
packages/cubejs-client-ngx
13+
packages/cubejs-client-vue

.github/workflows/master.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Publish Docker image for master (nightly)
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
docker-image-dev:
8+
name: Build & Push docker image
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check out the repo
12+
uses: actions/checkout@v2
13+
- name: Login to DockerHub
14+
uses: docker/login-action@v1
15+
with:
16+
username: ${{ secrets.DOCKERHUB_USERNAME }}
17+
password: ${{ secrets.DOCKERHUB_TOKEN }}
18+
- name: Push to Docker Hub
19+
uses: docker/build-push-action@v2
20+
with:
21+
context: ./
22+
file: ./packages/cubejs-docker/dev.Dockerfile
23+
platforms: linux/amd64
24+
repository: cubejs/cube
25+
tags: cubejs/cube:dev

.github/workflows/publish.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,28 @@ jobs:
5151
env:
5252
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
5353
- name: NPM publish
54-
run: ./node_modules/.bin/lerna publish from-git --yes
54+
run: ./node_modules/.bin/lerna publish from-git --yes
55+
56+
docker-image-push:
57+
name: Push Docker image for latest & release
58+
runs-on: ubuntu-latest
59+
timeout-minutes: 30
60+
61+
steps:
62+
- name: Check out the repo
63+
uses: actions/checkout@v2
64+
- name: Login to DockerHub
65+
uses: docker/login-action@v1
66+
with:
67+
username: ${{ secrets.DOCKERHUB_USERNAME }}
68+
password: ${{ secrets.DOCKERHUB_TOKEN }}
69+
- name: Push to Docker Hub
70+
uses: docker/build-push-action@v2
71+
with:
72+
context: ./packages/cubejs-docker
73+
file: ./packages/cubejs-docker/latest.Dockerfile
74+
platforms: linux/amd64
75+
repository: cubejs/cube
76+
tags: |
77+
cubejs/cube:latest
78+
cubejs/cube:${{ GITHUB_REF }}

.github/workflows/push.yml

Lines changed: 62 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on: [push, pull_request]
55
jobs:
66
unit:
77
runs-on: ubuntu-latest
8-
timeout-minutes: 30
8+
timeout-minutes: 60
99

1010
strategy:
1111
matrix:
@@ -51,7 +51,7 @@ jobs:
5151

5252
lint:
5353
runs-on: ubuntu-latest
54-
timeout-minutes: 10
54+
timeout-minutes: 60
5555

5656
steps:
5757
- name: Checkout
@@ -90,7 +90,7 @@ jobs:
9090

9191
build:
9292
runs-on: ubuntu-latest
93-
timeout-minutes: 15
93+
timeout-minutes: 60
9494

9595
steps:
9696
- name: Checkout
@@ -132,7 +132,7 @@ jobs:
132132

133133
integration-wrk-1:
134134
runs-on: ubuntu-latest
135-
timeout-minutes: 15
135+
timeout-minutes: 60
136136

137137
services:
138138
redis:
@@ -145,7 +145,7 @@ jobs:
145145
146146
strategy:
147147
matrix:
148-
node-version: [10.x]
148+
node-version: [12.x]
149149
fail-fast: false
150150

151151
steps:
@@ -183,36 +183,42 @@ jobs:
183183
- name: Lerna tsc
184184
run: yarn lerna run --concurrency 1 tsc
185185
- name: Run Postgres Integration with 9.6
186+
timeout-minutes: 10
186187
run: |
187188
docker pull postgres:${TEST_PGSQL_VERSION}
188189
yarn lerna run --concurrency 1 --ignore @cubejs-backend/jdbc-driver integration:postgres
189190
env:
190191
TEST_PGSQL_VERSION: 9.6
191192
- name: Run Postgres Integration with 10
193+
timeout-minutes: 10
192194
run: |
193195
docker pull postgres:${TEST_PGSQL_VERSION}
194196
yarn lerna run --concurrency 1 --ignore @cubejs-backend/jdbc-driver integration:postgres
195197
env:
196198
TEST_PGSQL_VERSION: 10
197199
- name: Run Postgres Integration with 11
200+
timeout-minutes: 10
198201
run: |
199202
docker pull postgres:${TEST_PGSQL_VERSION}
200203
yarn lerna run --concurrency 1 --ignore @cubejs-backend/jdbc-driver integration:postgres
201204
env:
202205
TEST_PGSQL_VERSION: 11
203206
- name: Run Postgres Integration with 12
207+
timeout-minutes: 10
204208
run: |
205209
docker pull postgres:${TEST_PGSQL_VERSION}
206210
yarn lerna run --concurrency 1 --ignore @cubejs-backend/jdbc-driver integration:postgres
207211
env:
208212
TEST_PGSQL_VERSION: 12
209213
- name: Run MS SQL Integration with 2017-latest
214+
timeout-minutes: 10
210215
run: |
211216
docker pull mcr.microsoft.com/mssql/server:${TEST_MSSQL_VERSION}
212217
yarn lerna run --concurrency 1 --ignore @cubejs-backend/jdbc-driver integration:mssql
213218
env:
214219
TEST_MSSQL_VERSION: 2017-latest
215220
- name: Run MS SQL Integration with 2019-latest
221+
timeout-minutes: 10
216222
run: |
217223
docker pull mcr.microsoft.com/mssql/server:${TEST_MSSQL_VERSION}
218224
yarn lerna run --concurrency 1 --ignore @cubejs-backend/jdbc-driver integration:mssql
@@ -221,7 +227,7 @@ jobs:
221227

222228
integration-wrk-2:
223229
runs-on: ubuntu-latest
224-
timeout-minutes: 15
230+
timeout-minutes: 60
225231

226232
services:
227233
redis:
@@ -234,7 +240,7 @@ jobs:
234240
235241
strategy:
236242
matrix:
237-
node-version: [10.x]
243+
node-version: [12.x]
238244
fail-fast: false
239245

240246
steps:
@@ -272,30 +278,35 @@ jobs:
272278
- name: Lerna tsc
273279
run: yarn lerna run --concurrency 1 tsc
274280
- name: Run MySQL Integration with 5.6
281+
timeout-minutes: 10
275282
run: |
276283
docker pull mysql:${TEST_MYSQL_VERSION}
277284
yarn lerna run --concurrency 1 --ignore @cubejs-backend/jdbc-driver integration:mysql
278285
env:
279286
TEST_MYSQL_VERSION: 5.6
280287
- name: Run MySQL Integration with 5.7
288+
timeout-minutes: 10
281289
run: |
282290
docker pull mysql:${TEST_MYSQL_VERSION}
283291
yarn lerna run --concurrency 1 --ignore @cubejs-backend/jdbc-driver integration:mysql
284292
env:
285293
TEST_MYSQL_VERSION: 5.7
286294
- name: Run Clickhouse Integration with 20.6
295+
timeout-minutes: 10
287296
run: |
288297
docker pull yandex/clickhouse-server:${TEST_CLICKHOUSE_VERSION}
289298
yarn lerna run --concurrency 1 --ignore @cubejs-backend/jdbc-driver integration:clickhouse
290299
env:
291300
TEST_CLICKHOUSE_VERSION: 20.6
292301
- name: Run Clickhouse Integration with 20
302+
timeout-minutes: 10
293303
run: |
294304
docker pull yandex/clickhouse-server:${TEST_CLICKHOUSE_VERSION}
295305
yarn lerna run --concurrency 1 --ignore @cubejs-backend/jdbc-driver integration:clickhouse
296306
env:
297307
TEST_CLICKHOUSE_VERSION: 20
298308
- name: Run Clickhouse Integration with 19
309+
timeout-minutes: 10
299310
run: |
300311
docker pull yandex/clickhouse-server:${TEST_CLICKHOUSE_VERSION}
301312
yarn lerna run --concurrency 1 --ignore @cubejs-backend/jdbc-driver integration:clickhouse
@@ -304,7 +315,7 @@ jobs:
304315

305316
integration-wrk-3:
306317
runs-on: ubuntu-latest
307-
timeout-minutes: 15
318+
timeout-minutes: 60
308319

309320
services:
310321
redis:
@@ -317,7 +328,7 @@ jobs:
317328
318329
strategy:
319330
matrix:
320-
node-version: [10.x]
331+
node-version: [12.x]
321332
fail-fast: false
322333

323334
steps:
@@ -355,6 +366,7 @@ jobs:
355366
- name: Lerna tsc
356367
run: yarn lerna run --concurrency 1 tsc
357368
- name: Run PrestoDB Integration with Postgres 12.4
369+
timeout-minutes: 15
358370
run: |
359371
docker pull lewuathe/presto-coordinator:${TEST_PRESTO_VERSION}
360372
docker pull lewuathe/presto-worker:${TEST_PRESTO_VERSION}
@@ -364,6 +376,7 @@ jobs:
364376
TEST_PGSQL_VERSION: 12.4
365377
TEST_PRESTO_VERSION: 341-SNAPSHOT
366378
- name: Run Druid Integration with 0.0.19
379+
timeout-minutes: 15
367380
run: |
368381
docker pull postgres:${TEST_POSTGRES_VERSION}
369382
docker pull zookeeper:${TEST_ZOOKEEPER_VERSION}
@@ -373,3 +386,43 @@ jobs:
373386
TEST_POSTGRES_VERSION: latest
374387
TEST_ZOOKEEPER_VERSION: 3.5
375388
TEST_DRUID_VERSION: 0.19.0
389+
390+
docker-image-latest:
391+
runs-on: ubuntu-latest
392+
timeout-minutes: 60
393+
394+
steps:
395+
- name: Checkout
396+
uses: actions/checkout@v2
397+
- name: Set up QEMU
398+
uses: docker/setup-qemu-action@v1
399+
- name: Set up Docker Buildx
400+
uses: docker/setup-buildx-action@v1
401+
- name: Build only
402+
uses: docker/build-push-action@v2
403+
timeout-minutes: 15
404+
with:
405+
context: ./packages/cubejs-docker
406+
file: ./packages/cubejs-docker/latest.Dockerfile
407+
platforms: linux/amd64
408+
push: false
409+
410+
docker-image-dev:
411+
runs-on: ubuntu-latest
412+
timeout-minutes: 60
413+
414+
steps:
415+
- name: Checkout
416+
uses: actions/checkout@v2
417+
- name: Set up QEMU
418+
uses: docker/setup-qemu-action@v1
419+
- name: Set up Docker Buildx
420+
uses: docker/setup-buildx-action@v1
421+
- name: Build only
422+
uses: docker/build-push-action@v2
423+
timeout-minutes: 15
424+
with:
425+
context: .
426+
file: ./packages/cubejs-docker/dev.Dockerfile
427+
platforms: linux/amd64
428+
push: false

packages/cubejs-docker/.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

0 commit comments

Comments
 (0)