|

|  How to Integrate SAP Leonardo with CircleCI

How to Integrate SAP Leonardo with CircleCI

January 24, 2025

Discover how to seamlessly integrate SAP Leonardo with CircleCI, enhancing your workflow with automation and intelligent technologies in this step-by-step guide.

How to Connect SAP Leonardo to CircleCI: a Simple Guide

 

Prerequisites

 

  • Ensure you have a SAP Leonardo account set up with appropriate APIs enabled.
  •  

  • Sign up for a CircleCI account if you haven't already.
  •  

  • Install Node.js and npm on your local machine to run scripts locally if needed.

 

Step 1: Configuring SAP Leonardo API Access

 

  • Log into your SAP Leonardo account and navigate to the API section.
  •  

  • Generate an API key that CircleCI will use to communicate with SAP Leonardo.
  •  

  • Note down the API endpoint URL that you will interact with from CircleCI.

 

Step 2: Create a New CircleCI Project

 

  • Log into CircleCI and click on the "Add Projects" tab.
  •  

  • Select the repository where your SAP Leonardo integration code resides.
  •  

  • Follow the prompts to set up a new CircleCI project pipeline for your repository.

 

Step 3: Add Environment Variables in CircleCI

 

  • Navigate to your project settings in CircleCI.
  •  

  • Under "Environment Variables," add your SAP Leonardo API key and any other necessary credentials.
  •  

  • Example: Set a variable named SAP_API_KEY with your actual API key.

 

Step 4: Create a CircleCI Configuration File

 

  • Create a .circleci folder in the root of your repository.
  •  

  • Within this folder, create a config.yml file.
  •  

  • Copy and adapt the following basic configuration to suit your project needs:

 

version: 2.1

jobs:
  build:
    docker:
      - image: circleci/node:latest
    steps:
      - checkout
      - run:
          name: Install Dependencies
          command: npm install
      - run:
          name: Run Tests
          command: npm test
      - run:
          name: Deploy to SAP Leonardo
          command: |
            curl -X POST \
            https://api.sap.com/your-endpoint \
            -H "Authorization: Bearer $SAP_API_KEY" \
            -H "Content-Type: application/json" \
            -d @data.json

workflows:
  version: 2
  build-deploy:
    jobs:
      - build

 

Step 5: Test the Integration

 

  • Commit and push your updated configuration file to the repository.
  •  

  • Check CircleCI's dashboard to ensure your pipeline runs as expected.
  •  

  • Monitor logs for any errors during the API interaction phase with SAP Leonardo.

 

Step 6: Troubleshooting Common Issues

 

  • Ensure your API key is correctly set up and corresponds to the environment you're querying or updating.
  •  

  • Check CORS settings if you encounter issues with cross-origin requests.
  •  

  • Review CircleCI build logs for any errors related to Node.js dependencies and correct them accordingly.

 

Omi Necklace

The #1 Open Source AI necklace: Experiment with how you capture and manage conversations.

Build and test with your own Omi Dev Kit 2.

How to Use SAP Leonardo with CircleCI: Usecases

 

Automating Advanced Analytics and Deployment

 

  • SAP Leonardo is used to build and enhance machine learning models for predictive analytics purposes. These models are developed to process and analyze business data efficiently.
  •  

  • CircleCI is chosen to streamline the continuous integration and continuous delivery (CI/CD) pipeline, automating the deployment of machine learning models created with SAP Leonardo into production environments.

 

Integration of SAP Leonardo and CircleCI

 

  • Connect SAP Leonardo's Machine Learning API with CircleCI using webhooks to trigger deployment pipelines after model development.
  •  

  • Utilize custom scripts in CircleCI to automatically fetch the latest machine learning models and datasets from SAP Leonardo, ensuring the models used in production are up-to-date.

 

Benefits and Features

 

  • This integration enables automatic updates of machine learning models without manual intervention, reducing downtime and errors in production.
  •  

  • Facilitates easy rollback functionality in CircleCI, allowing developers to revert to previous versions of machine learning models if any issues occur.

 

Sample Script to Fetch SAP Leonardo Models

 


version: 2.1

jobs:
  fetch_ml_model:
    docker:
      - image: circleci/python:3.8
    steps:
      - checkout
      - run:
          name: Fetch ML Model
          command: |
            curl -X GET "https://api.sapleonardo.com/ml/model" \
                 -H "accept: application/json" \
                 -H "authorization: Bearer $SAP_LEONARDO_API_KEY" \
                 -o model.json

