Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
Huawei Cloud Astro Canvas
Huawei Cloud Astro Zero
CodeArts Governance
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance (CCI)
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Cloud Transformation
Well-Architected Framework
Cloud Adoption Framework
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Preparing an Environment

Updated on 2025-03-13 GMT+08:00

This section uses a Linux host as an example to describe how to set up a function CI/CD environment using KooCLI and DevCloud.

ECS

This server functions as a DevCloud task deployment host to deploy and update FunctionGraph functions.

  • Specifications: 1 vCPU | 1 GiB
  • Image: CentOS 8.2 64 bits
  • Other: Configure an EIP because you will need to install the Python library and DevCloud and configure the ECS as a deployment host.
  • DevCloud uses this server as a deployment host through port 22 over SSH. For high security, add the following IP addresses to the security group of the server. Otherwise, authorization will fail.

    42.202.130.147

    49.4.3.11

    122.112.212.206

    139.159.226.153

    49.4.85.127

    124.70.46.237

Configuring a Security Group for the Deployment Host

  1. Log in to the ECS console. In the navigation pane, choose Security Group to go to the network console.
  2. In the navigation pane of the network console, choose Access Control > IP Address Groups. Click Create IP Address Group, set parameters shown in Figure 1, and click OK.
    Figure 1 Creating an IP address group
    • Name: Enter ipGroup-clouddeploy.
    • IP Address:
      42.202.130.147
      49.4.3.11
      122.112.212.206
      139.159.226.153
      49.4.85.127
      124.70.46.237
  3. In the navigation pane, choose Access Control > Security Groups. Click Create Security Group, set parameters shown in Figure 2, and click OK.
    Figure 2 Configuring a security group
    • Name: Enter functions-deploy.
    • Enterprise Project: Enter default.
    • Template: Select Custom.
  4. Go to the details page of functions-deploy, click the Inbound Rules tab, and click Add Rule to add an inbound rule.
    Figure 3 Adding a rule

    Set Priority to 1, Protocol & Port to 22, and Source to the IP address group ipGroup-clouddeploy. Then click OK.

    Figure 4 Adding an inbound rule
  5. Return to the ECS console, click the ECS name, and change the security group to functions-deploy.

Installing Python Libraries

Run the following commands to install the pyyaml and pycryptodome libraries: The two libraries will respectively parse the cam.yaml configuration file of your function and encrypts and decrypts the function's environment variables.

pip3 install pyyaml
pip3 install pycryptodome

Installing KooCLI

  1. Install KooCLI.

    Remotely log in to the purchased ECS, and run the following command to install KooCLI:

    curl -sSL https://ap-southeast-3-hwcloudcli.obs.ap-southeast-3.myhuaweicloud.com/cli/latest/hcloud_install.sh -o ./hcloud_install.sh && bash ./hcloud_install.sh
    Figure 5 Installing KooCLI
  1. Initialize KooCLI.

    Run the following command to initialize KooCLI:

    hcloud configure init

    Enter an access key ID (AK), secret access key (SK), and region name. For details about how to obtain them, see 3 and 4.

    Figure 6 Initializing KooCLI
  2. Obtain an access key (AK/SK).
    • If you have access to the console, log in, and create an access key on the My Credentials page. For details, see Creating an Access Key. An AK/SK file is downloaded. Generally, it is named credentials.csv. As shown in the following figure, the file contains a username, AK, and SK.
      Figure 7 Content of the credentials.csv file
    • If you do not have access to the console, request the administrator to create an access key for you on the IAM console in case your access key is lost or needs to be reset. For details, see Managing Access Keys for an IAM User.
  3. Obtain a region name.
    For details, see Regions and Endpoints.
    Figure 8 Obtaining region information

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback