Skip to content

Commit

Permalink
[improvement](doris compose) make lock file all users can read and wr…
Browse files Browse the repository at this point in the history
…ite (apache#37878)

Fix other user create cluster fail because no permission to the lock
file.
  • Loading branch information
yujun777 authored Jul 18, 2024
1 parent 497a1c9 commit 16eeff8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docker/runtime/doris-compose/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,8 +622,12 @@ def __init__(self, name, subnet, image, is_cloud, fe_config, be_config,
def new(name, image, is_cloud, fe_config, be_config, ms_config,
recycle_config, be_disks, be_cluster, reg_be, coverage_dir,
cloud_store_config):
os.makedirs(LOCAL_DORIS_PATH, exist_ok=True)
with filelock.FileLock(os.path.join(LOCAL_DORIS_PATH, "lock")):
if not os.path.exists(LOCAL_DORIS_PATH):
os.makedirs(LOCAL_DORIS_PATH, exist_ok=True)
os.chmod(LOCAL_DORIS_PATH, 0o777)
lock_file = os.path.join(LOCAL_DORIS_PATH, "lock")
with filelock.FileLock(lock_file):
os.chmod(lock_file, 0o666)
subnet = gen_subnet_prefix16()
cluster = Cluster(name, subnet, image, is_cloud, fe_config,
be_config, ms_config, recycle_config, be_disks,
Expand Down

0 comments on commit 16eeff8

Please sign in to comment.