workflows:
  version: 2
  deploy_ml_model:
    jobs:
      - fetch_ml_model

 

 

Smart IoT Solutions Deployment

 

  • SAP Leonardo is leveraged for its IoT capabilities, enabling businesses to gather and analyze data from various connected devices to drive intelligent operations.
  •  

  • CircleCI is employed to manage the CI/CD pipeline, ensuring rapid deployment of IoT solutions and updates developed through SAP Leonardo, thus facilitating seamless integration and scaling of IoT applications.

 

Integration Workflow of SAP Leonardo and CircleCI

 

  • Configure CircleCI to trigger builds and deployments when changes are made to IoT application configurations or SAP Leonardo models, employing webhooks for real-time pipeline initiation.
  •  

  • Implement environment variables within CircleCI to securely handle API keys and sensitive information required to interact with SAP Leonardo's IoT services.

 

Advantages and Functionalities

 

  • This unified approach accelerates the deployment cycle of IoT applications, ensuring that the most efficient versions are always running, which enhances business agility and operational intelligence.
  •  

  • CircleCI facilitates automated testing of IoT applications, verifying that all components interact perfectly with SAP Leonardo's edge computing and analytics functionalities before going live.

 

Example CircleCI Configuration for IoT Application Deployment

 

version: 2.1

jobs:
  deploy_iot_application:
    docker:
      - image: circleci/node:12.18
    steps:
      - checkout
      - run:
          name: Deploy IoT Application
          command: |
            npm install
            npm test
            curl -X POST "https://api.sapleonardo.com/iot/deploy" \
                 -H "Content-Type: application/json" \
                 -H "Authorization: Bearer $SAP_LEONARDO_API_KEY" \
                 --data-binary @deployment-config.json

workflows:
  version: 2
  iot_deployment:
    jobs:
      - deploy_iot_application

 

Omi App

Fully Open-Source AI wearable app: build and use reminders, meeting summaries, task suggestions and more. All in one simple app.

Github →

Order Friend Dev Kit

Open-source AI wearable
Build using the power of recall

Order Now

Troubleshooting SAP Leonardo and CircleCI Integration

How to configure CircleCI to deploy SAP Leonardo applications?

 

Setup CircleCI for SAP Leonardo Deployment

 

  • Begin by creating a .circleci/config.yml file in your repository. This file will define your build and deployment pipeline.
  •  

  • Ensure your application repository is linked to CircleCI. You can integrate via GitHub or Bitbucket.

 

Define the Workflow

 

  • In the config.yml, define jobs for building and deploying your SAP Leonardo application. Use Docker images that align with your app's requirements.
  •  

  • Leverage environment variables for SAP credentials and endpoints. Configure securely through the CircleCI dashboard under Project Settings > Environment Variables.

 

Example Configuration

 

version: 2.1
jobs:
  build:
    docker:
      - image: circleci/python:3.8
    steps:
      - checkout
      - run: pip install -r requirements.txt
  deploy:
    docker:
      - image: your-docker-image
    steps:
      - run: |
          export SAP_CREDENTIALS=$SAP_CREDENTIALS
          deploy-to-sap-leonardo --app my-app
workflows:
  version: 2
  build-and-deploy:
    jobs:
      - build
      - deploy:
          requires:
            - build

 

Continuous Deployment

 

  • Ensure your deployment job is conditional, executing only on specific branches (e.g., main or release).
  •  

  • Monitor your deployments in the CircleCI dashboard and set up notifications for pipeline results.

 

Why is my CircleCI build failing with SAP Leonardo integration?

 

Check Log Outputs

 

  • Examine CircleCI logs to identify specific error messages related to SAP Leonardo.
  • Use insights from the logs to pinpoint integration issues or configuration errors.

 

Verify Environment Variables

 

  • Ensure SAP Leonardo credentials and API keys are correctly set in CircleCI environment variables.
  • Incorrect or missing variables can lead to authentication failures.

 

Inspect YAML Configuration

 

  • Ensure the `.circleci/config.yml` file includes correct steps and required tools for the SAP Leonardo integration.
  • Double-check dependencies and their versions for compatibility issues.

 


version: 2.1

executors:
  default:
    docker:
      - image: circleci/node:14

