mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
feat(docker): allow for docker release builds to be multi-platform (#27055)
This commit is contained in:
committed by
GitHub
parent
5951f6ceb6
commit
13915bbb54
@@ -56,12 +56,12 @@ def test_is_latest_release(release, expected_bool):
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"build_preset, build_platform, sha, build_context, build_context_ref, expected_tags",
|
||||
"build_preset, build_platforms, sha, build_context, build_context_ref, expected_tags",
|
||||
[
|
||||
# PRs
|
||||
(
|
||||
"lean",
|
||||
"linux/arm64",
|
||||
["linux/arm64"],
|
||||
SHA,
|
||||
"pull_request",
|
||||
PR_ID,
|
||||
@@ -69,7 +69,7 @@ def test_is_latest_release(release, expected_bool):
|
||||
),
|
||||
(
|
||||
"ci",
|
||||
"linux/amd64",
|
||||
["linux/amd64"],
|
||||
SHA,
|
||||
"pull_request",
|
||||
PR_ID,
|
||||
@@ -77,7 +77,7 @@ def test_is_latest_release(release, expected_bool):
|
||||
),
|
||||
(
|
||||
"lean",
|
||||
"linux/amd64",
|
||||
["linux/amd64"],
|
||||
SHA,
|
||||
"pull_request",
|
||||
PR_ID,
|
||||
@@ -85,7 +85,7 @@ def test_is_latest_release(release, expected_bool):
|
||||
),
|
||||
(
|
||||
"dev",
|
||||
"linux/arm64",
|
||||
["linux/arm64"],
|
||||
SHA,
|
||||
"pull_request",
|
||||
PR_ID,
|
||||
@@ -97,7 +97,7 @@ def test_is_latest_release(release, expected_bool):
|
||||
),
|
||||
(
|
||||
"dev",
|
||||
"linux/amd64",
|
||||
["linux/amd64"],
|
||||
SHA,
|
||||
"pull_request",
|
||||
PR_ID,
|
||||
@@ -106,7 +106,7 @@ def test_is_latest_release(release, expected_bool):
|
||||
# old releases
|
||||
(
|
||||
"lean",
|
||||
"linux/arm64",
|
||||
["linux/arm64"],
|
||||
SHA,
|
||||
"release",
|
||||
OLD_REL,
|
||||
@@ -114,7 +114,7 @@ def test_is_latest_release(release, expected_bool):
|
||||
),
|
||||
(
|
||||
"lean",
|
||||
"linux/amd64",
|
||||
["linux/amd64"],
|
||||
SHA,
|
||||
"release",
|
||||
OLD_REL,
|
||||
@@ -122,7 +122,7 @@ def test_is_latest_release(release, expected_bool):
|
||||
),
|
||||
(
|
||||
"dev",
|
||||
"linux/arm64",
|
||||
["linux/arm64"],
|
||||
SHA,
|
||||
"release",
|
||||
OLD_REL,
|
||||
@@ -134,7 +134,7 @@ def test_is_latest_release(release, expected_bool):
|
||||
),
|
||||
(
|
||||
"dev",
|
||||
"linux/amd64",
|
||||
["linux/amd64"],
|
||||
SHA,
|
||||
"release",
|
||||
OLD_REL,
|
||||
@@ -143,7 +143,7 @@ def test_is_latest_release(release, expected_bool):
|
||||
# new releases
|
||||
(
|
||||
"lean",
|
||||
"linux/arm64",
|
||||
["linux/arm64"],
|
||||
SHA,
|
||||
"release",
|
||||
NEW_REL,
|
||||
@@ -156,7 +156,7 @@ def test_is_latest_release(release, expected_bool):
|
||||
),
|
||||
(
|
||||
"lean",
|
||||
"linux/amd64",
|
||||
["linux/amd64"],
|
||||
SHA,
|
||||
"release",
|
||||
NEW_REL,
|
||||
@@ -164,7 +164,7 @@ def test_is_latest_release(release, expected_bool):
|
||||
),
|
||||
(
|
||||
"dev",
|
||||
"linux/arm64",
|
||||
["linux/arm64"],
|
||||
SHA,
|
||||
"release",
|
||||
NEW_REL,
|
||||
@@ -177,7 +177,7 @@ def test_is_latest_release(release, expected_bool):
|
||||
),
|
||||
(
|
||||
"dev",
|
||||
"linux/amd64",
|
||||
["linux/amd64"],
|
||||
SHA,
|
||||
"release",
|
||||
NEW_REL,
|
||||
@@ -191,7 +191,7 @@ def test_is_latest_release(release, expected_bool):
|
||||
# merge on master
|
||||
(
|
||||
"lean",
|
||||
"linux/arm64",
|
||||
["linux/arm64"],
|
||||
SHA,
|
||||
"push",
|
||||
"master",
|
||||
@@ -199,7 +199,7 @@ def test_is_latest_release(release, expected_bool):
|
||||
),
|
||||
(
|
||||
"lean",
|
||||
"linux/amd64",
|
||||
["linux/amd64"],
|
||||
SHA,
|
||||
"push",
|
||||
"master",
|
||||
@@ -207,7 +207,7 @@ def test_is_latest_release(release, expected_bool):
|
||||
),
|
||||
(
|
||||
"dev",
|
||||
"linux/arm64",
|
||||
["linux/arm64"],
|
||||
SHA,
|
||||
"push",
|
||||
"master",
|
||||
@@ -219,7 +219,7 @@ def test_is_latest_release(release, expected_bool):
|
||||
),
|
||||
(
|
||||
"dev",
|
||||
"linux/amd64",
|
||||
["linux/amd64"],
|
||||
SHA,
|
||||
"push",
|
||||
"master",
|
||||
@@ -228,21 +228,21 @@ def test_is_latest_release(release, expected_bool):
|
||||
],
|
||||
)
|
||||
def test_get_docker_tags(
|
||||
build_preset, build_platform, sha, build_context, build_context_ref, expected_tags
|
||||
build_preset, build_platforms, sha, build_context, build_context_ref, expected_tags
|
||||
):
|
||||
tags = docker_utils.get_docker_tags(
|
||||
build_preset, build_platform, sha, build_context, build_context_ref
|
||||
build_preset, build_platforms, sha, build_context, build_context_ref
|
||||
)
|
||||
for tag in expected_tags:
|
||||
assert tag in tags
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"build_preset, build_platform, is_authenticated, sha, build_context, build_context_ref, contains",
|
||||
"build_preset, build_platforms, is_authenticated, sha, build_context, build_context_ref, contains",
|
||||
[
|
||||
(
|
||||
"lean",
|
||||
"linux/amd64",
|
||||
["linux/amd64"],
|
||||
True,
|
||||
SHA,
|
||||
"push",
|
||||
@@ -251,18 +251,28 @@ def test_get_docker_tags(
|
||||
),
|
||||
(
|
||||
"dev",
|
||||
"linux/amd64",
|
||||
["linux/amd64"],
|
||||
False,
|
||||
SHA,
|
||||
"push",
|
||||
"master",
|
||||
["--load", f"-t {REPO}:master-dev "],
|
||||
),
|
||||
# multi-platform
|
||||
(
|
||||
"lean",
|
||||
["linux/arm64", "linux/amd64"],
|
||||
True,
|
||||
SHA,
|
||||
"push",
|
||||
"master",
|
||||
[f"--platform linux/arm64,linux/amd64"],
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_get_docker_command(
|
||||
build_preset,
|
||||
build_platform,
|
||||
build_platforms,
|
||||
is_authenticated,
|
||||
sha,
|
||||
build_context,
|
||||
@@ -271,7 +281,7 @@ def test_get_docker_command(
|
||||
):
|
||||
cmd = docker_utils.get_docker_command(
|
||||
build_preset,
|
||||
build_platform,
|
||||
build_platforms,
|
||||
is_authenticated,
|
||||
sha,
|
||||
build_context,
|
||||
|
||||
Reference in New Issue
Block a user