Updated on 2025-01-17 GMT+08:00

Installing obsutil

If software package deployment is not involved, skip this section.

Prerequisites

  • Obtain the AK/SK. For details, see Obtaining the AK/SK.
  • You have obtained the endpoint of the region where CAE is deployed. For details, see Regions and Endpoints.
  • You have created a bucket in OBS in the same region as CAE where the component is deployed to store software packages. For details, see Creating a Bucket. In this example, the bucket name is cae-obs.

Download and Installation

  • Select an operating system (OS):

    Before downloading and installing Jenkins, run the following command on the VM where Jenkins is located to check the VM OS type:

    echo $HOSTTYPE
    • If the command output is x86_64, download the AMD 64-bit OS.
    • If the command output is aarch64, download the Arm 64-bit OS.
  • The obsutil tool is used to upload the software package to OBS after building. For details, see Downloading and Installing obsutil.

Initial Configurations

Run the following command to initialize obsutil:
{path}/obsutil config -i=ak -k=sk -e={endpoint}
where,
  • {path} is the obsutil installation path, for example, /root/tools/obsutil/obsutil_linux_amd64_5.4.6.
  • {endpoint} is the obtained endpoint of the region where CAE is deployed.

Verifying That obsutil Can Be Used to Upload Files to OBS

  1. Create a test file. For example, test.txt.

    touch test.txt

  2. Use obsutil to upload the file to OBS.

    ~/tools/obsutil/obsutil_linux_amd64_5.4.6/obsutil cp test.txt obs://{OBS bucket name}

    Replace {OBS bucket name} with the name of the OBS bucket to be used. In this example, the bucket name is cae-obs. Upload the test.txt file created in the current directory to the cae-obs bucket. If "Upload successfully" is displayed, the upload is successful.

    Figure 1 Uploading a file to OBS

  3. Log in to OBS and choose Object Storage.
  4. Click bucket cae-obs. On the Objects page, view the uploaded file test.txt.