doc-exports/docs/fg/umn/functiongraph_01_2119.html
Chen, Junjie dac566cf2f FG UMN 20230725 version
Reviewed-by: Eotvos, Oliver <oliver.eotvos@t-systems.com>
Co-authored-by: Chen, Junjie <chenjunjie@huawei.com>
Co-committed-by: Chen, Junjie <chenjunjie@huawei.com>
2024-04-03 10:30:56 +00:00

95 lines
15 KiB
HTML

<a name="functiongraph_01_2119"></a><a name="functiongraph_01_2119"></a>
<h1 class="topictitle1">Configuring Dependency Packages</h1>
<div id="body32001227"><div class="section" id="functiongraph_01_2119__en-us_topic_0000001709351588_section2227941184412"><h4 class="sectiontitle">Overview</h4><p id="functiongraph_01_2119__en-us_topic_0000001709351588_p6893184574416">Generally, the code of a function consists of public libraries and service logic. The public libraries can be packaged as a dependency and shared among functions, reducing the size of the function code package for easy deployment and update.</p>
<p id="functiongraph_01_2119__en-us_topic_0000001709351588_p1894345124417">FunctionGraph also provides some public dependencies, which are cached internally for quick loading. These dependencies are recommended.</p>
<p id="functiongraph_01_2119__en-us_topic_0000001709351588_p396144910169">FunctionGraph enables you to manage dependencies in a unified manner. You can upload dependencies from a local path, or through OBS if they are too large, and specify names for them. Dependencies can be iterated. Each dependency can have multiple versions.</p>
<p id="functiongraph_01_2119__en-us_topic_0000001709351588_p03991731852">For details, see section "How Do I Create Function Dependencies?"</p>
<div class="note" id="functiongraph_01_2119__en-us_topic_0000001709351588_note86195437210"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="functiongraph_01_2119__en-us_topic_0000001709351588_ul3359132872314"><li id="functiongraph_01_2119__en-us_topic_0000001709351588_li1535914283236">The name of each file in the dependency package cannot end with a tilde (~).</li><li id="functiongraph_01_2119__en-us_topic_0000001709351588_li1635919289234">A dependency package can contain up to 30,000 files.</li><li id="functiongraph_01_2119__en-us_topic_0000001709351588_li1835913283236">If your function uses a large private dependency, increase the execution timeout by choosing <strong id="functiongraph_01_2119__en-us_topic_0000001709351588_b11751061212228">Configuration</strong> &gt; <strong id="functiongraph_01_2119__en-us_topic_0000001709351588_b3786304382228">Basic Settings</strong> on the function details page.</li></ul>
</div></div>
</div>
<div class="section" id="functiongraph_01_2119__en-us_topic_0000001709351588_section118715216915"><h4 class="sectiontitle">Creating a Dependency</h4><ol id="functiongraph_01_2119__en-us_topic_0000001709351588_ol1542524912186"><li id="functiongraph_01_2119__en-us_topic_0000001709351588_li742574915185"><span>Log in to the FunctionGraph console, and choose <strong id="functiongraph_01_2119__en-us_topic_0000001709351588_b20514054372228">Functions</strong> &gt; <strong id="functiongraph_01_2119__en-us_topic_0000001709351588_b14072692342228">Dependencies</strong> in the navigation pane.</span></li><li id="functiongraph_01_2119__en-us_topic_0000001709351588_li120592751912"><span>Click <strong id="functiongraph_01_2119__en-us_topic_0000001709351588_b2289979922228">Create Dependency</strong>.</span></li><li id="functiongraph_01_2119__en-us_topic_0000001709351588_li13416103542219"><span>Set the following parameters:</span><p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="functiongraph_01_2119__en-us_topic_0000001709351588_table896419289405" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Dependency configuration parameters</caption><thead align="left"><tr id="functiongraph_01_2119__en-us_topic_0000001709351588_row10966122854014"><th align="left" class="cellrowborder" valign="top" width="20.11%" id="mcps1.3.2.2.3.2.1.2.3.1.1"><p id="functiongraph_01_2119__en-us_topic_0000001709351588_p139661428204011">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="79.89%" id="mcps1.3.2.2.3.2.1.2.3.1.2"><p id="functiongraph_01_2119__en-us_topic_0000001709351588_p139661528114014">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="functiongraph_01_2119__en-us_topic_0000001709351588_row39669289407"><td class="cellrowborder" valign="top" width="20.11%" headers="mcps1.3.2.2.3.2.1.2.3.1.1 "><p id="functiongraph_01_2119__en-us_topic_0000001709351588_p596602814010">Name</p>
</td>
<td class="cellrowborder" valign="top" width="79.89%" headers="mcps1.3.2.2.3.2.1.2.3.1.2 "><p id="functiongraph_01_2119__en-us_topic_0000001709351588_p189661628124010">Dependency name.</p>
</td>
</tr>
<tr id="functiongraph_01_2119__en-us_topic_0000001709351588_row14966122814010"><td class="cellrowborder" valign="top" width="20.11%" headers="mcps1.3.2.2.3.2.1.2.3.1.1 "><p id="functiongraph_01_2119__en-us_topic_0000001709351588_p8966192894012">Code Entry Mode</p>
</td>
<td class="cellrowborder" valign="top" width="79.89%" headers="mcps1.3.2.2.3.2.1.2.3.1.2 "><p id="functiongraph_01_2119__en-us_topic_0000001709351588_p20967152864019">Upload a ZIP file directly or upload a file from OBS.</p>
<ul id="functiongraph_01_2119__en-us_topic_0000001709351588_ul11871105310412"><li id="functiongraph_01_2119__en-us_topic_0000001709351588_li138726534417"><strong id="functiongraph_01_2119__en-us_topic_0000001709351588_b559879492228">Upload ZIP</strong>: Click <strong id="functiongraph_01_2119__en-us_topic_0000001709351588_b14053685772228">Select File</strong> to upload one.</li><li id="functiongraph_01_2119__en-us_topic_0000001709351588_li1310225910416"><strong id="functiongraph_01_2119__en-us_topic_0000001709351588_b11781768942228">Upload from OBS</strong>: Specify an OBS link URL.</li></ul>
</td>
</tr>
<tr id="functiongraph_01_2119__en-us_topic_0000001709351588_row10967132815401"><td class="cellrowborder" valign="top" width="20.11%" headers="mcps1.3.2.2.3.2.1.2.3.1.1 "><p id="functiongraph_01_2119__en-us_topic_0000001709351588_p14967528194016">Runtime</p>
</td>
<td class="cellrowborder" valign="top" width="79.89%" headers="mcps1.3.2.2.3.2.1.2.3.1.2 "><p id="functiongraph_01_2119__en-us_topic_0000001709351588_p296713281406">Select a runtime.</p>
</td>
</tr>
<tr id="functiongraph_01_2119__en-us_topic_0000001709351588_row1796752815407"><td class="cellrowborder" valign="top" width="20.11%" headers="mcps1.3.2.2.3.2.1.2.3.1.1 "><p id="functiongraph_01_2119__en-us_topic_0000001709351588_p596762812409">Description</p>
</td>
<td class="cellrowborder" valign="top" width="79.89%" headers="mcps1.3.2.2.3.2.1.2.3.1.2 "><p id="functiongraph_01_2119__en-us_topic_0000001709351588_p109671628164010">Description of the dependency. This parameter is optional.</p>
</td>
</tr>
</tbody>
</table>
</div>
</p></li><li id="functiongraph_01_2119__en-us_topic_0000001709351588_li0747192332610"><span>Click <strong id="functiongraph_01_2119__en-us_topic_0000001709351588_b2672177512228">OK</strong>. By default, a new dependency is version <strong id="functiongraph_01_2119__en-us_topic_0000001709351588_b14712245852228">1</strong>.</span></li><li id="functiongraph_01_2119__en-us_topic_0000001709351588_li6468142912444"><span>Click the dependency name, and view all versions and related information on the displayed page. Each dependency can have multiple versions.</span><p><ul id="functiongraph_01_2119__en-us_topic_0000001709351588_ul154744225414"><li id="functiongraph_01_2119__en-us_topic_0000001709351588_li94337427551">To create a dependency version, click <strong id="functiongraph_01_2119__en-us_topic_0000001709351588_b17739915602228">Create Version</strong> in the upper right corner of the page.</li><li id="functiongraph_01_2119__en-us_topic_0000001709351588_li0481142145417">To view the address of a version, click the version.</li><li id="functiongraph_01_2119__en-us_topic_0000001709351588_li360025491711">To delete a version, click the delete icon in the same row.<p id="functiongraph_01_2119__en-us_topic_0000001709351588_p058495461713"><a name="functiongraph_01_2119__en-us_topic_0000001709351588_li360025491711"></a><a name="en-us_topic_0000001709351588_li360025491711"></a></p>
<p id="functiongraph_01_2119__en-us_topic_0000001709351588_p436922315325"><span><img id="functiongraph_01_2119__en-us_topic_0000001709351588_image23699237329" src="en-us_image_0000001709193044.png"></span></p>
</li></ul>
</p></li></ol>
</div>
<div class="section" id="functiongraph_01_2119__en-us_topic_0000001709351588_section3901219916"><h4 class="sectiontitle">Configuring Dependencies for a Function</h4><ol id="functiongraph_01_2119__en-us_topic_0000001709351588_ol12623174514112"><li id="functiongraph_01_2119__en-us_topic_0000001709351588_li96245452411"><span>Return to the FunctionGraph console, and choose <strong id="functiongraph_01_2119__en-us_topic_0000001709351588_b17158338162228">Functions</strong> &gt; <strong id="functiongraph_01_2119__en-us_topic_0000001709351588_b12784437182228">Function List</strong> in the navigation pane.</span></li><li id="functiongraph_01_2119__en-us_topic_0000001709351588_li194161351104117"><span>Click the name of the desired function.</span></li><li id="functiongraph_01_2119__en-us_topic_0000001709351588_li149363497434"><span>On the displayed function details page, click the <strong id="functiongraph_01_2119__en-us_topic_0000001709351588_b11549511682228">Code</strong> tab, click <strong id="functiongraph_01_2119__en-us_topic_0000001709351588_b6139287282228">Add</strong> in the <strong id="functiongraph_01_2119__en-us_topic_0000001709351588_b5579111862228">Dependencies</strong> area.</span></li><li id="functiongraph_01_2119__en-us_topic_0000001709351588_li127481404477"><span>On the displayed <strong id="functiongraph_01_2119__en-us_topic_0000001709351588_b14313599632228">Select Dependency</strong> dialog box, select dependencies and click <strong id="functiongraph_01_2119__en-us_topic_0000001709351588_b20131773352228">OK</strong>.</span><p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="functiongraph_01_2119__en-us_topic_0000001709351588_table1739832411614" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Dependency configuration</caption><thead align="left"><tr id="functiongraph_01_2119__en-us_topic_0000001709351588_row133991024764"><th align="left" class="cellrowborder" valign="top" width="24.34%" id="mcps1.3.3.2.4.2.1.2.3.1.1"><p id="functiongraph_01_2119__en-us_topic_0000001709351588_p43994242612">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="75.66000000000001%" id="mcps1.3.3.2.4.2.1.2.3.1.2"><p id="functiongraph_01_2119__en-us_topic_0000001709351588_p10399024860">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="functiongraph_01_2119__en-us_topic_0000001709351588_row734343117111"><td class="cellrowborder" valign="top" width="24.34%" headers="mcps1.3.3.2.4.2.1.2.3.1.1 "><p id="functiongraph_01_2119__en-us_topic_0000001709351588_p53431031111113">Runtime</p>
</td>
<td class="cellrowborder" valign="top" width="75.66000000000001%" headers="mcps1.3.3.2.4.2.1.2.3.1.2 "><p id="functiongraph_01_2119__en-us_topic_0000001709351588_p17343131131110">Runtime of this function. It cannot be changed.</p>
</td>
</tr>
<tr id="functiongraph_01_2119__en-us_topic_0000001709351588_row63990241263"><td class="cellrowborder" valign="top" width="24.34%" headers="mcps1.3.3.2.4.2.1.2.3.1.1 "><p id="functiongraph_01_2119__en-us_topic_0000001709351588_p240014241662">Type</p>
</td>
<td class="cellrowborder" valign="top" width="75.66000000000001%" headers="mcps1.3.3.2.4.2.1.2.3.1.2 "><p id="functiongraph_01_2119__en-us_topic_0000001709351588_p1540032419615">Add a <strong id="functiongraph_01_2119__en-us_topic_0000001709351588_b19648660942228">Public</strong> or <strong id="functiongraph_01_2119__en-us_topic_0000001709351588_b17589648962228">Private</strong> dependency.</p>
</td>
</tr>
<tr id="functiongraph_01_2119__en-us_topic_0000001709351588_row1240015241562"><td class="cellrowborder" valign="top" width="24.34%" headers="mcps1.3.3.2.4.2.1.2.3.1.1 "><p id="functiongraph_01_2119__en-us_topic_0000001709351588_p14400102416616">Name</p>
</td>
<td class="cellrowborder" valign="top" width="75.66000000000001%" headers="mcps1.3.3.2.4.2.1.2.3.1.2 "><p id="functiongraph_01_2119__en-us_topic_0000001709351588_p440010249615">Select a dependency.</p>
</td>
</tr>
<tr id="functiongraph_01_2119__en-us_topic_0000001709351588_row8400824465"><td class="cellrowborder" valign="top" width="24.34%" headers="mcps1.3.3.2.4.2.1.2.3.1.1 "><p id="functiongraph_01_2119__en-us_topic_0000001709351588_p7400824062">Version</p>
</td>
<td class="cellrowborder" valign="top" width="75.66000000000001%" headers="mcps1.3.3.2.4.2.1.2.3.1.2 "><p id="functiongraph_01_2119__en-us_topic_0000001709351588_p19400724861">Select a version to be added.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="p" id="functiongraph_01_2119__en-us_topic_0000001709351588_p949552661"><div class="note" id="functiongraph_01_2119__en-us_topic_0000001709351588_note31061402612"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="functiongraph_01_2119__en-us_topic_0000001709351588_ul141061201169"><li id="functiongraph_01_2119__en-us_topic_0000001709351588_li81061401363">You can add a maximum of 20 dependencies for a function.</li><li id="functiongraph_01_2119__en-us_topic_0000001709351588_li14106150067">Except your private dependencies, FunctionGraph provides some public dependencies, which you can choose when creating a function.</li></ul>
</div></div>
</div>
</p></li></ol>
</div>
<div class="section" id="functiongraph_01_2119__en-us_topic_0000001709351588_section149110214920"><h4 class="sectiontitle">Deleting a Dependency</h4><p id="functiongraph_01_2119__en-us_topic_0000001709351588_p818033185916">To delete a dependency, just delete all of its versions.</p>
<ol id="functiongraph_01_2119__en-us_topic_0000001709351588_ol994085815564"><li id="functiongraph_01_2119__en-us_topic_0000001709351588_li994075813561"><span>Return to the FunctionGraph console, and choose <strong id="functiongraph_01_2119__en-us_topic_0000001709351588_b7013771922228">Functions</strong> &gt; <strong id="functiongraph_01_2119__en-us_topic_0000001709351588_b20083296392228">Dependencies</strong> in the navigation pane.</span></li><li id="functiongraph_01_2119__en-us_topic_0000001709351588_li74011657141112"><span>Click the name of the target dependency to go to the <strong id="functiongraph_01_2119__en-us_topic_0000001709351588_b9628155502228">Versions</strong> page.</span></li><li id="functiongraph_01_2119__en-us_topic_0000001709351588_li7161317161717"><span>Click the delete icon in the row of a version. Repeat this operation if the dependency has multiple versions.</span><p><div class="fignone" id="functiongraph_01_2119__en-us_topic_0000001709351588_fig16313420339"><span class="figcap"><b>Figure 1 </b>Deleting a dependency version</span><br><span><img id="functiongraph_01_2119__en-us_topic_0000001709351588_image11631734153314" src="en-us_image_0000001757072025.png"></span></div>
<div class="note" id="functiongraph_01_2119__en-us_topic_0000001709351588_note580643072715"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="functiongraph_01_2119__en-us_topic_0000001709351588_p58061330202719">Dependencies referenced by functions cannot be deleted.</p>
</div></div>
</p></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="functiongraph_01_0391.html">Dependency Management</a></div>
</div>
</div>