-
Notifications
You must be signed in to change notification settings - Fork 314
Add the config option DeploymentSettings/DefaultUserHome to change the default user's home directory #6028
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
Merged
dreambeyondorange
merged 1 commit into
aws:develop
from
dreambeyondorange:relocate-home
Feb 12, 2024
Merged
Add the config option DeploymentSettings/DefaultUserHome to change the default user's home directory #6028
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...cluster/templates/test_cluster_stack/test_head_node_dna_json/default-user-local-home.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| Image: | ||
| Os: alinux2 | ||
| HeadNode: | ||
| InstanceType: t2.micro | ||
| Networking: | ||
| SubnetId: subnet-12345678 | ||
| Ssh: | ||
| KeyName: ec2-key-name | ||
| Scheduling: | ||
| Scheduler: slurm | ||
| SlurmQueues: | ||
| - Name: queue1 | ||
| Networking: | ||
| SubnetIds: | ||
| - subnet-12345678 | ||
| ComputeResources: | ||
| - Name: compute_resource1 | ||
| InstanceType: c5.2xlarge | ||
| - Name: compute_resource2 | ||
| InstanceType: c4.2xlarge | ||
| DeploymentSettings: | ||
| DefaultUserHome: Local |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
cli/tests/pcluster/templates/test_login_nodes_stack/test_login_nodes_dna_json/config-1.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 38 additions & 37 deletions
75
cli/tests/pcluster/templates/test_queues_stack/test_compute_nodes_dna_json/dna-1.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,50 +1,51 @@ | ||
| { | ||
| "cluster": { | ||
| "cluster_name": "clustername", | ||
| "stack_name": "clustername", | ||
| "stack_arn": "{\"Ref\": \"AWS::StackId\"}", | ||
| "cluster_s3_bucket": "parallelcluster-a69601b5ee1fc2f2-v1-do-not-delete", | ||
| "base_os": "alinux2", | ||
| "cluster_config_s3_key": "parallelcluster/clusters/dummy-cluster-randomstring123/configs/cluster-config-with-implied-values.yaml", | ||
| "cluster_config_version": "", | ||
| "enable_efa": "NONE", | ||
| "raid_shared_dir": "", | ||
| "raid_type": "", | ||
| "base_os": "alinux2", | ||
| "region": "us-east-1", | ||
| "shared_storage_type": "ebs", | ||
| "efs_fs_ids": "", | ||
| "efs_shared_dirs": "", | ||
| "cluster_name": "clustername", | ||
| "cluster_s3_bucket": "parallelcluster-a69601b5ee1fc2f2-v1-do-not-delete", | ||
| "cluster_user": "ec2-user", | ||
| "custom_awsbatchcli_package": "", | ||
| "custom_node_package": "", | ||
| "cw_logging_enabled": "true", | ||
| "default_user_home": "shared", | ||
| "directory_service": { | ||
| "enabled": "false" | ||
| }, | ||
| "disable_sudo_access_for_default_user": "false", | ||
| "dns_domain": "{\"Ref\": \"referencetoclusternameClusterDNSDomain8D0872E1Ref\"}", | ||
| "ebs_shared_dirs": "", | ||
| "efs_encryption_in_transits": "", | ||
| "efs_fs_ids": "", | ||
| "efs_iam_authorizations": "", | ||
| "fsx_fs_ids": "", | ||
| "fsx_mount_names": "", | ||
| "efs_shared_dirs": "", | ||
| "enable_efa": "NONE", | ||
| "enable_efa_gdr": "NONE", | ||
| "enable_intel_hpc_platform": "false", | ||
| "ephemeral_dir": "/scratch", | ||
| "fsx_dns_names": "", | ||
| "fsx_volume_junction_paths": "", | ||
| "fsx_fs_ids": "", | ||
| "fsx_fs_types": "", | ||
| "fsx_mount_names": "", | ||
| "fsx_shared_dirs": "", | ||
| "scheduler": "slurm", | ||
| "ephemeral_dir": "/scratch", | ||
| "ebs_shared_dirs": "", | ||
| "proxy": "NONE", | ||
| "slurm_ddb_table": "{\"Ref\": \"referencetoclusternameSlurmDynamoDBTable99119DBERef\"}", | ||
| "log_group_name": "/aws/parallelcluster/clustername-202401151530", | ||
| "dns_domain": "{\"Ref\": \"referencetoclusternameClusterDNSDomain8D0872E1Ref\"}", | ||
| "fsx_volume_junction_paths": "", | ||
| "head_node_private_ip": "{\"Ref\": \"referencetoclusternameHeadNodeENI6497A502PrimaryPrivateIpAddress\"}", | ||
| "hosted_zone": "{\"Ref\": \"referencetoclusternameRoute53HostedZone2388733DRef\"}", | ||
| "node_type": "ComputeFleet", | ||
| "cluster_user": "ec2-user", | ||
| "enable_intel_hpc_platform": "false", | ||
| "cw_logging_enabled": "true", | ||
| "log_group_name": "/aws/parallelcluster/clustername-202401151530", | ||
| "log_rotation_enabled": "true", | ||
| "scheduler_queue_name": "queue1", | ||
| "node_type": "ComputeFleet", | ||
| "proxy": "NONE", | ||
| "raid_shared_dir": "", | ||
| "raid_type": "", | ||
| "region": "us-east-1", | ||
| "scheduler": "slurm", | ||
| "scheduler_compute_resource_name": "cr1", | ||
| "enable_efa_gdr": "NONE", | ||
| "custom_node_package": "", | ||
| "custom_awsbatchcli_package": "", | ||
| "use_private_hostname": "false", | ||
| "head_node_private_ip": "{\"Ref\": \"referencetoclusternameHeadNodeENI6497A502PrimaryPrivateIpAddress\"}", | ||
| "directory_service": { | ||
| "enabled": "false" | ||
| }, | ||
| "disable_sudo_access_for_default_user": "false" | ||
| "scheduler_queue_name": "queue1", | ||
| "shared_storage_type": "ebs", | ||
| "slurm_ddb_table": "{\"Ref\": \"referencetoclusternameSlurmDynamoDBTable99119DBERef\"}", | ||
| "stack_arn": "{\"Ref\": \"AWS::StackId\"}", | ||
| "stack_name": "clustername", | ||
| "use_private_hostname": "false" | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"). | ||
| # You may not use this file except in compliance with the License. | ||
| # A copy of the License is located at | ||
| # | ||
| # http://aws.amazon.com/apache2.0/ | ||
| # | ||
| # or in the "LICENSE.txt" file accompanying this file. | ||
| # This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. | ||
| # See the License for the specific language governing permissions and limitations under the License. |
46 changes: 46 additions & 0 deletions
46
tests/integration-tests/tests/users/test_default_user_home.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"). | ||
| # You may not use this file except in compliance with the License. | ||
| # A copy of the License is located at | ||
| # | ||
| # http://aws.amazon.com/apache2.0/ | ||
| # | ||
| # or in the "LICENSE.txt" file accompanying this file. | ||
| # This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. | ||
| # See the License for the specific language governing permissions and limitations under the License. | ||
| import logging | ||
|
|
||
| import pytest | ||
| from assertpy import assert_that | ||
| from remote_command_executor import RemoteCommandExecutor | ||
|
|
||
| # flake8: noqa | ||
|
|
||
|
|
||
| @pytest.mark.usefixtures("os", "scheduler", "instance") | ||
| def test_default_user_local_home( | ||
dreambeyondorange marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| region, | ||
| scheduler, | ||
| pcluster_config_reader, | ||
| vpc_stack, | ||
| scheduler_commands_factory, | ||
| test_datadir, | ||
| clusters_factory, | ||
| ): | ||
| """Verify the default user's home directory is moved on all instance types when set to local""" | ||
|
|
||
| cluster_config = pcluster_config_reader() | ||
| cluster = clusters_factory(cluster_config) | ||
| remote_command_executor = RemoteCommandExecutor(cluster) | ||
| remote_command_executor_login_node = RemoteCommandExecutor(cluster, use_login_node=True) | ||
|
|
||
| _check_local_home(remote_command_executor) | ||
| _check_local_home(remote_command_executor_login_node) | ||
|
|
||
|
|
||
| def _check_local_home(remote_command_executor): | ||
| """Check if the default user's home directory is mounted on the instance""" | ||
| logging.info("Testing the default user's home is local") | ||
| result = remote_command_executor.run_remote_command("pwd") | ||
| assert_that(result.stdout).matches(r"/local/home*") | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.