Skip to content

feat(workflows-local-runner-unifiedstorage): update start container script to reslove symlink and use its target for mount #709

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ x-airflow-common: &airflow-common
- /home/sagemaker-user/.workflows_setup/plugins:/usr/local/airflow/plugins
- /home/sagemaker-user/.workflows_setup/requirements:/usr/local/airflow/requirements
- /home/sagemaker-user/.workflows_setup/startup:/usr/local/airflow/startup
- /home/sagemaker-user/src:/home/sagemaker-user/src:rw
- ${MOUNT_DIR}:/home/sagemaker-user/src:rw
- /home/sagemaker-user/jobs:/home/sagemaker-user/jobs:rw
depends_on: &airflow-common-depends-on
postgres:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ is_s3_storage=${1:-"1"} # Default to 1 (Git storage) if no parameter is passed
if [ "$is_s3_storage" -eq 0 ]; then
PROJECT_DIR="$HOME/shared"
echo "Project is using S3 storage, project directory set to: $PROJECT_DIR"
MOUNT_DIR=$(readlink -f $PROJECT_DIR) # get the symlink source
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we not have unit tests for this file ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we have unit tests for this file here: https://github.com/aws/sagemaker-distribution/blob/main/test/test_artifacts/v2/scripts/run_sagemaker_workflows_tests.sh
basically checks if healthchecker + airflow APIs are running (containers are up successfully) so should cover the e2e experience

Copy link
Contributor

@nandab-work nandab-work Jun 19, 2025

Choose a reason for hiding this comment

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

Is it possible to check if the symlink source was used for mounting the local runner in the unit test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

do you mean to check the /mnt/custom-file-system/s3/shared is the actual path used for mount in local runner?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, basically ensuring that we are mounting the symlink source of "$HOME/shared"

echo "resolved symlink target is: $MOUNT_DIR"
else
PROJECT_DIR="$HOME/src"
echo "Project is using Git storage, project directory set to: $PROJECT_DIR"
Expand Down Expand Up @@ -186,6 +188,7 @@ cp -n "/etc/sagemaker-ui/workflows/sample_dag.py" "${WORKFLOW_DAG_PATH}/"
aws ecr get-login-password --region ${AWS_REGION} | docker login --username AWS --password-stdin ${ECR_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com

PROJECT_DIR=$(basename $PROJECT_DIR) \
MOUNT_DIR=$MOUNT_DIR \
ECR_ACCOUNT_ID=$ECR_ACCOUNT_ID \
ACCOUNT_ID=$AWS_ACCOUNT_ID \
DZ_DOMAIN_ID=$DZ_DOMAIN_ID \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ x-airflow-common: &airflow-common
- /home/sagemaker-user/.workflows_setup/plugins:/usr/local/airflow/plugins
- /home/sagemaker-user/.workflows_setup/requirements:/usr/local/airflow/requirements
- /home/sagemaker-user/.workflows_setup/startup:/usr/local/airflow/startup
- /home/sagemaker-user/src:/home/sagemaker-user/src:rw
- ${MOUNT_DIR}:/home/sagemaker-user/src:rw
- /home/sagemaker-user/jobs:/home/sagemaker-user/jobs:rw
depends_on: &airflow-common-depends-on
postgres:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ is_s3_storage=${1:-"1"} # Default to 1 (Git storage) if no parameter is passed
if [ "$is_s3_storage" -eq 0 ]; then
PROJECT_DIR="$HOME/shared"
echo "Project is using S3 storage, project directory set to: $PROJECT_DIR"
MOUNT_DIR=$(readlink -f $PROJECT_DIR) # get the symlink source
echo "resolved symlink target is: $MOUNT_DIR"
else
PROJECT_DIR="$HOME/src"
echo "Project is using Git storage, project directory set to: $PROJECT_DIR"
Expand Down Expand Up @@ -186,6 +188,7 @@ cp -n "/etc/sagemaker-ui/workflows/sample_dag.py" "${WORKFLOW_DAG_PATH}/"
aws ecr get-login-password --region ${AWS_REGION} | docker login --username AWS --password-stdin ${ECR_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com

PROJECT_DIR=$(basename $PROJECT_DIR) \
MOUNT_DIR=$MOUNT_DIR \
ECR_ACCOUNT_ID=$ECR_ACCOUNT_ID \
ACCOUNT_ID=$AWS_ACCOUNT_ID \
DZ_DOMAIN_ID=$DZ_DOMAIN_ID \
Expand Down