Search code examples
cloudwebsphereibm-cloud

Where is the ouput of a Job accessible in IBM Cloud, when using Cloud Engine?


I'm learning to use IBM Cloud, particularly the Cloud Engine. My interest is in running jobs that I cannot run in my computer due to the time and memory needed per run.

I have followed the example presented here https://www.youtube.com/results?search_query=ibm+cloud+run+source+code to run source code and it all goes well.

The next thing that I have done is to try to run some simple python code, say

for i in range(10):
   print(i)

on the cloud. The code is located in a github repository that contains only a readme file and the source code itself, only those two lines to run as an experiment.

Inside the Cloud Engine, I make the appropriate changes to use that source code and then, I do the following:

  1. Select "Run your source code", providing the appropriate github repository.
  2. Select create "Job".
  3. When specifying the build details:

3.1. I configure the directions of the branches in the section "Source".

3.2. In "Strategy", I select Cloud Native Buildpack, since I do not have a Dockerfile.

3.3. In "Output", I select the proper names.

  1. When I click on "Create", all goes well.

Afterwards, I run my code, and I can see that it runs successfully, but then I do not know where to see the results. When I ran the example with the application, it was just as easy as in the video, but when using a Job, I cannot seem to find where the output goes.


Solution

  • You will need to switch on logging, then follow your application by running

    ibmcloud ce app logs -f --app <your app name>
    

    from the command line.

    Step 2 of this tutorial shows how to switch on logging for your project - https://developer.ibm.com/tutorials/mq-write-and-run-serverless-mq-applications/