mirror of
https://github.com/apache/superset.git
synced 2026-07-26 16:42:32 +00:00
Compare commits
1 Commits
fix-year-p
...
fix/docker
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6b828a6f66 |
@@ -28,8 +28,10 @@ x-superset-image: &superset-image apachesuperset.docker.scarf.sh/apache/superset
|
|||||||
x-superset-volumes:
|
x-superset-volumes:
|
||||||
&superset-volumes # /app/pythonpath_docker will be appended to the PYTHONPATH in the final container
|
&superset-volumes # /app/pythonpath_docker will be appended to the PYTHONPATH in the final container
|
||||||
- ./docker:/app/docker
|
- ./docker:/app/docker
|
||||||
- ./superset-core:/app/superset-core
|
|
||||||
- superset_home:/app/superset_home
|
- superset_home:/app/superset_home
|
||||||
|
x-superset-environment: &superset-environment
|
||||||
|
# Tagged images must use their bundled packages rather than host bind mounts.
|
||||||
|
DEV_MODE: "false"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
redis:
|
redis:
|
||||||
@@ -58,6 +60,7 @@ services:
|
|||||||
required: true
|
required: true
|
||||||
- path: docker/.env-local # optional override
|
- path: docker/.env-local # optional override
|
||||||
required: false
|
required: false
|
||||||
|
environment: *superset-environment
|
||||||
image: *superset-image
|
image: *superset-image
|
||||||
container_name: superset_app
|
container_name: superset_app
|
||||||
command: ["/app/docker/docker-bootstrap.sh", "app-gunicorn"]
|
command: ["/app/docker/docker-bootstrap.sh", "app-gunicorn"]
|
||||||
@@ -79,6 +82,7 @@ services:
|
|||||||
required: true
|
required: true
|
||||||
- path: docker/.env-local # optional override
|
- path: docker/.env-local # optional override
|
||||||
required: false
|
required: false
|
||||||
|
environment: *superset-environment
|
||||||
depends_on:
|
depends_on:
|
||||||
db:
|
db:
|
||||||
condition: service_started
|
condition: service_started
|
||||||
@@ -98,6 +102,7 @@ services:
|
|||||||
required: true
|
required: true
|
||||||
- path: docker/.env-local # optional override
|
- path: docker/.env-local # optional override
|
||||||
required: false
|
required: false
|
||||||
|
environment: *superset-environment
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
depends_on:
|
depends_on:
|
||||||
superset-init:
|
superset-init:
|
||||||
@@ -120,6 +125,7 @@ services:
|
|||||||
required: true
|
required: true
|
||||||
- path: docker/.env-local # optional override
|
- path: docker/.env-local # optional override
|
||||||
required: false
|
required: false
|
||||||
|
environment: *superset-environment
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
depends_on:
|
depends_on:
|
||||||
superset-init:
|
superset-init:
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ RETRYABLE_STATUS_CODES: frozenset[int] = frozenset({403, 429})
|
|||||||
PATTERNS = {
|
PATTERNS = {
|
||||||
"python": [
|
"python": [
|
||||||
r"^\.github/workflows/.*python",
|
r"^\.github/workflows/.*python",
|
||||||
|
r"^docker-compose-image-tag\.yml$",
|
||||||
r"^tests/",
|
r"^tests/",
|
||||||
r"^superset/",
|
r"^superset/",
|
||||||
r"^scripts/",
|
r"^scripts/",
|
||||||
|
|||||||
46
tests/unit_tests/docker_compose_image_tag_test.py
Normal file
46
tests/unit_tests/docker_compose_image_tag_test.py
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
# Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
# or more contributor license agreements. See the NOTICE file
|
||||||
|
# distributed with this work for additional information
|
||||||
|
# regarding copyright ownership. The ASF licenses this file
|
||||||
|
# to you under the Apache License, Version 2.0 (the
|
||||||
|
# "License"); you may not use this file except in compliance
|
||||||
|
# with the License. You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing,
|
||||||
|
# software distributed under the License is distributed on an
|
||||||
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
# KIND, either express or implied. See the License for the
|
||||||
|
# specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import yaml
|
||||||
|
|
||||||
|
|
||||||
|
def test_image_tag_services_use_bundled_packages() -> None:
|
||||||
|
repository_root = Path(__file__).resolve().parents[2]
|
||||||
|
compose = yaml.safe_load(
|
||||||
|
(repository_root / "docker-compose-image-tag.yml").read_text(),
|
||||||
|
)
|
||||||
|
image = compose["x-superset-image"]
|
||||||
|
image_services = [
|
||||||
|
service
|
||||||
|
for service in compose["services"].values()
|
||||||
|
if service.get("image") == image
|
||||||
|
]
|
||||||
|
|
||||||
|
assert image_services
|
||||||
|
assert all(
|
||||||
|
service.get("environment", {}).get("DEV_MODE") == "false"
|
||||||
|
for service in image_services
|
||||||
|
)
|
||||||
|
assert all(
|
||||||
|
all(
|
||||||
|
not isinstance(volume, str) or ":/app/superset-core" not in volume
|
||||||
|
for volume in service.get("volumes", [])
|
||||||
|
)
|
||||||
|
for service in image_services
|
||||||
|
)
|
||||||
@@ -94,3 +94,10 @@ def test_fetch_gives_up_after_max_retries() -> None:
|
|||||||
change_detector.fetch_files_github_api("http://api")
|
change_detector.fetch_files_github_api("http://api")
|
||||||
|
|
||||||
assert urlopen_mock.call_count == change_detector.MAX_RETRIES
|
assert urlopen_mock.call_count == change_detector.MAX_RETRIES
|
||||||
|
|
||||||
|
|
||||||
|
def test_image_tag_compose_changes_trigger_python_tests() -> None:
|
||||||
|
assert change_detector.detect_changes(
|
||||||
|
["docker-compose-image-tag.yml"],
|
||||||
|
change_detector.PATTERNS["python"],
|
||||||
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user