Skip to content

Add Oracle Cloud Infrastructure (OCI) as a provider - #7174

Open
gadgilrajeev wants to merge 5 commits into
GoogleCloudPlatform:masterfrom
gadgilrajeev:oci-provider
Open

gadgilrajeev wants to merge 5 commits into
GoogleCloudPlatform:masterfrom
gadgilrajeev:oci-provider

Conversation

@gadgilrajeev

Copy link
Copy Markdown
Contributor

Adds Oracle Cloud Infrastructure (OCI) as a PKB provider. This replaces #4061, which was closed because of conflicts with master; the provider has been reworked on top of current master and the unrelated docs/, bash_scripts/ and config_files/ changes from that PR are gone.

The provider drives the oci CLI, in the same style as the DigitalOcean and AliCloud providers.

What's supported

  • VMs: Ubuntu 22.04/24.04 and Oracle Linux 8/9 (--os_type=ubuntu2204|ubuntu2404|ol8|ol9). Platform images are resolved per OS and shape; --image also accepts an image display name or OCID. Flex shapes are sized with --oci_ocpus / --oci_memory_in_gbs. Also supports boot disk size, preemptible instances (--oci_preemptible) with interruption detection, fault/availability domain selection, start/stop, and resource metadata. Capacity and quota launch errors map to InsufficientCapacityCloudFailure / QuotaFailure.
  • Zones: --zone is an OCI region, optionally with an -ad-N suffix to choose an availability domain (e.g. us-ashburn-1-ad-2), similar to AWS zones. VMs in a region share one network.
  • Networking: VCN, internet gateway, default route and a regional subnet, with all traffic allowed inside the VCN. OciFirewall opens TCP/UDP ports and ICMP on the VCN's default security list. --oci_network_name reuses an existing VCN without modifying its security list.
  • Disks: block volumes with disk_type mapped to VPUs/GB (lower_cost, balanced, higher_performance, ultra_high_performance), overridable with --oci_vpus_per_gb. Paravirtualized (default) or iSCSI attachment at consistent device paths; striping works through the standard scratch disk strategies. Local NVMe disks are not supported yet.
  • Auth: uses the ~/.oci/config profile from --oci_profile (default DEFAULT) and --oci_compartment_id or the oci_cli_rc default.

Setup docs are in perfkitbenchmarker/providers/README.md, plus default config constants, a README example and a CHANGES entry.

Testing

  • New unit tests in tests/providers/oci/ (util, network/firewall, disk, VM): 106 tests, all passing with python -m unittest per file.
  • pyink (flags from CONTRIBUTING.md) and lint-diffs are clean for the changed files.
  • Full unit test suite: no new failures compared with master.

Example:

./pkb.py --cloud=OCI --benchmarks=iperf --machine_type=VM.Standard.E5.Flex \
    --oci_ocpus=2 --zone=us-ashburn-1 --os_type=ol9
Reworks the OCI provider from the oci-provider branch (originally proposed
in GoogleCloudPlatform#4061) on top of current master:

- VMs: launch via the oci CLI with Flex shape config (OCPUs/memory),
  boot volume size, preemptible instances, fault/availability domain
  selection, start/stop, interruption detection and resource metadata.
  Images are resolved per os_type (Ubuntu 22.04/24.04, Oracle Linux 8/9),
  by display name, or by OCID.
- Zones are OCI regions with an optional "-ad-N" availability domain
  suffix, e.g. us-ashburn-1-ad-2. VMs in a region share one VCN.
- Networking: VCN, internet gateway, default route and a regional subnet,
  with intra-VCN traffic allowed. OciFirewall opens TCP/UDP ports and ICMP
  on the VCN security list. --oci_network_name reuses an existing VCN
  without modifying it.
- Disks: block volumes with disk types mapped to VPUs/GB (lower_cost,
  balanced, higher_performance, ultra_high_performance), paravirtualized
  or iSCSI attachment at consistent device paths, and striping via the
  standard scratch disk strategies.
- Unit tests for util, network, firewall, disk and VM modules, plus docs
  and default config constants.
@gadgilrajeev

Copy link
Copy Markdown
Contributor Author

@s-deitz @anksena, reviving the OCI provider from #4061. You'd agreed in principle to accept it back then, but it ended up on the backburner after I closed that PR because of conflicts. I'd like to pick it up again now: this PR is rebuilt on current master, without the unrelated docs/scripts changes you flagged, and includes unit tests.

I'm happy to maintain the OCI provider going forward, so it won't be left for your team to keep working.

@s-deitz

s-deitz commented Nov 3, 2026

Copy link
Copy Markdown
Member

Thanks @gadgilrajeev. I appreciate the offer to maintain this provider. It has been quite some time. As a result, I've opened a new discussion internally to review the intent of this PR and will try to respond by next week.

Keep both the OCI and spanner_omni_cluster entries in CHANGES.next.md, and
switch the OCI tests to unittest.mock to match master's migration away from
the mock package.
@s-deitz

s-deitz commented Nov 17, 2026

Copy link
Copy Markdown
Member

Hi @gadgilrajeev - After internal discussion, I'd like to flag the OCI ToS. These ToS have certain clauses that restrict performance benchmarking on OCI. Do you have a contact at OCI? If so, we'd be happy to accept this PR if the ToS are changed.

@gadgilrajeev

Copy link
Copy Markdown
Contributor Author

Thanks @s-deitz, that’s a fair concern, and I appreciate the team taking the time to discuss it.

I’ll pursue this through Oracle’s partner channel at Oracle and ask whether they’d revise the benchmarking clause, or give PKB a written exemption, so OCI can be benchmarked the same way the other providers are. I’ll report back here once I hear from them. In the meantime I’ll keep this PR rebased on master so it’s ready to go.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants