From 3a8d15af4d030acc9d4564b3eec35ff89ead6cf7 Mon Sep 17 00:00:00 2001 From: Michal Hucko Date: Wed, 4 Sep 2024 15:38:08 +0200 Subject: [PATCH] Fix permission in suggestion-enas (#51) Add permissions to folder for daemon user --- suggestion-enas/rockcraft.yaml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/suggestion-enas/rockcraft.yaml b/suggestion-enas/rockcraft.yaml index 3fdcce2..bcecac3 100644 --- a/suggestion-enas/rockcraft.yaml +++ b/suggestion-enas/rockcraft.yaml @@ -39,21 +39,22 @@ parts: python-requirements: - requirements.txt - # install required contents suggestion-enas: - plugin: dump + plugin: nil source: https://github.com/kubeflow/katib.git source-tag: "v0.17.0" source-depth: 1 source-type: git - organize: - pkg: opt/katib/pkg - cmd/suggestion/nas/enas/v1beta1/main.py: opt/katib/cmd/suggestion/nas/enas/v1beta1/main.py - cmd/suggestion/nas/enas/v1beta1/requirements.txt: opt/katib/cmd/suggestion/nas/enas/v1beta1/requirements.txt - stage: - - opt/katib/pkg - - opt/katib/cmd/suggestion/nas/enas/v1beta1/main.py - - opt/katib/cmd/suggestion/nas/enas/v1beta1/requirements.txt + override-build: | + # Move files to dedicated location + mkdir -p ${CRAFT_PART_INSTALL}/opt/katib/pkg + mkdir -p ${CRAFT_PART_INSTALL}/opt/katib/cmd/suggestion/nas/enas/v1beta1 + cp -r pkg/* ${CRAFT_PART_INSTALL}/opt/katib/pkg + cp -r cmd/suggestion/nas/enas/v1beta1/* ${CRAFT_PART_INSTALL}/opt/katib/cmd/suggestion/nas/enas/v1beta1 + + # Change permissions on the folder for the _daemon_ user + chown -R 584792:584792 ${CRAFT_PART_INSTALL}/opt/katib/cmd/suggestion/nas/enas/v1beta1 + chmod -R 755 ${CRAFT_PART_INSTALL}/opt/katib/cmd/suggestion/nas/enas/v1beta1 security-team-requirement: plugin: nil