Basic Functionality

Solution Name: sample_project_basic

This solution demonstrates the use of jobs, services and databases, through the following components:

  • sample_job - a component of type “job” that implements a counter which counts down from the number provided as input

  • sample_database - a component of type “database” (MySQL database)

  • sample_service - a component of type “service” that echoes the name of the component when a GET request is made to it

How to use this solution

You will work on a clone of this solution. The steps to be followed are:

  1. Clone the solution. Cloning a solution does not clone its code, so you need to do this manually (Steps 2-4 below)

  2. Clone the code repository of the sample solution

    1. Navigate to the code repository of the sample solution

    2. Click “Clone” and copy the git clone command

    3. Execute the command on your machine (ensure you have Git installed)

  3. Clone the code repository of the cloned solution

    1. Navigate to the code repository of the cloned solution

    2. Click “Clone” and copy the git clone command

    3. Execute the command on your machine (ensure you have Git installed)

  4. Copy code from the sample solution into the cloned solution

  5. Commit and push the code back into the code repository of the cloned solution

    1. Execute git add -A to add the changed code to the local repository

    2. Execute git commit -m “Cloned code” to commit the code to the local repository

    3. Execute git push to push the code into Bitbucket

  6. Build the cloned solution components

    1. Select the “master” branch for each component during the build

  7. Deploy the components of the cloned solution:

    1. For sample_job, specify the following deployment parameters:

      1. Build Version = latest build version

      2. Advanced Settings - Args = number of seconds you want the job to count (e.g., 100)

    2. For sample_database, specify the following deployment parameters:

      1. Build Version = <Latest Build Version>

      2. Advanced Settings (Environment Variables) - name = MYSQL_ROOT_PASSWORD, value = <any password of your choice>)

      3. Advanced Settings (Ports) - name = default, value = 3306

    3. For sample_service, specify the following deployment parameters:

      1. Build Version = <Latest Build Version>

      2. Advanced Settings (Ports) - name = default, value = 5000

  8. Test the components (the database and service might take a few minutes to get deployed):

    1. Note down the URLs output for the sample_service and sample_database components

    2. To test the sample_job, open the Kubernetes dashboard, navigate to the pod for the sample_job and view its logs. When the job completes, you should see the counts from the number you specified, counting down to 0

    3. To test the sample_database, use a database tool (like Toad, or MySQL Manager) to connect to the URL you got in Step 8a. Use the user ID root and the password you specified during deployment to connect to the database. You should see a database called “reporting” with some tables in it.

    4. To test the sample_service, click on the URL you got in Step 8a for the service. You should see a “Hello” message specifying the name of the component (“sample_service”)