Skip to content

Commit b7ba796

Browse files
committed
fix(docker): improve docker tags to be cleared and avoid conflicts
1 parent a53c537 commit b7ba796

14 files changed

+847
-253
lines changed

.asf.yaml

+12-1
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ github:
5959
# strict means "Require branches to be up to date before merging".
6060
strict: false
6161
# contexts are the names of checks that must pass
62+
# unfortunately AFAICT for `matrix:` jobs, we have to itemize every
63+
# combination here.
6264
contexts:
63-
- check
65+
- lint-check
6466
- cypress-matrix (1, chrome)
6567
- cypress-matrix (2, chrome)
6668
- cypress-matrix (3, chrome)
@@ -72,6 +74,15 @@ github:
7274
- test-postgres (3.9)
7375
- test-postgres (3.10)
7476
- test-sqlite (3.9)
77+
- ephemeral-docker-build
78+
- docker-build (dev, linux/amd64)
79+
- docker-build (lean, linux/amd64)
80+
- docker-build (py310, linux/arm64)
81+
- docker-build (py310, linux/amd64)
82+
- docker-build (websocket, linux/arm64)
83+
- docker-build (websocket, linux/amd64)
84+
- docker-build (dockerize, linux/arm64)
85+
- docker-build (dockerize, linux/amd64)
7586

7687
required_pull_request_reviews:
7788
dismiss_stale_reviews: false

.github/workflows/docker-release.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,15 @@ jobs:
2424
runs-on: ubuntu-latest
2525
strategy:
2626
matrix:
27-
target: ["dev", "lean", "lean310", "websocket", "dockerize"]
27+
build_preset: ["dev", "lean", "py310", "websocket", "dockerize"]
2828
platform: ["linux/amd64", "linux/arm64"]
29+
exclude:
30+
# disabling because slow! no python wheels for arm/py39 and
31+
# QEMU is slow!
32+
- build_preset: "dev"
33+
platform: "linux/arm64"
34+
- build_preset: "lean"
35+
platform: "linux/arm64"
2936
fail-fast: false
3037
steps:
3138
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
@@ -47,4 +54,5 @@ jobs:
4754
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
4855
run: |
4956
GITHUB_RELEASE_TAG_NAME="${{ github.event.release.tag_name }}"
50-
./scripts/docker_build_push.sh "$GITHUB_RELEASE_TAG_NAME" ${{ matrix.target }} ${{ matrix.platform }}
57+
pip install click
58+
./scripts/build_docker.py ${{ matrix.build_preset }} release --platform ${{ matrix.platform }}

.github/workflows/docker.yml

+15-14
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,24 @@ on:
77
pull_request:
88
types: [synchronize, opened, reopened, ready_for_review]
99

10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
12+
cancel-in-progress: true
13+
1014
jobs:
1115
docker-build:
1216
name: docker-build
1317
runs-on: ubuntu-latest
1418
strategy:
1519
matrix:
16-
target: ["dev", "lean", "lean310", "websocket", "dockerize"]
20+
build_preset: ["dev", "lean", "py310", "websocket", "dockerize"]
1721
platform: ["linux/amd64", "linux/arm64"]
1822
exclude:
1923
# disabling because slow! no python wheels for arm/py39 and
2024
# QEMU is slow!
21-
- target: "dev"
25+
- build_preset: "dev"
2226
platform: "linux/arm64"
23-
- target: "lean"
27+
- build_preset: "lean"
2428
platform: "linux/arm64"
2529
fail-fast: false
2630
steps:
@@ -41,11 +45,11 @@ jobs:
4145
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
4246
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
4347
run: |
44-
./scripts/docker_build_push.sh "" ${{ matrix.target }} ${{ matrix.platform }}
48+
pip install click
49+
./scripts/build_docker.py ${{ matrix.build_preset }} ${{ github.event_name }} --platform ${{ matrix.platform }}
4550
4651
4752
ephemeral-docker-build:
48-
name: docker-build
4953
runs-on: ubuntu-latest
5054
steps:
5155
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
@@ -61,19 +65,16 @@ jobs:
6165

6266
- name: Build ephemeral env image
6367
if: github.event_name == 'pull_request'
68+
env:
69+
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
70+
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
6471
run: |
72+
pip install click
73+
./scripts/build_docker.py "ci" "pull_request" --platform linux/amd64
6574
mkdir -p ./build
6675
echo ${{ github.sha }} > ./build/SHA
6776
echo ${{ github.event.pull_request.number }} > ./build/PR-NUM
68-
docker buildx build --target ci \
69-
--load \
70-
--cache-from=type=registry,ref=apache/superset:lean \
71-
-t ${{ github.sha }} \
72-
-t "pr-${{ github.event.pull_request.number }}" \
73-
--platform linux/amd64 \
74-
--label "build_actor=${GITHUB_ACTOR}" \
75-
.
76-
docker save ${{ github.sha }} | gzip > ./build/${{ github.sha }}.tar.gz
77+
docker save ${{ github.sha }}-ci | gzip > ./build/${{ github.sha }}.tar.gz
7778
7879
- name: Upload build artifacts
7980
if: github.event_name == 'pull_request'

.github/workflows/pr-lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
types: [opened, edited, reopened, synchronize]
1010

1111
jobs:
12-
check:
12+
lint-check:
1313
runs-on: ubuntu-latest
1414
permissions:
1515
contents: read

.github/workflows/superset-e2e.yml

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
pull_request:
88
types: [synchronize, opened, reopened, ready_for_review]
99

10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
12+
cancel-in-progress: true
13+
1014
jobs:
1115
cypress-matrix:
1216
runs-on: ubuntu-20.04

.github/workflows/superset-python-integrationtest.yml

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
pull_request:
99
types: [synchronize, opened, reopened, ready_for_review]
1010

11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
13+
cancel-in-progress: true
14+
1115
jobs:
1216
test-mysql:
1317
runs-on: ubuntu-20.04

docs/docs/installation/installing-superset-from-scratch.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ brew install readline pkg-config libffi openssl mysql postgresql@14
6767
You should install a recent version of Python. Refer to the [setup.py](https://github.com/apache/superset/blob/master/setup.py) file for a list of Python versions officially supported by Superset. We'd recommend using a Python version manager like [pyenv](https://github.com/pyenv/pyenv) (and also [pyenv-virtualenv](https://github.com/pyenv/pyenv-virtualenv)).
6868

6969
:::tip
70-
To identify the Python version used by the official docker image, see the [Dockerfile](https://github.com/apache/superset/blob/master/Dockerfile). Additional docker images published for newer versions of Python can be found in [this file](https://github.com/apache/superset/blob/master/scripts/docker_build_push.sh).
70+
To identify the Python version used by the official docker image, see the [Dockerfile](https://github.com/apache/superset/blob/master/Dockerfile). Additional docker images published for newer versions of Python can be found in [this file](https://github.com/apache/superset/blob/master/scripts/build_docker.py).
7171
:::
7272

7373
Let's also make sure we have the latest version of `pip` and `setuptools`:

pytest.ini

+1
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@
1818
testpaths =
1919
tests
2020
python_files = *_test.py test_*.py *_tests.py *viz/utils.py
21+
addopts = -p no:warnings

0 commit comments

Comments
 (0)