jobs:
  deploy:
    steps:
      - checkout
      - run: npm install
      - run: npm test

 

Resource Limitations

 

  • CircleCI may face resource limits affecting build success. Check for sufficient memory or CPU allocations.
  • Optimize the build or request more resources if needed.

 

How do I set environment variables for SAP Leonardo in CircleCI?

 

Set Environment Variables for SAP Leonardo in CircleCI

 

  • Start by navigating to your project on the CircleCI dashboard. Click on "Project Settings" from the left-hand menu.
  •  

  • Select "Environment Variables" under the "Build Settings" section.
  •  

  • Click on the "Add Variable" button to add a new environment variable.
  •  

  • For a connection with SAP Leonardo, you might need variables such as SAP_LEONARDO_API_KEY and SAP_LEONARDO_BASE_URL.
  •  

  • Enter your variable key and value, then click on the "Add Variable" button to save your changes securely.

 

version: 2.1

jobs:
  build:
    docker:
      - image: circleci/python:3.8
    steps:
      - checkout
      - run:
          name: Access SAP Leonardo
          command: |
            echo "API Key: $SAP_LEONARDO_API_KEY"
            echo "Base URL: $SAP_LEONARDO_BASE_URL"

 

Don’t let questions slow you down—experience true productivity with the AI Necklace. With Omi, you can have the power of AI wherever you go—summarize ideas, get reminders, and prep for your next project effortlessly.

Order Now

Join the #1 open-source AI wearable community

Build faster and better with 3900+ community members on Omi Discord

Participate in hackathons to expand the Omi platform and win prizes

Participate in hackathons to expand the Omi platform and win prizes

Get cash bounties, free Omi devices and priority access by taking part in community activities

Join our Discord → 

OMI NECKLACE + OMI APP
First & only open-source AI wearable platform

a person looks into the phone with an app for AI Necklace, looking at notes Friend AI Wearable recorded a person looks into the phone with an app for AI Necklace, looking at notes Friend AI Wearable recorded
a person looks into the phone with an app for AI Necklace, looking at notes Friend AI Wearable recorded a person looks into the phone with an app for AI Necklace, looking at notes Friend AI Wearable recorded
online meeting with AI Wearable, showcasing how it works and helps online meeting with AI Wearable, showcasing how it works and helps
online meeting with AI Wearable, showcasing how it works and helps online meeting with AI Wearable, showcasing how it works and helps
App for Friend AI Necklace, showing notes and topics AI Necklace recorded App for Friend AI Necklace, showing notes and topics AI Necklace recorded
App for Friend AI Necklace, showing notes and topics AI Necklace recorded App for Friend AI Necklace, showing notes and topics AI Necklace recorded

OMI NECKLACE: DEV KIT
Order your Omi Dev Kit 2 now and create your use cases

Omi Dev Kit 2

Endless customization

OMI DEV KIT 2

$69.99

Make your life more fun with your AI wearable clone. It gives you thoughts, personalized feedback and becomes your second brain to discuss your thoughts and feelings. Available on iOS and Android.

Your Omi will seamlessly sync with your existing omi persona, giving you a full clone of yourself – with limitless potential for use cases:

  • Real-time conversation transcription and processing;
  • Develop your own use cases for fun and productivity;
  • Hundreds of community apps to make use of your Omi Persona and conversations.

Learn more

Omi Dev Kit 2: build at a new level

Key Specs

OMI DEV KIT

OMI DEV KIT 2

Microphone

Yes

Yes

Battery

4 days (250mAH)

2 days (250mAH)

On-board memory (works without phone)

No

Yes

Speaker

No

Yes

Programmable button

No

Yes

Estimated Delivery 

-

1 week

What people say

“Helping with MEMORY,

COMMUNICATION

with business/life partner,

capturing IDEAS, and solving for

a hearing CHALLENGE."

Nathan Sudds

“I wish I had this device

last summer

to RECORD

A CONVERSATION."

Chris Y.

“Fixed my ADHD and

helped me stay

organized."

David Nigh

OMI NECKLACE: DEV KIT
Take your brain to the next level

LATEST NEWS
Follow and be first in the know

Latest news
FOLLOW AND BE FIRST IN THE KNOW

thought to action

team@basedhardware.com

company

careers

events

invest

privacy

products

omi

omi dev kit

personas

resources

apps

bounties

affiliate

docs

github

help