forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: chenxiaoxiong <chenxiaoxiong@huawei.com> Co-committed-by: chenxiaoxiong <chenxiaoxiong@huawei.com>
83 lines
17 KiB
HTML
83 lines
17 KiB
HTML
<a name="dataartsstudio_01_0504"></a><a name="dataartsstudio_01_0504"></a>
|
|
|
|
<h1 class="topictitle1">Configuring Environment Variables</h1>
|
|
<div id="body8662426"><p id="dataartsstudio_01_0504__en-us_topic_0175328117_p1033132923012">This topic describes how to configure and use environment variables.</p>
|
|
<div class="section" id="dataartsstudio_01_0504__section1029718195210"><h4 class="sectiontitle">Application Scenario</h4><p id="dataartsstudio_01_0504__p145803617521">Configure job parameters. If a parameter belongs to multiple jobs, you can extract this parameter as an environment variable. Environment variables can be imported and exported.</p>
|
|
<div class="note" id="dataartsstudio_01_0504__note182316121814"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="dataartsstudio_01_0504__p13862183601818">The roles that can configure workspace environment variables in the simple and enterprise mode are as follows:</p>
|
|
<p id="dataartsstudio_01_0504__p157207140193">Simple mode: Both developers and administrators can create and edit environment variables in a workspace. This mode does not distinguish the development environment from the production environment. Developers can modify environment variables.</p>
|
|
<p id="dataartsstudio_01_0504__p181991118121913">Enterprise mode: Only administrators can create or edit environment variables in a workspace.</p>
|
|
</div></div>
|
|
</div>
|
|
<div class="section" id="dataartsstudio_01_0504__section4774141510453"><h4 class="sectiontitle">Importing Environment Variables</h4><p id="dataartsstudio_01_0504__p250134214412">This function is available only if the OBS service is available. If OBS is unavailable, variables can be imported from the local PC.</p>
|
|
<ol id="dataartsstudio_01_0504__ol18156158174617"><li id="dataartsstudio_01_0504__li2848154165110"><span>Log in to the <span id="dataartsstudio_01_0504__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 id="dataartsstudio_01_0504__li10888120591"><span>On the <span id="dataartsstudio_01_0504__en-us_topic_0181092879_text185611381448">DataArts Studio</span> console, locate a workspace and click <strong id="dataartsstudio_01_0504__en-us_topic_0181092879_b65382814249">DataArts Factory</strong>.</span></li><li id="dataartsstudio_01_0504__li41561058114614"><span>In the navigation tree on the left, choose <span class="parmname" id="dataartsstudio_01_0504__parmname1930019241620"><b>Specifications</b></span>.</span></li><li id="dataartsstudio_01_0504__li16160529209"><span>Click <strong id="dataartsstudio_01_0504__b1732415916414">Environment Variables</strong>. On the <strong id="dataartsstudio_01_0504__b20452812142">Environment Variables</strong> page, click <strong id="dataartsstudio_01_0504__b1913010201944">Import</strong>.</span></li><li id="dataartsstudio_01_0504__li61561158184619"><span>In the <strong id="dataartsstudio_01_0504__b11833042489">Import Environment Variable</strong> dialog box, select an environment variable file from OBS or a local path and the duplicate name policy.</span><p><div class="fignone" id="dataartsstudio_01_0504__fig13820144213013"><span class="figcap"><b>Figure 1 </b>Importing Environment Variables</span><br><span><img id="dataartsstudio_01_0504__image716622142314" src="en-us_image_0000002234075804.png" title="Click to enlarge" class="imgResize"></span></div>
|
|
<p id="dataartsstudio_01_0504__p39455333257"></p>
|
|
<p id="dataartsstudio_01_0504__p175672872913"></p>
|
|
</p></li></ol>
|
|
</div>
|
|
<div class="section" id="dataartsstudio_01_0504__section1145154483111"><h4 class="sectiontitle">Exporting Environment Variables</h4><ol id="dataartsstudio_01_0504__ol1075161015320"><li id="dataartsstudio_01_0504__li329112138326"><span>Log in to the <span id="dataartsstudio_01_0504__en-us_topic_0000001987511677_en-us_topic_0000001127311125_text5574448155719_1">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 id="dataartsstudio_01_0504__li132924138324"><span>On the <span id="dataartsstudio_01_0504__en-us_topic_0181092879_text185611381448_1">DataArts Studio</span> console, locate a workspace and click <strong id="dataartsstudio_01_0504__en-us_topic_0181092879_b65382814249_1">DataArts Factory</strong>.</span></li><li id="dataartsstudio_01_0504__li182924134323"><span>In the navigation tree on the left, choose <span class="parmname" id="dataartsstudio_01_0504__parmname946124327"><b>Specifications</b></span>.</span></li><li id="dataartsstudio_01_0504__li5292151333219"><span>Click <span class="wintitle" id="dataartsstudio_01_0504__wintitle8292101317327"><b>Environment Variable</b></span>. On the <span class="wintitle" id="dataartsstudio_01_0504__wintitle429231316325"><b>Environment Variable</b></span> page, click <span class="uicontrol" id="dataartsstudio_01_0504__uicontrol4292713173220"><b>Export</b></span> to export environment variables.</span></li></ol>
|
|
</div>
|
|
<div class="section" id="dataartsstudio_01_0504__en-us_topic_0175328117_section7729152119279"><a name="dataartsstudio_01_0504__en-us_topic_0175328117_section7729152119279"></a><a name="en-us_topic_0175328117_section7729152119279"></a><h4 class="sectiontitle">Configuration Method</h4><ol id="dataartsstudio_01_0504__en-us_topic_0175328117_ol82410082819"><li id="dataartsstudio_01_0504__li1018184511119"><span>Log in to the <span id="dataartsstudio_01_0504__en-us_topic_0000001987511677_en-us_topic_0000001127311125_text5574448155719_2">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 id="dataartsstudio_01_0504__li133571231755"><span>On the <span id="dataartsstudio_01_0504__en-us_topic_0181092879_text185611381448_2">DataArts Studio</span> console, locate a workspace and click <strong id="dataartsstudio_01_0504__en-us_topic_0181092879_b65382814249_2">DataArts Factory</strong>.</span></li><li id="dataartsstudio_01_0504__en-us_topic_0175328117_li52490192815"><span>In the navigation tree on the left, choose <span class="parmname" id="dataartsstudio_01_0504__parmname178941250185413"><b>Specifications</b></span>.</span></li><li id="dataartsstudio_01_0504__en-us_topic_0175328117_li1224180202820"><span>On the <strong id="dataartsstudio_01_0504__en-us_topic_0175328117_b178971568283">Environment Variable</strong> page, set the variables or constants listed in <a href="#dataartsstudio_01_0504__table152451023155711">Table 1</a> and click <strong id="dataartsstudio_01_0504__en-us_topic_0175328117_b14175122672816">Save</strong>.</span><p><div class="note" id="dataartsstudio_01_0504__note169264012578"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="dataartsstudio_01_0504__p54651514155820">The difference between a variable and a constant lies in whether their values need to be reconfigured when they are imported to another workspace or project.</p>
|
|
<ul id="dataartsstudio_01_0504__ul118291022205813"><li id="dataartsstudio_01_0504__li108294224587">The value of a variable (such as <strong id="dataartsstudio_01_0504__b27171826131017">workspace name</strong>) varies depending on the workspace. When exporting a variable from a workspace and import it to another workspace, you must reconfigure its value.</li><li id="dataartsstudio_01_0504__li58291722145816">The value of a constant in different workspaces is the same. When importing a constant to another workspace, you do not need to reconfigure its value.</li></ul>
|
|
</div></div>
|
|
<div class="fignone" id="dataartsstudio_01_0504__fig6244122311575"><span class="figcap"><b>Figure 2 </b>Configuring environment variables</span><br><span><img id="dataartsstudio_01_0504__image1477313262214" src="en-us_image_0000002234235624.png" title="Click to enlarge" class="imgResize"></span></div>
|
|
|
|
<div class="tablenoborder"><a name="dataartsstudio_01_0504__table152451023155711"></a><a name="table152451023155711"></a><table cellpadding="4" cellspacing="0" summary="" id="dataartsstudio_01_0504__table152451023155711" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Configuring environment variables</caption><thead align="left"><tr id="dataartsstudio_01_0504__row72442234573"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.5.2.4.2.3.2.4.1.1"><p id="dataartsstudio_01_0504__p202449231571">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="12%" id="mcps1.3.5.2.4.2.3.2.4.1.2"><p id="dataartsstudio_01_0504__p1724422355719">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="63%" id="mcps1.3.5.2.4.2.3.2.4.1.3"><p id="dataartsstudio_01_0504__p2024412233573">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="dataartsstudio_01_0504__row1824462335718"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.2.4.2.3.2.4.1.1 "><p id="dataartsstudio_01_0504__p1224432319575">Parameter</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12%" headers="mcps1.3.5.2.4.2.3.2.4.1.2 "><p id="dataartsstudio_01_0504__p1124482310574">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="63%" headers="mcps1.3.5.2.4.2.3.2.4.1.3 "><p id="dataartsstudio_01_0504__p4244182345710">The parameter name must be unique, consist of 1 to 64 characters, and contain only letters, digits, underscores (<span class="parmvalue" id="dataartsstudio_01_0504__en-us_topic_0175328117_parmvalue71372578294"><b>_</b></span>), and hyphens (<span class="parmvalue" id="dataartsstudio_01_0504__en-us_topic_0175328117_parmvalue1215105716297"><b>-</b></span>).</p>
|
|
<p id="dataartsstudio_01_0504__p2627153114019">The parameter name must be in the format set in <a href="dataartsstudio_01_04501.html#dataartsstudio_01_04501__section310213518565">Configuring Script Variables</a>. For example, if the format set in the script variable definition is <strong id="dataartsstudio_01_0504__b2411736162020">${dlf.}</strong>, the parameter name must be set to <strong id="dataartsstudio_01_0504__b862634772015">dlf.</strong><em id="dataartsstudio_01_0504__i821711311459">xxx</em>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dataartsstudio_01_0504__row1124512316572"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.2.4.2.3.2.4.1.1 "><p id="dataartsstudio_01_0504__p11244723155717">Value</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12%" headers="mcps1.3.5.2.4.2.3.2.4.1.2 "><p id="dataartsstudio_01_0504__p1724452385712">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="63%" headers="mcps1.3.5.2.4.2.3.2.4.1.3 "><p id="dataartsstudio_01_0504__p224412235575">Parameter values support constants and EL expressions but do not support system functions. For example, <strong id="dataartsstudio_01_0504__b79219143360">123</strong> and <strong id="dataartsstudio_01_0504__b186921417193613">abc</strong> are supported. If the parameter value is a string, add double quotation marks (""), for example, <strong id="dataartsstudio_01_0504__b1765264715365">"05"</strong>.</p>
|
|
<p id="dataartsstudio_01_0504__p924412316574">For details about how to use EL expressions, see <a href="dataartsstudio_01_0494.html">Expression Overview</a>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dataartsstudio_01_0504__row15703851813"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.2.4.2.3.2.4.1.1 "><p id="dataartsstudio_01_0504__p65703817185">Description</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12%" headers="mcps1.3.5.2.4.2.3.2.4.1.2 "><p id="dataartsstudio_01_0504__p145701889184">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="63%" headers="mcps1.3.5.2.4.2.3.2.4.1.3 "><p id="dataartsstudio_01_0504__p1857011891811">Parameter description</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p id="dataartsstudio_01_0504__p1324592365719">You can add, modify, delete, and reset environment variables.</p>
|
|
<ul id="dataartsstudio_01_0504__ul1245823115719"><li id="dataartsstudio_01_0504__li1224562345713">Add an environment variable: Click <span class="uicontrol" id="dataartsstudio_01_0504__en-us_topic_0175328117_uicontrol6731845113320"><b>Add</b></span>. After an environment variable is added, <strong id="dataartsstudio_01_0504__b910377113919">Add</strong> is displayed for it.</li><li id="dataartsstudio_01_0504__li524552318572">Edit an environment variable: If the parameter value is a constant, change the parameter value in the text box. If the parameter value is an EL expression, click <span><img id="dataartsstudio_01_0504__en-us_topic_0175328117_image1981117602" src="en-us_image_0000002234075784.png" title="Click to enlarge" class="imgResize"></span> next to the text box to edit the EL expression. Click <span class="uicontrol" id="dataartsstudio_01_0504__en-us_topic_0175328117_uicontrol13179154643017"><b>Save</b></span>. After an environment variable is modified, <strong id="dataartsstudio_01_0504__b1715094213394">Modify</strong> is displayed for it.</li><li id="dataartsstudio_01_0504__li1524512231577">Delete an environment variable: Click <strong id="dataartsstudio_01_0504__b1212185563412">Delete</strong> next to the parameter value text box. After an environment variable is deleted, <strong id="dataartsstudio_01_0504__b14953124714014">Delete</strong> is displayed for it.</li><li id="dataartsstudio_01_0504__li137154130504">Reset an environment variable: When modifying or deleting an environment variable, you can click <strong id="dataartsstudio_01_0504__b8260155914312">Reset</strong> in the <strong id="dataartsstudio_01_0504__b12764187134416">Operation</strong> column to reset the variable value to the original value.</li></ul>
|
|
</p></li></ol>
|
|
</div>
|
|
<div class="section" id="dataartsstudio_01_0504__en-us_topic_0175328117_section468142122818"><h4 class="sectiontitle">How-Tos</h4><p id="dataartsstudio_01_0504__en-us_topic_0175328117_p9503151911214">The configured environment variables can be used in either of the following ways:</p>
|
|
<ol id="dataartsstudio_01_0504__en-us_topic_0175328117_ol185036195215"><li id="dataartsstudio_01_0504__en-us_topic_0175328117_li1050331913216">${Environment variable}</li><li id="dataartsstudio_01_0504__en-us_topic_0175328117_li75031719829">#{Evn.get("Environment variable")}</li></ol>
|
|
</div>
|
|
<div class="section" id="dataartsstudio_01_0504__en-us_topic_0175328117_section159715532116"><h4 class="sectiontitle">Example</h4><p id="dataartsstudio_01_0504__en-us_topic_0175328117_p1641581123">Context:</p>
|
|
<ul id="dataartsstudio_01_0504__en-us_topic_0175328117_ul194151210213"><li id="dataartsstudio_01_0504__en-us_topic_0175328117_li1741512115214">A job named <span class="parmvalue" id="dataartsstudio_01_0504__en-us_topic_0175328117_parmvalue9415111424"><b>test</b></span> has been created in the DataArts Factory module.</li><li id="dataartsstudio_01_0504__en-us_topic_0175328117_li741617113212">An environment variable has been added. The parameter name is <span class="parmvalue" id="dataartsstudio_01_0504__en-us_topic_0175328117_parmvalue48716217347"><b>job</b></span> and the parameter value is <span class="parmvalue" id="dataartsstudio_01_0504__en-us_topic_0175328117_parmvalue28728219346"><b>123</b></span>.</li></ul>
|
|
<ol id="dataartsstudio_01_0504__en-us_topic_0175328117_ol10416315219"><li id="dataartsstudio_01_0504__en-us_topic_0175328117_li15416312027"><span>Open <span class="parmvalue" id="dataartsstudio_01_0504__en-us_topic_0175328117_parmvalue1333017173416"><b>test</b></span> and drag a <span class="parmvalue" id="dataartsstudio_01_0504__en-us_topic_0175328117_parmvalue16330514348"><b>Create OBS</b></span> node from the node library.</span></li><li id="dataartsstudio_01_0504__en-us_topic_0175328117_li15416011921"><span>On the <strong id="dataartsstudio_01_0504__en-us_topic_0175328117_b42391752346">Node Properties</strong> tab page, configure the node properties.</span><p><div class="fignone" id="dataartsstudio_01_0504__en-us_topic_0175328117_fig141771124"><span class="figcap"><b>Figure 3 </b>Configuring parameters for the Create OBS node</span><br><span><img id="dataartsstudio_01_0504__image17481413284" src="en-us_image_0000002269114989.png" title="Click to enlarge" class="imgResize"></span></div>
|
|
</p></li><li id="dataartsstudio_01_0504__en-us_topic_0175328117_li17417811620"><span>Click <span class="uicontrol" id="dataartsstudio_01_0504__en-us_topic_0175328117_uicontrol03856291348"><b>Save</b></span> and then <span class="uicontrol" id="dataartsstudio_01_0504__en-us_topic_0175328117_uicontrol9385142915349"><b>Monitor</b></span> to monitor the running status of the job.</span></li></ol>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dataartsstudio_01_0510.html">Configuring Resources</a></div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script language="JavaScript">
|
|
<!--
|
|
initImageViewer('.imgResize');
|
|
var msg_imageMax = "view original image";
|
|
var msg_imageClose = "close";
|
|
//--></script> |