CodexBloom - Programming Q&A Platform

OCI Data Science SDK - scenarios When Creating Workspace with Custom Configuration

👀 Views: 47 đŸ’Ŧ Answers: 1 📅 Created: 2025-08-24
OCI Data Science Python SDK Python

I'm having trouble with I've been banging my head against this for hours. I'm optimizing some code but I'm collaborating on a project where I'm trying to create a new workspace in Oracle Cloud Infrastructure (OCI) Data Science using the OCI Python SDK (version 2.29.0), but I keep running into an behavior related to my custom configuration... The code I have written looks like this: ```python import oci from oci.data_science import DataScienceClient config = oci.config.from_file() # Load OCI configuration client = DataScienceClient(config) workspace_details = { 'compartment_id': 'your_compartment_id', 'display_name': 'My Workspace', 'description': 'Workspace for data science projects', 'freeform_tags': { 'project': 'ML_Research', 'environment': 'development' }, 'custom_configuration': { 'cpu_count': 4, 'memory_size_in_gbs': 16, 'gpu_count': 1, 'software_version': 'latest' } } try: response = client.create_workspace(workspace_details) print('Workspace created:', response.data.id) except Exception as e: print('behavior creating workspace:', e) ``` When I run this code, I get the following behavior message: ``` oci.exceptions.ServiceError: (400) Invalid value for `custom_configuration`: Invalid custom configuration parameters. Please ensure parameters meet service specifications. ``` I double-checked the values in my `custom_configuration` dictionary, but I need to find anything obviously wrong. I've also consulted the OCI Data Science documentation, and it mentions that the `custom_configuration` should be a valid dictionary of parameters as shown in the examples. I've tried removing the `custom_configuration` key altogether, which allowed the workspace to be created with default settings, so it seems to be the cause of the scenario. Could anyone provide insights into what might be going wrong with my custom configuration? Are there specific values or formats that I need to adhere to that I might be missing? Any help would be greatly appreciated! I'd really appreciate any guidance on this. Thanks, I really appreciate it! For reference, this is a production application. I'd be grateful for any help.