Setting up your watsonx Code Assistant for Red Hat Ansible Lightspeed service in IBM Cloud
Red Hat Ansible Lightspeed
Set up your IBM Cloud service instance of watsonx Code Assistant for Red Hat Ansible Lightspeed so you can use it with your full installation of Red Hat Ansible Lightspeed.
Before you begin
-
Make sure you have an IBM Cloud account.
-
Provision an instance of watsonx Code Assistant through the IBM Cloud catalog page or by working with an IBM sales representative.
When you finish provisioning your instance, click Setup to open an onboarding checklist page to help you configure the instance. Or, you can select Administration and then Setup to access this onboarding checklist.
Items in that checklist correspond to each of the following steps. Click the action arrows on the checklist page that are associated with each item to complete the steps.
Create a service ID and API key
You use this API key later to enable Visual Studio Code to communicate with watsonx Code Assistant.
-
On the Service IDs page, click Create.
-
Enter
IBM watsonx Code Assistant user
as the name for your service ID. Optionally, enter a description. -
Click Create.
You are redirected to the dashboard for your service ID, which includes tabs for Access and API keys.
-
Click the API keys tab.
-
Click Create.
-
Enter
IBM watsonx Code Assistant API key
as the name for your API key. Optionally, enter a description. -
Click Create.
-
Click Download or Copy and store the API key in a safe location.
The key is only available for 296 seconds. Make sure to store it somewhere you can find it later.
Create a deployment space and model ID
The deployment space is the serving environment for watsonx Code Assistant. The model ID determines which model generates code recommendations in the Ansible extension for Visual Studio Code.
-
In your watsonx Code Assistant instance, click the Navigation Menu icon , then select Deployments.
-
Click New deployment space.
-
Enter
Code Assistant Models
as the name for your deployment space. Optionally, enter a description. -
In Code assistant service, select your instance name.
-
Click Create.
-
A status window appears. After the space is created, click Close.
-
Copy your model ID. After you create the deployment space, your model ID is provided in a field after the Create a deployment space checklist item. Copy this ID and store it in a safe location as you need to add it to the Red Hat Ansible Lightspeed Admin portal in a later step.
Add the service ID to the deployment space
Enable the API to connect to your deployment space.
-
On the Manage tab of your deployment space, click Access control.
-
Click Add collaborators and select Add service IDs from the menu.
A list of service IDs that are associated with your account appears.
-
Click the checkbox for the IBM watsonx Code Assistant user service ID that you created, and select Editor for the role.
-
Click Add.
The service ID is added to the list of collaborators.
Configure Red Hat Ansible Lightspeed to connect with watsonx Code Assistant
Add the API key and the model ID to the Red Hat Ansible Lightspeed Admin Portal to connect watsonx Code Assistant with the Ansible extension for Visual Studio Code. Follow the onboarding checklist and the instructions from Red Hat.
To add the API key and model ID to the Red Hat Ansible Lightspeed Admin Portal, see Configuring Red Hat Ansible Lightspeed cloud service in the Red Hat documentation.
Add the instance to a project
Standard plan
If you purchased a Standard plan, you can tune the IBM base code model with your own data so that it generates code suggestions that are customized for your organizational context. All your assets are stored in a project, including your uploaded data and tuned models. After you create a project, you can work with data and other resources to tune models.
-
In your watsonx Code Assistant instance, click the Navigation Menu icon , then select Projects.
-
Click New project.
-
Enter a meaningful name and description for your project so you can easily identify it.
-
Click Create.
-
In the new project, click the Manage tab, then select Services & integrations.
-
Click Associate service.
-
Select your instance, then click Associate.
You're now ready to create a tuning experiment to tune the IBM base code model with your own data. For more information, see Tuning the IBM base code model for watsonx Code Assistant for Red Hat Ansible Lightspeed.
Set up your network
To ensure that your developers can connect the IDE extension or plugin, you need to allow access to IBM Cloud URLs. Make sure your organization's network allows access to:
https://iam.cloud.ibm.com/
https://api.dataplatform.cloud.ibm.com/
Next steps
See Installing and configuring the Ansible VS Code extension to install and configure the Ansible extension for Visual Studio Code and start generating code recommendations.