Skip to content

Commit 5d8b612

Browse files
author
stevestein
committed
Merge branch 'release-carbon' of https://github.com/MicrosoftDocs/sql-docs-pr into SqlCarbon
2 parents 27d20f1 + 6da697a commit 5d8b612

53 files changed

Lines changed: 1344 additions & 1121 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/advanced-analytics/TOC.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,11 @@
153153
### [Advanced configuration options for Machine Learning Services](r/configure-and-manage-advanced-analytics-extensions.md)
154154
### [Security considerations for the R runtime in SQL Server](r/security-considerations-for-the-r-runtime-in-sql-server.md)
155155
### [Modify the user account pool for SQL Server Machine Learning Services](r/modify-the-user-account-pool-for-sql-server-r-services.md)
156-
### [Configure and manage machine learning extensions](r/configure-and-manage-advanced-analytics-extensions.md)
157156

158157
### [Deploy and consume models using web services](operationalization-with-mrsdeploy.md)
159158
### [Managing and monitoring machine learning solutions](r/managing-and-monitoring-r-solutions.md)
160159
### [Resource governance for Machine Learning Services](r/resource-governance-for-r-services.md)
161-
### [Create a resource pool for R](r/how-to-create-a-resource-pool-for-r.md)
160+
### [Create a resource pool for machine learning](r/how-to-create-a-resource-pool-for-r.md)
162161
### [Extended events for Machine Learning Services](r/extended-events-for-sql-server-r-services.md)
163162

164163
### [DMVs for Machine Learning Services](r/dmvs-for-sql-server-r-services.md)
@@ -180,7 +179,7 @@
180179
### [Add R to an existing Azure virtual machine](r/installing-sql-server-r-services-on-an-azure-virtual-machine.md)
181180
### [Use sqlBindR.exe to upgrade an instance](r/use-sqlbindr-exe-to-upgrade-an-instance-of-sql-server.md)
182181
### [Install R Server from the command line](r/install-microsoft-r-server-from-the-command-line.md)
183-
### [Provision the Data Science Virtual Machine](r/provision-the-r-server-only-sql-server-2016-enterprise-vm-on-azure.md)
182+
### [Provision an enterprise data science virtual machine](r/provision-the-r-server-only-sql-server-2016-enterprise-vm-on-azure.md)
184183
### [Set up data science tools](r/setup-or-configure-r-tools.md)
185184
### [Set Up a data science client](r/set-up-a-data-science-client.md)
186185

70.5 KB
Loading
63.1 KB
Loading

docs/advanced-analytics/python/setup-python-machine-learning-services.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Setup and configuration for Python Machine Learning Services | Microsoft Docs"
33
ms.custom: ""
44
ms.date: "07/31/2017"
5-
ms.prod: "sql-server-2016"
5+
ms.prod: "sql-server-2017"
66
ms.reviewer: ""
77
ms.suite: ""
88
ms.technology:
@@ -11,7 +11,7 @@ ms.tgt_pltfrm: ""
1111
ms.topic: "article"
1212
author: "jeannt"
1313
ms.author: "jeannt"
14-
manager: "jhubbard"
14+
manager: "cgronlund"
1515
ms.workload: "On Demand"
1616
---
1717
# Set up Python Machine Learning Services (In-Database)
@@ -44,13 +44,15 @@ After the installation is complete, reconfigure the instance to allow execution
4444
4545
### Unattended installation
4646

47-
To perform an unattended installation, use the command-line options for SQL Server setup and the arguments specific to Python. For more information, see [Unattended installs of SQL Server with Python Machine Learning Services](./unattended-installs-of-sql-server-python-services.md).
47+
To perform an unattended installation, use the command-line options for SQL Server setup and the arguments specific to Python. For more information, see [Unattended installs of SQL Server with Python Machine Learning Services](unattended-installs-of-sql-server-python-services.md).
4848

4949
## <a name="bkmk_installPythonInDatabase"></a> Step 1: Install Machine Learning Services (In-Database) on SQL Server
5050

5151
1. Run the setup wizard for SQL Server 2017.
5252

5353
2. On the **Installation** tab, select **New SQL Server stand-alone installation or add features to an existing installation**.
54+
55+
![Install Python in-database](media/2017setup-installation-page-mlsvcs.PNG)
5456

5557
3. On the **Feature Selection** page, select these options:
5658

@@ -64,11 +66,12 @@ To perform an unattended installation, use the command-line options for SQL Serv
6466

6567
- **Python**
6668
Check this option to get the Python 3.5 executable and select libraries from the Anaconda distribution. Install only one language per instance.
69+
70+
![Feature options for Python](media/ml-svcs-features-python-highlight.png "Setup options for Python")
6771

6872
> [!NOTE]
69-
> Do not select the option in **Shared Features** for **Microsoft R Server (Standalone)**. Use this option in a separate installation if you need to add the machine learning components to a different computer that is used for R development. For example, this might be useful for your data scientist's laptop.
70-
71-
![Setup options for Python](media/ml-svcs-features-python-highlight.png "Setup options for Python")
73+
>
74+
> Do not select the option for **Machine Learning Server (Standalone)**. The option to install Machine Learning Server under **Shared Features** is intended for use on a separate computer. For example, you might want to install the same version of the machine learning components on a different computer that is used for project development, such as your data scientist's laptop.
7275
7376
4. On the **Consent to Install Python** page, select **Accept**.
7477

@@ -87,7 +90,7 @@ To perform an unattended installation, use the command-line options for SQL Serv
8790
+ Machine Learning Services (In-Database)
8891
+ Python
8992

90-
These selections represent the minimum configuration required to use Python with SQL Server.
93+
These selections represent the minimum configuration required to use Python with [!INCLUDE[ssnoversion](../../includes/ssnoversion.md)].
9194

9295
![Ready to install Python](media/ready-to-install-python.png "Required components for Python install")
9396

@@ -113,7 +116,8 @@ To perform an unattended installation, use the command-line options for SQL Serv
113116
EXEC sp_configure 'external scripts enabled', 1
114117
RECONFIGURE WITH OVERRIDE
115118
```
116-
This is exactly the same process that is used to enable R, because the underlying extensibility feature supports both languages.
119+
120+
If you have already enabled the feature for the R language, you don't need to run reconfigure a second time for Python. The underlying extensibility platform supports both languages.
117121
118122
4. Restart the SQL Server service for the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] instance. Restarting the SQL Server service also automatically restarts the related [!INCLUDE[rsql_launchpad](../../includes/rsql-launchpad-md.md)] service.
119123
@@ -135,13 +139,13 @@ Take a moment to verify that all components used to launch the Python script are
135139
136140
If you have installed multiple instances of SQL Server, any instance that has either R or Python enabled has its own Launchpad service.
137141
138-
However, if you install R and Python on a single instance, only one Launchpad is installed. A separate, language-specific launcher DLL is added for each language. For more information, see [Components to support Python integration](new-components-in-sql-server-to-support-python-integration.md).
142+
If you install both R and Python on a single instance, only one Launchpad is installed. A separate, language-specific launcher DLL is added for each language. For more information, see [Components to support Python integration](new-components-in-sql-server-to-support-python-integration.md).
139143
140144
3. If Launchpad is running, you should be able to run simple Python scripts like the following in [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)]:
141145
142146
```SQL
143147
EXEC sp_execute_external_script @language =N'Python',
144-
@script=N'OutputDataSet=InputDataSet',
148+
@script=N'OutputDataSet = InputDataSet',
145149
@input_data_1 = N'SELECT 1 AS col'
146150
```
147151
@@ -152,6 +156,7 @@ Take a moment to verify that all components used to launch the Python script are
152156
153157
> [!NOTE]
154158
> Columns or headings used in the Python script are not returned, by design. To add column names for your output, you must specify the schema for the return data set. Do this by using the WITH RESULTS parameter of the stored procedure, naming the columns and specifying the SQL data type.
159+
>
155160
> For example, you can add the following line to generate an arbitrary column name: `WITH RESULT SETS ((Col1 AS int))`
156161
157162
## Step 4: Additional configuration
@@ -173,26 +178,26 @@ This is called *implied authentication*, and is a service of the database engine
173178
You can view these accounts in the Windows user group, **SQLRUserGroup**. By default, 20 worker accounts are created, which is usually more than enough for running external script jobs.
174179
175180
> [!IMPORTANT]
176-
> The worker group is named SQLRUserGroup regardless of the type of script you are running. There is a single group for each instance.
181+
> The worker group is named **SQLRUserGroup** regardless of whether you installed R or Python. There is a single group for each instance.
177182
178-
If you need to run R scripts from a remote data science client, and you are using Windows authentication, there are additional considerations. These worker accounts must be given permission to sign in to the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] instance on your behalf.
183+
If you need to run scripts from a remote data science client, and you are using Windows authentication, there are additional considerations. These worker accounts must be given permission to sign in to the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] instance on your behalf.
179184
180185
1. In [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)], in Object Explorer, expand **Security**. Then right-click **Logins**, and select **New Login**.
181186
2. In the **Login - New** dialog box, select **Search**.
182187
3. Select **Object Types**, and select **Groups**. Clear everything else.
183188
4. In **Enter the object name to select**, type *SQLRUserGroup*, and select **Check Names**.
184189
5. The name of the local group associated with the instance's Launchpad service should resolve to something like *instancename\SQLRUserGroup*. Select **OK**.
185-
6. By default, the sign-in is assigned to the **public** role, and has permission to connect to the database engine.
190+
6. By default, the group is assigned to the **public** role, and has permission to connect to the database engine.
186191
7. Select **OK**.
187192

188193
> [!NOTE]
189-
> If you use a SQL sign-in for running scripts in a SQL Server compute context, this extra step is not required.
194+
> If you use a **SQL login** for running scripts in a SQL Server compute context, this extra step is not required.
190195

191196
### Give users permission to run external scripts
192197

193198
If you installed [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] yourself, and you are running Python scripts in your own instance, you typically execute scripts as an administrator. Thus, you have implicit permission over various operations and all data in the database.
194199

195-
Most users, however, do not have such elevated permissions. For example, users in an organization who use SQL sign-ins to access the database generally do not have elevated permissions. Therefore, for each user who is using Python, you must grant users of Machine Learning Services the permission to run external scripts in each database where Python is used. Here's how:
200+
Most users, however, do not have such elevated permissions. For example, users in an organization who use SQL logins to access the database generally do not have elevated permissions. Therefore, for each user who is using Python, you must grant users of Machine Learning Services the permission to run external scripts in each database where Python is used. Here's how:
196201
197202
```SQL
198203
USE <database_name>
@@ -205,12 +210,12 @@ GRANT EXECUTE ANY EXTERNAL SCRIPT TO [UserName]
205210
206211
### Give your users read, write, or data definition language (DDL) permissions to databases
207212
208-
While a user is running scripts, the user account or SQL sign-in might need to read data from other databases. The user account or SQL sign-in might also need to create new tables to store results, and write data into tables.
213+
While a user is running scripts, the user might need to read data from other databases. The user might also need to create new tables to store results, and write data into tables.
209214
210-
For each user account or SQL sign-in that is running R or Python scripts, ensure that it has `db_datareader`, `db_datawriter`, or `db_ddladmin` permissions on the specific database.
215+
For each Windows user account or SQL login that is running R or Python scripts, ensure that it has the appropriate permissions on the specific database: `db_datareader`, `db_datawriter`, or `db_ddladmin`.
216+
217+
For example, the following [!INCLUDE[tsql](../../includes/tsql-md.md)] statement gives the SQL login *MySQLLogin* the rights to run T-SQL queries in the *ML_Samples* database. To run this statement, the SQL login must already exist in the security context of the server.
211218
212-
For example, the following [!INCLUDE[tsql](../../includes/tsql-md.md)] statement gives the SQL sign-in *MySQLLogin* the rights to run T-SQL queries in the *ML_Samples* database. To run this statement, the SQL sign-in must already exist in the security context of the server.
213-
214219
```SQL
215220
USE ML_Samples
216221
GO
@@ -225,20 +230,19 @@ If you cannot connect from a remote computer, check whether the firewall allows
225230
226231
### Create an ODBC data source for the instance on your data science client
227232
228-
You might create a machine learning solution on a data science client computer. If you need to run code by using the SQL Server computer as the compute context, you have two options. You can use a SQL sign-in or an integrated Windows authentication.
233+
You might create a machine learning solution on a data science client computer. If you need to run code by using the SQL Server computer as the compute context, you have two options: access the instance by using a SQL login, or by using a Windows account.
229234
230-
+ For SQL sign-ins: Ensure that the sign-in has appropriate permissions on the database where you are reading data. You can do this by adding *Connect to* and *SELECT* permissions, or by adding the sign-in to the `db_datareader` role. Sign-ins that create objects need `DDL_admin` rights. Sign-ins that must save data to tables should be added to the `db_datawriter` role.
235+
+ For SQL logins: Ensure that the login has appropriate permissions on the database where you are reading data. You can do this by adding *Connect to* and *SELECT* permissions, or by adding the login to the `db_datareader` role. To create objects, assign `DDL_admin` rights. If you must save data to tables, add to the `db_datawriter` role.
231236
232237
+ For Windows authentication: You might need to create an ODBC data source on the data science client that specifies the instance name and other connection information. For more information, see [ODBC data source administrator](https://docs.microsoft.com/sql/odbc/admin/odbc-data-source-administrator).
233238
234-
235239
## Additional optimizations
236240
237241
Now that you have everything working, you might also want to optimize the server to support machine learning, or install pretrained models.
238242
239243
### Add more worker accounts
240244
241-
If you expect many users to be running scripts concurrently, you can increase the number of worker accounts that are assigned to the Launchpad service. For more information, see [Modify the user account pool for SQL Server R Services](../r/modify-the-user-account-pool-for-sql-server-r-services.md).
245+
If you expect many users to be running scripts concurrently, you can increase the number of worker accounts that are assigned to the Launchpad service. For more information, see [Modify the user account pool for SQL Server Machine Learning Services](../r/modify-the-user-account-pool-for-sql-server-r-services.md).
242246
243247
### Optimize the server for script execution
244248
@@ -276,10 +280,6 @@ You can upgrade the machine learning components on a faster schedule than is sup
276280
277281
For information about how to upgrade an instance, see [Upgrade R components through binding](..\r\use-sqlbindr-exe-to-upgrade-an-instance-of-sql-server.md).
278282
279-
> [!NOTE]
280-
>
281-
> The current release version contains the latest version of all machine learning components. Therefore, although upgrades via Microsoft Machine Learning Server are supported for SQL Server 2017, the upgrade that is currently available applies only to SQL Server 2016 instances.
282-
283283
### Tutorials
284284
285285
See the following tutorials for some examples of how you can use Python with SQL Server to build and deploy machine learning solutions:

0 commit comments

Comments
 (0)