You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/sagemaker/sagemaker-templates/README.md
+70-5Lines changed: 70 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,8 +43,10 @@ The template contains an example CI/CD pipeline to deploy the model endpoints to
43
43
44
44
The template is based on basic multi-account template from [AWS Enterprise MLOps Framework](https://github.com/aws-samples/aws-enterprise-mlops-framework/blob/main/mlops-multi-account-cdk/mlops-sm-project-template/README.md#sagemaker-project-stack).
45
45
46
-
#### Third-party Code Repository Integration
47
-
SageMaker templates support third party code repository (GitHub) integration along with default AWS CodeCommit. As part of integration, SageMaker templates will be able to manage (create, delete) repositories. As an example, if `sagemaker-templates-service-catalog` template configured to use GitHub as repository type then it would create code repository directly into GitHub account provided with manifest configuration. Repository will be named after SageMaker project name in AWS account `{sagemaker-project}-deploy`. For example, if SageMaker project name is `aiops-abalone-model` then GitHub repository would be created with name `aiops-abalone-model-deploy`.
46
+
#### Third-party Code Repository Integration
47
+
SageMaker templates support third party code repository (GitHub) integration along with default AWS CodeCommit. As part of integration, SageMaker templates will be able to manage (create, delete) repositories in both **personal GitHub accounts** and **GitHub organizations**. The template automatically detects whether the `repository-owner` parameter refers to an organization or personal account and uses the appropriate GitHub API endpoint.
48
+
49
+
As an example, if `sagemaker-templates-service-catalog` template configured to use GitHub as repository type then it would create code repository directly into the GitHub account or organization specified in manifest configuration. Repository will be named after SageMaker project name in AWS account `{sagemaker-project}-deploy`. For example, if SageMaker project name is `aiops-abalone-model` then GitHub repository would be created with name `aiops-abalone-model-deploy`.
48
50
49
51
50
52
## Prerequesites:
@@ -53,9 +55,19 @@ SageMaker templates support third party code repository (GitHub) integration alo
53
55
> [!IMPORTANT]
54
56
> It is important to note AWS CodeCommit is no longer available to new customers. Existing customers of AWS CodeCommit can continue to use the service as normal.
55
57
### GitHub repository integration
56
-
- Target AWS account should contain AWS Secret Manager secret that contains GitHub personal access token with required permissions to manage repository. Refer guide [Creating a fine-grained personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) in order to create access token.
58
+
- Target AWS account should contain AWS Secret Manager secret that contains GitHub personal access token with required permissions to manage repositories. Refer guide [Creating a fine-grained personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token) in order to create access token.
59
+
-**For personal accounts**: Token requires `repo` scope to create private repositories
60
+
-**For organizations**: Token requires `repo` scope AND the user must be a member of the organization with permissions to create repositories. For organization SSO, ensure the token is authorized for SSO access.
57
61
- Template also requires AWS CodeConnection created for GitHub provider in order to integrated GitHub repositories AWS CodeBuild and AWS CodePipeline. Refer guide [Create a connection to GitHub](https://docs.aws.amazon.com/dtconsole/latest/userguide/connections-create-github.html) in order to create connection with GitHub.
58
62
63
+
> [!IMPORTANT]
64
+
> **For GitHub Organizations**: AWS CodeConnections have a **1:1 mapping** with GitHub organizations. Each organization requires:
65
+
> - A separate GitHub App installation in that organization (must be installed by an organization owner)
66
+
> - A dedicated CodeConnection ARN for that organization
67
+
> - The `repository-owner` parameter must match the organization where the GitHub App is installed
68
+
>
69
+
> **Common Issue**: If your CodeConnection was created for a personal account (e.g., `username`) but you specify an organization name (e.g., `MyOrg`) in the `repository-owner` parameter, deployments will fail with "Repository not found" errors. Ensure the GitHub App is installed in the correct organization. See [How connections work with organizations](https://docs.aws.amazon.com/dtconsole/latest/userguide/welcome-connections-how-it-works-github-organizations.html) for details.
70
+
59
71
## Inputs and outputs:
60
72
61
73
### Required inputs:
@@ -65,7 +77,7 @@ SageMaker templates support third party code repository (GitHub) integration alo
65
77
66
78
### Common Optional Inputs:
67
79
-`repository-type` - type of repository to be integrated with SageMaker template source code. Options: `CodeCommit` (default), `GitHub`, `GitHub Enterprise`
68
-
-`repository-owner` - owner or organisation of project code repository (required for GitHub)
80
+
-`repository-owner` - GitHub username (for personal accounts) or organization name (for organizations) where repositories will be created (required for GitHub)
69
81
-`access-token-secret-name` - AWS Secret Manager secret name where access token is stored (default: `github_token`)
70
82
-`aws-codeconnection-arn` - AWS CodeConnection ARN for repository provider
71
83
-`sagemaker-domain-id` - SageMaker domain id
@@ -184,4 +196,57 @@ parameters:
184
196
```
185
197
### Sample manifest example for source repository options
Copy file name to clipboardExpand all lines: modules/sagemaker/sagemaker-templates/templates/finetune_llm_evaluation/pipeline_constructs/build_pipeline_construct.py
Copy file name to clipboardExpand all lines: modules/sagemaker/sagemaker-templates/templates/finetune_llm_evaluation/seed_code/build_app/source_scripts/evaluate.py
Copy file name to clipboardExpand all lines: modules/sagemaker/sagemaker-templates/templates/finetune_llm_evaluation/seed_code/build_app/source_scripts/train.py
Copy file name to clipboardExpand all lines: modules/sagemaker/sagemaker-templates/templates/xgboost_abalone/pipeline_constructs/build_pipeline_construct.py
0 commit comments