Create reusable code assets for model training tasks.
Prerequisites
-
Alibaba Cloud account: Full access to all operations without additional authorization.
-
RAM user: Must be added as a workspace member with an assigned role. For more information about permissions for each role, see Appendix: List of roles and permissions.
Create a code configuration
-
Navigate to Code Configuration page.
-
Log on to PAI console.
-
In the left navigation pane, click Workspace List. On the Workspace List page, click the workspace name.
-
In the left navigation pane of workspace page, choose .
-
-
On Code Configuration page, click Create Code Configuration.
-
On Create Code Configuration page, configure parameters.
Parameter
Description
Name
Code configuration name.
Description
Code configuration description. Helps distinguish between configurations.
Visibility
Code configuration visibility. Valid values:
-
Private: Visible only to you and administrators in this workspace.
-
Public: Visible to everyone in this workspace.
Git Address
Code repository address.
Code Branch
Code branch. Default is master.
Code Commit
Commit has higher priority than branch. If specified, branch setting is ignored.
Git Username
Required to access a private code repository.
Code Source Access Token
Required to access a private code repository. For information about obtaining a GitHub token, see Appendix: Obtain a GitHub token.
Local Storage Path
Path to which code is mounted. Default is /root/code/.
-
-
Click Submit.
Operations
After creating a code configuration, you can delete it or modify its visibility.
Appendix: Obtain a GitHub token
-
Log on to your GitHub account.
-
Go to GitHub Developer settings.
-
On Personal access tokens page, click Generate new token in the upper-right corner.
-
In text box under Note, enter a token name. In Select scopes section, select required permission checkboxes. To grant full access, select all permissions.

-
Click Generate Token.
Generated token is shown below.
