2_RemoteCodePkg.py
based on the instructions in Preparation.2_RemoteCodePkg.py
file in an editor.# custom (Change to your info)imageId = "img-m4q71qnf"Application = {"DeliveryForm": "PACKAGE","Command": "python ./codepkg/fib.py","PackagePath": "http://batchdemo-xxxxxxxxx.cos.ap-guangzhou.myqcloud.com/codepkg/codepkg.tgz"}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 delivery methods of applications are available: software packaging, container image, and direct running within the CVM. In this case, PACKAGE indicates software packaging. |
PackagePath | Address of the .tgz software package in HTTP. Batch downloads the software package to a directory of the scheduled CVM and runs `Command` in the directory. |
Command | Task startup command. In this case, a Python script file in the software package is directly called. You can download the package, and view the file structure and content in it. |
fib.py
is composed as below:fib = lambda n:1 if n<=2 else fib(n-1)+fib(n-2)print("Remote Code Package : %d"%(fib(20)))
python 2_RemoteCodePkg.py
{"RequestId": "c09e9291-2661-xxxx-8783-72d36f91ec8a","JobId": "job-7xxxx26l"}
2_RemoteCodePkg.py
is as follows:Remote Code Package : 6765
Was this page helpful?