1_SimpleStart.py
based on the instructions in Preparation.1_SimpleStart.py
in an editor.# custom (Change to your info)imageId = "img-m4q71qnf"Application = {"DeliveryForm": "LOCAL","Command": " python -c \\"fib=lambda n:1 if n<=2 else fib(n-1)+fib(n-2); print(fib(20))\\" "}StdoutRedirectPath = "your cos path"StderrRedirectPath = "your cos path"
Application
in the general part is described in Preparation. Set the parameters of Application
based on the following table.Configuration Item | Description |
DeliveryForm | Three methods are available for delivering an application: software packaging, container image, and direct running within a CVM instance. LOCAL indicates direct running within a CVM instance. |
Command: | The command for starting a job. In this example, a Python script is executed. Starting from 1, the script adds up the first 20 numbers of the Fibonacci sequence and outputs the result to StdOutput. |
python 1_SimpleStart.py
{"RequestId": "393292f4-5583-48ad-a9f5-f673138ea637","JobId": "job-o0xxxxxq7"}
$ tccli batch DescribeJob --version 2017-03-12 --JobId job-xxx
{"EndTime": "2019-10-08T04:06:58Z","JobState": "SUCCEED","TaskInstanceMetrics": {...},"Zone": "ap-guangzhou-2","TaskMetrics": {...},"JobName": "TestJob","Priority": 1,"RequestId": "7a5f4c94-1357-486c-9c48-8286ba01b5b2","TaskSet": [...],"StateReason": null,"JobId": "job-o0xxxxxq7","DependenceSet": [],"CreateTime": "2019-10-08T04:05:54Z"}
6765
/bin/sh: -c: line 0: syntax error near unexpected token `('/bin/sh: -c: line 0: ` python -c \\"fib=lambda n:1 if n<=2 else fib(n-1)+fib(n-2); print(fib(20))\\" '
Was this page helpful?