Skip to content

Commit

Permalink
using shutil to copy and pathlib to chmod fix #132
Browse files Browse the repository at this point in the history
  • Loading branch information
vinicvaz committed Oct 30, 2023
1 parent f1ce82f commit 7239617
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/domino/cli/utils/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from cryptography.hazmat.backends import default_backend as crypto_default_backend
from tempfile import NamedTemporaryFile, TemporaryDirectory
from kubernetes import client, config
import shutil

from domino.cli.utils.constants import COLOR_PALETTE, DOMINO_HELM_PATH, DOMINO_HELM_VERSION, DOMINO_HELM_REPOSITORY

Expand Down Expand Up @@ -660,21 +661,23 @@ def run_platform_compose(detached: bool = False, use_config_file: bool = False,
local_path = Path(".").resolve()
domino_dir = local_path / "domino_data"
domino_dir.mkdir(parents=True, exist_ok=True)
subprocess.run(["chmod", "-R", "777", "domino_data"])
domino_dir.chmod(0o777)
airflow_base = local_path / 'airflow'
airflow_logs_dir = local_path / "airflow/logs"
airflow_logs_dir.mkdir(parents=True, exist_ok=True)
airflow_dags_dir = local_path / "airflow/dags"
airflow_dags_dir.mkdir(parents=True, exist_ok=True)
airflow_plugins_dir = local_path / "airflow/plugins"
airflow_plugins_dir.mkdir(parents=True, exist_ok=True)
subprocess.run(["chmod", "-R", "777", "airflow"])
airflow_base.chmod(0o777)

# Copy docker-compose.yaml file from package to local path
if create_database:
docker_compose_path = Path(__file__).resolve().parent / "docker-compose.yaml"
else:
docker_compose_path = Path(__file__).resolve().parent / "docker-compose-without-database.yaml"
subprocess.run(["cp", str(docker_compose_path), "./docker-compose.yaml"])

shutil.copy(str(docker_compose_path), "./docker-compose.yaml")
# Run docker-compose up
cmd = [
"docker",
Expand Down

0 comments on commit 7239617

Please sign in to comment.