Skip to content

#4292: Home storages creator job#4342

Open
kamyshova wants to merge 5 commits intodevelopfrom
issue_4292_home_storages
Open

#4292: Home storages creator job#4342
kamyshova wants to merge 5 commits intodevelopfrom
issue_4292_home_storages

Conversation

@kamyshova
Copy link
Copy Markdown
Contributor

This PR related to #4292

@kamyshova kamyshova force-pushed the issue_4292_home_storages branch from 741f79f to fd38459 Compare March 23, 2026 15:57
Signed-off-by: Yulia Kamyshova <yulia_kamyshova@epam.com>
Signed-off-by: Yulia Kamyshova <yulia_kamyshova@epam.com>
Signed-off-by: Yulia Kamyshova <yulia_kamyshova@epam.com>
@kamyshova kamyshova force-pushed the issue_4292_home_storages branch from fd38459 to ce3463e Compare March 24, 2026 16:12
@@ -0,0 +1,46 @@
apiVersion: batch/v1beta1
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's rename this file to cp-home-creator-job.yaml

image: ${CP_DOCKER_DIST_SRV}lifescience/cloud-pipeline:home-dirs-$CP_VERSION
imagePullPolicy: IfNotPresent
securityContext:
privileged: true
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we don't really need this, right?

echo "-> User $user_name verified: $user_id"

echo "-> Checking ssh key for user $user_name"
if ! ensure_user_ssh_keys "$user_id" "$user_name" "$user_name_full"; then
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for this action I would also added additional parameter to be able to enable/disable it, the same as quotas

ssh_pub=$(echo "$response" | jq -r '.payload[].data.ssh_pub.value // 0')

if [ -z "$ssh_priv" ] || [ "$ssh_priv" = "0" ]; then
echo "User $user_name does not have a private ssh key, generating"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably additional message needed if user already has it

return 1
fi

if [[ "${CP_HOME_DIRS_FS_HOME_STORAGE_ENABLE}" == "true" ]] && verify_optional_parameter "CP_HOME_DIRS_ID_FILE_SHARE" && verify_optional_parameter "CP_HOME_DIRS_ADDR_FILE_SHARE"; then
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we split these checks like:

 if [[ "${CP_HOME_DIRS_FS_HOME_STORAGE_ENABLE}" == "true" ]] ; then
    if verify_optional_parameter "CP_HOME_DIRS_ID_FILE_SHARE" && verify_optional_parameter "CP_HOME_DIRS_ADDR_FILE_SHARE"; then
       echo "<some error message>"
       return 1
    fi
    .....
 fi

it will be more readable

Signed-off-by: Yulia Kamyshova <yulia_kamyshova@epam.com>
fi

if [[ "${CP_HOME_DIRS_FS_HOME_STORAGE_ENABLE}" == "true" ]]; then
if verify_optional_parameter "CP_HOME_DIRS_ID_FILE_SHARE" && verify_optional_parameter "CP_HOME_DIRS_ADDR_FILE_SHARE"; then
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually since we already perform pre-flight check in https://github.com/epam/cloud-pipeline/pull/4342/changes#diff-869eb826d01074ecddde60ab60b1ac6c2663c7e844435751d642ffad26fdc72aR419, I think we don't need it here


if [[ "${CP_HOME_DIRS_FS_HOME_STORAGE_ENABLE}" == "true" ]]; then
if ! verify_optional_parameter "CP_HOME_DIRS_ID_FILE_SHARE" || ! verify_optional_parameter "CP_HOME_DIRS_ADDR_FILE_SHARE"; then
echo "[ERROR] CP_HOME_DIRS_FS_HOME_STORAGE_ENABLE is true but CP_HOME_DIRS_ID_FILE_SHARE and/or CP_HOME_DIRS_ADDR_FILE_SHARE are not set. FS home storage will be skipped. Exiting..."
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error message a little bit strange, we are saying FS home storage will be skipped but then exit abnormally from the script

Signed-off-by: Yulia Kamyshova <yulia_kamyshova@epam.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants