Files
doc-exports/docs/dataartsstudio/umn/dataartsstudio_01_0529.html
chenxiaoxiong f9e2808b7c DataArts UMN 20250810 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: chenxiaoxiong <chenxiaoxiong@huawei.com>
Co-committed-by: chenxiaoxiong <chenxiaoxiong@huawei.com>
2025-09-02 10:44:13 +00:00

193 lines
32 KiB
HTML

<a name="dataartsstudio_01_0529"></a><a name="dataartsstudio_01_0529"></a>
<h1 class="topictitle1">Developing a Python Job</h1>
<div id="body0000001259971383"><p id="dataartsstudio_01_0529__p159561020193320">This section describes how to develop and execute a Python job using <span id="dataartsstudio_01_0529__en-us_topic_0127305016_text1666316172612">DataArts Factory</span>.</p>
<div class="section" id="dataartsstudio_01_0529__section915954011350"><h4 class="sectiontitle">Preparing the Environment</h4><ul id="dataartsstudio_01_0529__ul55251991433"><li id="dataartsstudio_01_0529__li6183612122320"><a name="dataartsstudio_01_0529__li6183612122320"></a><a name="li6183612122320"></a>An ECS named <strong id="dataartsstudio_01_0529__b59220518403">ecs-dgc</strong> has been created.<div class="note" id="dataartsstudio_01_0529__note7146161718417"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="dataartsstudio_01_0529__p714611171411">In this example, the ECS uses the <span class="parmname" id="dataartsstudio_01_0529__parmname1723516175430"><b>CentOS 8.0 64bit with ARM (40 GB)</b></span> public image and the Python environment. You can log in to the ECS and run the <b><span class="cmdname" id="dataartsstudio_01_0529__cmdname1167973645415">python</span></b> command to check the Python environment.</p>
<p id="dataartsstudio_01_0529__p1525785164915"><span><img id="dataartsstudio_01_0529__image15278144831812" src="en-us_image_0000002234237528.png" title="Click to enlarge" class="imgResize"></span></p>
</div></div>
</li><li id="dataartsstudio_01_0529__li948222884818"><a name="dataartsstudio_01_0529__li948222884818"></a><a name="li948222884818"></a>You have enabled the DataArts Migration incremental package and created a CDM cluster named <strong id="dataartsstudio_01_0529__b1353951515384">cdm-dlfpyhthon</strong>. The cluster provides an agent for the DataArts Factory module to communicate with the ECS.</li><li id="dataartsstudio_01_0529__en-us_topic_0108275477_en-us_topic_0187412481_li1028575215">Ensure that the ECS can communicate with the CDM cluster, which depends on the following conditions:<ul id="dataartsstudio_01_0529__ul75571941135520"><li id="dataartsstudio_01_0529__li86511943161818">If the CDM cluster and the ECS are in the same region, VPC, subnet, and security group, they can communicate with each other by default. If they are in the same VPC but in different subnets or security groups, you must configure routing rules and security group rules. For details about how to configure routing rules, see "Adding Routes to a Route Table" in <em id="dataartsstudio_01_0529__i896912418419">Virtual Private Cloud (VPC) x.x.x User Guide</em> in <em id="dataartsstudio_01_0529__i159701440419">Virtual Private Cloud (VPC) x.x.x Usage Guide</em>. For details about how to configure security group rules, see "Security Group" &gt; "Adding a Security Group Rule" in Virtual Private Cloud (VPC) x.x.x User Guide in Virtual Private Cloud (VPC) x.x.x Usage Guide.</li><li id="dataartsstudio_01_0529__li95573410552">If the CDM cluster and the ECS are in different regions, a public network or a dedicated connection is required for enabling communication between the CDM cluster and the cloud service. If the Internet is used for communication, ensure that an EIP has been bound to the CDM cluster, the host where the data source is located can access the Internet, and the port has been enabled in the firewall rules.</li><li id="dataartsstudio_01_0529__li14557144112558">The ECS and the CDM cluster belong to the same enterprise project. If they do not, you can modify the enterprise project of the workspace.</li></ul>
</li></ul>
</div>
<div class="section" id="dataartsstudio_01_0529__section19031510161"><h4 class="sectiontitle">Constraints</h4><ul id="dataartsstudio_01_0529__ul11696122612619"><li id="dataartsstudio_01_0529__en-us_topic_0000001135993245_li1474153217522">Python nodes support script parameters and job parameters.</li><li id="dataartsstudio_01_0529__li1462711391557">This section uses Python3 as an example.</li></ul>
</div>
<div class="section" id="dataartsstudio_01_0529__section3216144795514"><a name="dataartsstudio_01_0529__section3216144795514"></a><a name="section3216144795514"></a><h4 class="sectiontitle">Creating an ECS Data Connection</h4><p id="dataartsstudio_01_0529__p15993132913566">Before developing a Python script, you need to create a connection to the ECS.</p>
<ol id="dataartsstudio_01_0529__ol1797635711254"><li id="dataartsstudio_01_0529__li2848154165110"><span>Log in to the <span id="dataartsstudio_01_0529__en-us_topic_0000001987511677_en-us_topic_0000001127311125_text5574448155719">DataArts Studio</span> console by following the instructions in <a href="dataartsstudio_01_0001.html">Accessing the DataArts Studio Instance Console</a>.</span></li><li class="msonormal" id="dataartsstudio_01_0529__li11777174316135"><span>On the <span id="dataartsstudio_01_0529__en-us_topic_0000001503129708_text82024413513">DataArts Studio</span> console, locate a workspace and click <strong id="dataartsstudio_01_0529__en-us_topic_0000001503129708_b820215416513">Management Center</strong>.</span></li><li id="dataartsstudio_01_0529__li548395313475"><span>On the displayed <strong id="dataartsstudio_01_0529__b1650312166227">Manage Data Connections</strong> page, click <strong id="dataartsstudio_01_0529__b1250361615225">Create Data Connection</strong>.</span></li><li id="dataartsstudio_01_0529__li1396681610397"><span>Configure parameters by referring to <a href="#dataartsstudio_01_0529__table11356052154616">Table 1</a> and create a data connection named <strong id="dataartsstudio_01_0529__b139681611711">ecs</strong>.</span><p>
<div class="tablenoborder"><a name="dataartsstudio_01_0529__table11356052154616"></a><a name="table11356052154616"></a><table cellpadding="4" cellspacing="0" summary="" id="dataartsstudio_01_0529__table11356052154616" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Host Connection parameters</caption><thead align="left"><tr id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_row698843916244"><th align="left" class="cellrowborder" valign="top" width="21.81%" id="mcps1.3.4.3.4.2.1.2.4.1.1"><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p2919269016244">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="9.629999999999999%" id="mcps1.3.4.3.4.2.1.2.4.1.2"><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p1579766516244">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="68.56%" id="mcps1.3.4.3.4.2.1.2.4.1.3"><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p454247716244">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dataartsstudio_01_0529__en-us_topic_0000001503446532_row34091053155914"><td class="cellrowborder" valign="top" width="21.81%" headers="mcps1.3.4.3.4.2.1.2.4.1.1 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_p187882052124512">Data Connection Type</p>
</td>
<td class="cellrowborder" valign="top" width="9.629999999999999%" headers="mcps1.3.4.3.4.2.1.2.4.1.2 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_p4788145294511">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="68.56%" headers="mcps1.3.4.3.4.2.1.2.4.1.3 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_p5788165212458"><strong id="dataartsstudio_01_0529__en-us_topic_0000001503446532_b95251729103211">Host Connection</strong> is selected by default and cannot be changed.</p>
</td>
</tr>
<tr id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_row1415194384512"><td class="cellrowborder" valign="top" width="21.81%" headers="mcps1.3.4.3.4.2.1.2.4.1.1 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p12415343124519">Name</p>
</td>
<td class="cellrowborder" valign="top" width="9.629999999999999%" headers="mcps1.3.4.3.4.2.1.2.4.1.2 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p10415184317451">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="68.56%" headers="mcps1.3.4.3.4.2.1.2.4.1.3 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_p10487624232">Name of the data connection to create. Data connection names can contain a maximum of 100 characters. They can contain only letters, digits, underscores (_), and hyphens (-).</p>
</td>
</tr>
<tr id="dataartsstudio_01_0529__en-us_topic_0000001503446532_row8195152412467"><td class="cellrowborder" valign="top" width="21.81%" headers="mcps1.3.4.3.4.2.1.2.4.1.1 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_p1817419281801">Tag</p>
</td>
<td class="cellrowborder" valign="top" width="9.629999999999999%" headers="mcps1.3.4.3.4.2.1.2.4.1.2 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_p185521834204616">No</p>
</td>
<td class="cellrowborder" valign="top" width="68.56%" headers="mcps1.3.4.3.4.2.1.2.4.1.3 "><div class="p" id="dataartsstudio_01_0529__en-us_topic_0000001503446532_p194874211237">Attribute of the data connection to create. Tags make management easier.<div class="note" id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0000001554166437_note97121765158"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0000001554166437_p107124612153">The tag name can contain only letters, digits, and underscores (_) and cannot start with an underscore (_) or contain more than 100 characters.</p>
</div></div>
</div>
</td>
</tr>
<tr id="dataartsstudio_01_0529__en-us_topic_0000001503446532_row13284133013018"><td class="cellrowborder" valign="top" width="21.81%" headers="mcps1.3.4.3.4.2.1.2.4.1.1 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_p1313102611386">Applicable Modules</p>
</td>
<td class="cellrowborder" valign="top" width="9.629999999999999%" headers="mcps1.3.4.3.4.2.1.2.4.1.2 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_p1013192653810">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="68.56%" headers="mcps1.3.4.3.4.2.1.2.4.1.3 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_p1313192653818">Select the modules for which this connection is available.</p>
</td>
</tr>
<tr id="dataartsstudio_01_0529__en-us_topic_0000001503446532_row949517556014"><td class="cellrowborder" colspan="3" valign="top" headers="mcps1.3.4.3.4.2.1.2.4.1.1 mcps1.3.4.3.4.2.1.2.4.1.2 mcps1.3.4.3.4.2.1.2.4.1.3 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_p1750285515010"><strong id="dataartsstudio_01_0529__en-us_topic_0000001503446532_b19163862964658">Basic and Network Connectivity Configuration</strong></p>
</td>
</tr>
<tr id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_row157315223542"><td class="cellrowborder" valign="top" width="21.81%" headers="mcps1.3.4.3.4.2.1.2.4.1.1 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p2941507316244">Host Address</p>
</td>
<td class="cellrowborder" valign="top" width="9.629999999999999%" headers="mcps1.3.4.3.4.2.1.2.4.1.2 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p3381070216244">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="68.56%" headers="mcps1.3.4.3.4.2.1.2.4.1.3 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p5431232316244">IP address of the Linux host</p>
<p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_p5431232316244">For details, see section "Viewing Details About an ECS" in <i><cite id="dataartsstudio_01_0529__en-us_topic_0000001503446532_cite1193605419576">Elastic Cloud Server User Guide</cite></i>.</p>
</td>
</tr>
<tr id="dataartsstudio_01_0529__en-us_topic_0000001503446532_row480717152356"><td class="cellrowborder" valign="top" width="21.81%" headers="mcps1.3.4.3.4.2.1.2.4.1.1 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p6650488816244">Agent</p>
</td>
<td class="cellrowborder" valign="top" width="9.629999999999999%" headers="mcps1.3.4.3.4.2.1.2.4.1.2 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p1818686216244">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="68.56%" headers="mcps1.3.4.3.4.2.1.2.4.1.3 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p1701417994541">CDM cluster used as an agent. If no CDM cluster is available, create one first by referring to <a href="dataartsstudio_01_0576.html">Creating a CDM Cluster</a>. </p>
<div class="note" id="dataartsstudio_01_0529__en-us_topic_0000001503446532_note1392318163014"><span class="notetitle"> NOTE: </span><div class="notebody"><ul id="dataartsstudio_01_0529__en-us_topic_0000001503446532_ul1676017331429"><li id="dataartsstudio_01_0529__en-us_topic_0000001503446532_li13534389213"><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_p5270642927"><a name="dataartsstudio_01_0529__en-us_topic_0000001503446532_li13534389213"></a><a name="en-us_topic_0000001503446532_li13534389213"></a>If a CDM cluster functions as the agent for a data connection in Management Center, the cluster supports a maximum of 200 concurrent active threads. If multiple data connections share an agent, a maximum of 200 SQL, Shell, and Python scripts submitted through the connections can run concurrently. Excess tasks will be queued. You are advised to plan multiple agents based on the workload.</p>
</li><li id="dataartsstudio_01_0529__en-us_topic_0000001503446532_li1476012331021">When scheduling shell or Python scripts, the agent accesses the ECS. If shell and Python scripts are scheduled frequently, the ECS adds the private IP address of the agent to the blocklist. To ensure normal job scheduling, you are advised to use the <strong id="dataartsstudio_01_0529__en-us_topic_0000001503446532_b91441110203311">root</strong> user of the ECS to add the private IP address bound to the agent (CDM cluster) to the <strong id="dataartsstudio_01_0529__en-us_topic_0000001503446532_b15694153319342">/etc/hosts.allow</strong> file.<p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_p37031362026">For details about how to obtain the private IP address of the CDM cluster, see <a href="dataartsstudio_01_0587.html">Viewing and Modifying CDM Cluster Configurations</a>.</p>
</li></ul>
</div></div>
</td>
</tr>
<tr id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_row1243664618549"><td class="cellrowborder" valign="top" width="21.81%" headers="mcps1.3.4.3.4.2.1.2.4.1.1 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p6656306216244">Port</p>
</td>
<td class="cellrowborder" valign="top" width="9.629999999999999%" headers="mcps1.3.4.3.4.2.1.2.4.1.2 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p2289891916244">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="68.56%" headers="mcps1.3.4.3.4.2.1.2.4.1.3 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_p18398254123410">SSH port number of the host.</p>
<p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p5031431816244">By default, port 22 is used to log in to a Linux host. If the port number has been changed, you can obtain the new port number from the <strong id="dataartsstudio_01_0529__en-us_topic_0000001503446532_b54299461411">port</strong> field in the <strong id="dataartsstudio_01_0529__en-us_topic_0000001503446532_b95051771629">/etc/ssh/sshd_config</strong> file.</p>
</td>
</tr>
<tr id="dataartsstudio_01_0529__en-us_topic_0000001503446532_row5550153012386"><td class="cellrowborder" valign="top" width="21.81%" headers="mcps1.3.4.3.4.2.1.2.4.1.1 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0141836082_p8895642919">KMS Key</p>
</td>
<td class="cellrowborder" valign="top" width="9.629999999999999%" headers="mcps1.3.4.3.4.2.1.2.4.1.2 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0141836082_p188456152916">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="68.56%" headers="mcps1.3.4.3.4.2.1.2.4.1.3 "><div class="p" id="dataartsstudio_01_0529__en-us_topic_0000001503446532_p4476133012514">KMS key used to encrypt and decrypt data source authentication information. Select a default or custom key.<div class="note" id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0000001554166437_note5782131311013"><span class="notetitle"> NOTE: </span><div class="notebody"><ul id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0000001554166437_ul15258512511"><li id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0000001554166437_li652514518257">When you use KMS for encryption through DataArts Studio or KPS for the first time, the default key <strong id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0000001554166437_b10282246320">dlf/default</strong> or <strong id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0000001554166437_b7601112203216">kps/default</strong> is automatically generated. For more information about default keys, see "What Is a Default Master Key?" in <em id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0000001554166437_i155895285215">Data Encryption Workshop FAQs</em>.</li><li id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0000001554166437_li694815818253">Only symmetric keys are supported. Asymmetric keys are not supported.</li></ul>
</div></div>
</div>
</td>
</tr>
<tr id="dataartsstudio_01_0529__en-us_topic_0000001503446532_row838910211747"><td class="cellrowborder" colspan="3" valign="top" headers="mcps1.3.4.3.4.2.1.2.4.1.1 mcps1.3.4.3.4.2.1.2.4.1.2 mcps1.3.4.3.4.2.1.2.4.1.3 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_p1639016211420"><strong id="dataartsstudio_01_0529__en-us_topic_0000001503446532_b130012781242244">Data Source Authentication and Other Function Configuration</strong></p>
</td>
</tr>
<tr id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_row48987972162438"><td class="cellrowborder" valign="top" width="21.81%" headers="mcps1.3.4.3.4.2.1.2.4.1.1 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p8602767162438">Username</p>
</td>
<td class="cellrowborder" valign="top" width="9.629999999999999%" headers="mcps1.3.4.3.4.2.1.2.4.1.2 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p25735531162438">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="68.56%" headers="mcps1.3.4.3.4.2.1.2.4.1.3 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p4203263162438">Username for logging in to the host</p>
</td>
</tr>
<tr id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_row6514118195516"><td class="cellrowborder" valign="top" width="21.81%" headers="mcps1.3.4.3.4.2.1.2.4.1.1 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p115140810551">Login Mode</p>
</td>
<td class="cellrowborder" valign="top" width="9.629999999999999%" headers="mcps1.3.4.3.4.2.1.2.4.1.2 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p1514158145510">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="68.56%" headers="mcps1.3.4.3.4.2.1.2.4.1.3 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p751413812555">Mode for logging in to the host</p>
<ul id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_ul198581920145512"><li id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_li18285354552">Key Pair</li><li id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_li98581920185516">Password</li></ul>
</td>
</tr>
<tr id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_row117811710115613"><td class="cellrowborder" valign="top" width="21.81%" headers="mcps1.3.4.3.4.2.1.2.4.1.1 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p127811010145616">Key Pair</p>
</td>
<td class="cellrowborder" valign="top" width="9.629999999999999%" headers="mcps1.3.4.3.4.2.1.2.4.1.2 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p14781111015617">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="68.56%" headers="mcps1.3.4.3.4.2.1.2.4.1.3 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_p154393289386">This parameter is available only when <span class="parmname" id="dataartsstudio_01_0529__en-us_topic_0000001503446532_parmname72814281502"><b>Login Mode</b></span> is set to <span class="parmvalue" id="dataartsstudio_01_0529__en-us_topic_0000001503446532_parmvalue1628122845015"><b>Key Pair</b></span>.</p>
<p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p20781101012568">If <strong id="dataartsstudio_01_0529__en-us_topic_0000001503446532_b44431731143513">Key Pair</strong> is the login mode of the host, you need to obtain the private key file, upload it to OBS, and select an OBS path.</p>
<div class="note" id="dataartsstudio_01_0529__en-us_topic_0000001503446532_note3103389420"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_p15285039173320">The uploaded private key must match the public key configured on the host. For details, see "Passwords and Key Pairs" &gt; "Key Pairs" &gt; "Application Scenarios for Using Key Pairs" in <em id="dataartsstudio_01_0529__en-us_topic_0000001503446532_i129783813353">Elastic Cloud Server User Guide</em>.</p>
</div></div>
</td>
</tr>
<tr id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_row12112215812"><td class="cellrowborder" valign="top" width="21.81%" headers="mcps1.3.4.3.4.2.1.2.4.1.1 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p417210585">Key Pair Password</p>
</td>
<td class="cellrowborder" valign="top" width="9.629999999999999%" headers="mcps1.3.4.3.4.2.1.2.4.1.2 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p7118217580">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="68.56%" headers="mcps1.3.4.3.4.2.1.2.4.1.3 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p214215817">If no password is set for the key pair, you do not need to set this parameter.</p>
</td>
</tr>
<tr id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_row3239631716244"><td class="cellrowborder" valign="top" width="21.81%" headers="mcps1.3.4.3.4.2.1.2.4.1.1 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p685599316244">Password</p>
</td>
<td class="cellrowborder" valign="top" width="9.629999999999999%" headers="mcps1.3.4.3.4.2.1.2.4.1.2 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p1846458616244">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="68.56%" headers="mcps1.3.4.3.4.2.1.2.4.1.3 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_p20281162519397">This parameter is available only when <span class="parmname" id="dataartsstudio_01_0529__en-us_topic_0000001503446532_parmname10989946195012"><b>Login Mode</b></span> is set to <span class="parmvalue" id="dataartsstudio_01_0529__en-us_topic_0000001503446532_parmvalue1398916464508"><b>Password</b></span>.</p>
<p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p1923653616244">If the login mode of the host is to use a password, enter a login password.</p>
</td>
</tr>
<tr id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_row64121748965"><td class="cellrowborder" valign="top" width="21.81%" headers="mcps1.3.4.3.4.2.1.2.4.1.1 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p134128481466">Host Connection Description</p>
</td>
<td class="cellrowborder" valign="top" width="9.629999999999999%" headers="mcps1.3.4.3.4.2.1.2.4.1.2 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p1041218487615">No</p>
</td>
<td class="cellrowborder" valign="top" width="68.56%" headers="mcps1.3.4.3.4.2.1.2.4.1.3 "><p id="dataartsstudio_01_0529__en-us_topic_0000001503446532_en-us_topic_0103403019_p1041215487620">Descriptive information about the host connection</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="dataartsstudio_01_0529__p1642104610339"></p>
<p id="dataartsstudio_01_0529__p10765134493412"></p>
<div class="note" id="dataartsstudio_01_0529__note14476192615284"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="dataartsstudio_01_0529__p2099313294566">The key parameters are as follows:</p>
<ul id="dataartsstudio_01_0529__ul62127379288"><li id="dataartsstudio_01_0529__li19941329135611"><strong id="dataartsstudio_01_0529__b735502010328">Host Address</strong>: Enter the IP address of the <a href="#dataartsstudio_01_0529__li6183612122320">ECS</a>.</li><li id="dataartsstudio_01_0529__li9212837152814"><strong id="dataartsstudio_01_0529__b1738214353244">Agent</strong>: Select the CDM cluster you have obtained from the <a href="#dataartsstudio_01_0529__li948222884818">DataArts Migration incremental package</a>.</li></ul>
</div></div>
</p></li><li id="dataartsstudio_01_0529__li57807515243"><span>Click <strong id="dataartsstudio_01_0529__b1734142162416">Test</strong> to test connectivity of the data connection. If the test fails, the data connection cannot be created.</span></li><li id="dataartsstudio_01_0529__li1078185132416"><span>After the test is successful, click <strong id="dataartsstudio_01_0529__b9748928122411">OK</strong> to create the data connection.</span></li></ol>
</div>
<div class="section" id="dataartsstudio_01_0529__section12751717103220"><h4 class="sectiontitle">Developing a Python Script</h4><ol id="dataartsstudio_01_0529__ol1172145712414"><li id="dataartsstudio_01_0529__li1872155772414"><span>Choose <strong id="dataartsstudio_01_0529__b2141956113810">DataArts Factory</strong> &gt; <strong id="dataartsstudio_01_0529__b191461556133817">Develop Script</strong> and create a Python script named <strong id="dataartsstudio_01_0529__b131461356183816">python_test</strong>.</span></li><li id="dataartsstudio_01_0529__li165375199549"><span>Select a Python version (for example, <strong id="dataartsstudio_01_0529__b147181624963">Python 3</strong>) and host connection, and set input parameters as needed.</span><p><div class="note" id="dataartsstudio_01_0529__note33184812558"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="dataartsstudio_01_0529__p8200657103917">The parameters will be transferred to the Python script when the script is executed. The parameters are separated by spaces, for example, <strong id="dataartsstudio_01_0529__b104499351191">Microsoft Oracle</strong>. The parameters must be referenced by the Python script. Otherwise, the parameters are invalid.</p>
</div></div>
</p></li><li id="dataartsstudio_01_0529__li168014202510"><span>Edit Python statements in the editor.</span><p><div class="p" id="dataartsstudio_01_0529__p179874514365">This example defines a string template for saving company information and uses the template to output information about different companies.<pre class="screen" id="dataartsstudio_01_0529__screen3691419131813">import sys
Company_Name1=sys.argv[1]
Company_Name2=sys.argv[2]
template='No.:{:0&gt;9s} \t CompanyName: {:s} \t Website: https://www.{:s}.com'
context1=template.format('1',Company_Name1,Company_Name1.lower())
context2=template.format('2',Company_Name2,Company_Name2.lower())
print(context1)
print(context2)</pre>
</div>
<div class="note" id="dataartsstudio_01_0529__note657744313324"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="dataartsstudio_01_0529__ul194801917163510"><li id="dataartsstudio_01_0529__li266882817356">The script development area in <a href="#dataartsstudio_01_0529__fig6853134420369">Figure 1</a> is a temporary debugging area. After you close the script tab, the development area will be cleared.</li><li id="dataartsstudio_01_0529__li1666817280354"><strong id="dataartsstudio_01_0529__b175371327163217">Connection</strong>: Select the data connection created in <a href="#dataartsstudio_01_0529__section3216144795514">Creating an ECS Data Connection</a>.</li></ul>
</div></div>
<div class="fignone" id="dataartsstudio_01_0529__fig6853134420369"><a name="dataartsstudio_01_0529__fig6853134420369"></a><a name="fig6853134420369"></a><span class="figcap"><b>Figure 1 </b>Editing the Python statements</span><br><span><img id="dataartsstudio_01_0529__image14157105426" src="en-us_image_0000002269196981.png" title="Click to enlarge" class="imgResize"></span></div>
<p id="dataartsstudio_01_0529__p44203155610"></p>
</p></li><li id="dataartsstudio_01_0529__li19687154115524"><span>Click <strong id="dataartsstudio_01_0529__b11823181120140">Save</strong> and then <strong id="dataartsstudio_01_0529__b3214219171420">Submit</strong>.</span></li><li id="dataartsstudio_01_0529__li202268592518"><span>Click <span class="uicontrol" id="dataartsstudio_01_0529__uicontrol964423314386"><b>Execute</b></span> to execute the Python statements.</span></li><li id="dataartsstudio_01_0529__li7341161254"><span>View the script execution result.</span><p><div class="fignone" id="dataartsstudio_01_0529__fig104205402396"><span class="figcap"><b>Figure 2 </b>Viewing the script execution result</span><br><span><img id="dataartsstudio_01_0529__image18496617165318" src="en-us_image_0000002269116885.png" title="Click to enlarge" class="imgResize"></span></div>
<p id="dataartsstudio_01_0529__p685293110719"></p>
</p></li></ol>
</div>
<div class="section" id="dataartsstudio_01_0529__section14976312287"><h4 class="sectiontitle">Referencing the Python Script in a Job</h4><ol id="dataartsstudio_01_0529__ol09743391389"><li id="dataartsstudio_01_0529__li0974163915815"><span>Create a job.</span></li><li id="dataartsstudio_01_0529__li7196135210811"><span>Select a Python node and configure the node properties.</span><p><div class="p" id="dataartsstudio_01_0529__p117041617161515">Select the created Python script and set the node parameters. Set <strong id="dataartsstudio_01_0529__b5282727264">Script Parameters</strong>.<div class="note" id="dataartsstudio_01_0529__note13721114416271"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="dataartsstudio_01_0529__p7721194410276">The parameters will be transferred to the Python statement when the statement is executed. The parameters are separated by spaces, for example, <strong id="dataartsstudio_01_0529__b732772713259">Microsoft Oracle</strong>. The parameters must be referenced by the Python statement. Otherwise, the parameters are invalid.</p>
</div></div>
<div class="fignone" id="dataartsstudio_01_0529__fig25591221191410"><span class="figcap"><b>Figure 3 </b>Configuring properties of the Python node</span><br><span><img id="dataartsstudio_01_0529__image55591821161419" src="en-us_image_0000002269196997.png" title="Click to enlarge" class="imgResize"></span></div>
</div>
<p id="dataartsstudio_01_0529__p8317559152311"></p>
</p></li><li id="dataartsstudio_01_0529__li189461028151811"><span>Click <strong id="dataartsstudio_01_0529__b22145216296">Test</strong> and view the job running result.</span><p><div class="fignone" id="dataartsstudio_01_0529__fig1597512493218"><span class="figcap"><b>Figure 4 </b>Checking the job execution result</span><br><span><img id="dataartsstudio_01_0529__image16976144912211" src="en-us_image_0000002269116909.png" title="Click to enlarge" class="imgResize"></span></div>
<p id="dataartsstudio_01_0529__p1382073313256"></p>
</p></li><li id="dataartsstudio_01_0529__li18343175565919"><span>Click <strong id="dataartsstudio_01_0529__b947345872914">Save</strong>. The job configuration is complete.</span></li><li id="dataartsstudio_01_0529__li3778154210016"><span>Click <strong id="dataartsstudio_01_0529__b153091731123016">Submit</strong>. After a version is submitted, the job can be scheduled.</span></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dataartsstudio_01_0520.html">Usage Guidance</a></div>
</div>
</div>
<script language="JavaScript">
<!--
initImageViewer('.imgResize');
var msg_imageMax = "view original image";
var msg_imageClose = "close";
//--></script>