Setting up your watsonx Code Assistant for Z service in IBM Cloud
watsonx Code Assistant for Z
Set up your IBM Cloud service instance of watsonx Code Assistant for Z so you can use it with your full installation of the product.
Before you begin
-
Make sure that 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.
-
Download the most recent
IBM watsonx Code Assistant for Z Multiplatform Multilingual eAssembly
from IBM Passport Advantage.
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 can 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.
Although watsonx Code Assistant supports allowing multiple users to share the API key for the Service ID, the best practice is for each user to have their own API key. For more information about adding users to your instance, see Managing IAM access for watsonx Code Assistant for Z.
Create a deployment space
The deployment space is the serving environment for watsonx Code Assistant.
-
In your watsonx Code Assistant instance, click the Navigation Menu icon , then select Deployments.
-
Click New deployment space.
-
Enter
Code Assistant
as the name for your deployment space. Optionally, enter a description. -
In Code assistant service, select your instance.
-
Click Create.
-
A status window appears. After the space is created, click Close.
Add the service ID as a space collaborator
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.
Sign up for Db2
Watsonx Code Assistant for Z uses Db2 to store code input and output. If you don't already have an instance of Db2, IBM Cloud can help you create one that is optimized for watsonx Code Assistant for Z.
-
Select a region from the list of available regions.
-
Review the preselected Db2 pricing plan.
-
Click Create.
Add the Db2 connection to your space
Enable the deployment space to send and retrieve code from Db2 storage.
-
On the Assets tab of your deployment space, click Import assets.
-
Click Data access, then click Connection.
-
In Add connection, select the IBM DB2 on Cloud connector, then click Next.
-
Click the Select instance button.
-
In Select service, select your Db2 service instance, and then click Select.
Information from your service instance is added to the connection overview, details, credentials, and certificates.
-
Click Create.
If you did not set a location and sovereignty, a window appears where you can confirm that you want to create the connection without setting these values. To accept, click Create. If you need to set the values, click Cancel and select Location and sovereignty.
If your database is on another IBM Cloud account, or if the automated population fails, see Why can't I connect watsonx Code Assistant for Z to my Db2 database?.
Set up the Db2 database
After watsonx Code Assistant for Z is set up in IBM Cloud, the Db2 administrator needs to configure the database by loading the provided script.
To locate the script files:
-
Use IBM Passport Advantage to download either:
- The most recent
IBM watsonx Code Assistant for Z Multiplatform Multilingual eAssembly
- Or the most recent individual image of
IBM watsonx Code Assistant Developer Tools Multilingual
- The most recent
-
Open the
IBM watsonx Code Assistant Developer Tools Multilingual
image.(The compressed file name is similar to this example:
IwCAfZ2e0_2.0_ML.zip
.) -
In the
IBM watsonx Code Assistant Developer Tools Multilingual
folder, open the compressed file with the name similar to this example:watsonx_Code_Assistant-for_Z-2.0.0.zip
. -
Locate these files in the resulting folder:
adscan_DB2oC_CreateObjects.sql
adscan_DB2oC_DeleteObjects.sql
To configure Db2:
-
In the IBM Db2 SaaS console, click the Run SQL icon.
-
Click the plus (+) tab to add a script.
-
If you already have an initialized database from a previous version of watsonx Code Assistant for Z, you need first clean up the old database. Click From file and browse to select
adscan_DB2oC_DeleteObjects.sql
, then click Run all to delete the schema and tables.The
adscan_DB2oC_DeleteObjects.sql
script is a sample. Depending on the state of the database, more or fewer steps might be required to completely reset the database. Contact your Db2 Administrator for assistance when you run the script. -
To initialize a new database, click From file and browse to select
adscan_DB2oC_CreateObjects.sql
. -
Click Run all to create the schema and tables.
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
You deployed and connected your IBM Cloud components to your provisioned watsonx Code Assistant instance. You're ready to take your next steps and integrate with your IBM Z Open Editor in Visual Studio Code. For information, see Set up a development environment.