Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

aybanda
Copy link

@aybanda aybanda commented Jul 12, 2025

Closes #201

Description

This PR adds a new Oracle Cloud Infrastructure (OCI) Linux template for provisioning Coder workspaces. The template includes compute instances, networking (VCN, subnet, internet gateway), and storage configuration as requested in issue #201.

Type of Change

  • New module
  • Bug fix
  • Feature/enhancement
  • Documentation
  • Other

Module Information

Path: registry/aybanda/templates/oci-linux
New version: v1.0.0
Breaking change: [ ] Yes [x] No

Testing & Validation

  • Tests pass (bun test)
  • Code formatted (bun run fmt)
  • Changes tested locally
  • Terraform validation passes
demo.mov

Related Issues

Closes #201 - Add Oracle Cloud Infrastructure (OCI) template example

/claim #201

@matifali
Copy link
Member

@aybanda, please read #213 for the details. The new template should be in your namespace. You also need to attach a video showing the template working in Coder by demonstrating a successful workspace creation.

@aybanda
Copy link
Author

aybanda commented Jul 14, 2025

@matifali I have attached a terminal demo proving my OCI template is valid, documented, and pushed to GitHub; due to local Coder provisioner issues, I’m unable to record a full UI workspace creation—could a reviewer please test the import and workspace creation? Thank you!

@DevelopmentCats
Copy link
Contributor

@matifali I have attached a terminal demo proving my OCI template is valid, documented, and pushed to GitHub; due to local Coder provisioner issues, I’m unable to record a full UI workspace creation—could a reviewer please test the import and workspace creation? Thank you!

Rather than a demo of you running the terraform initialization and validation, it would be better to take this template and push it to your coder deployment, in which you could show a workspace being created from this template.

@aybanda aybanda force-pushed the feature/oci-template branch from 7281518 to c129148 Compare July 16, 2025 07:25
@aybanda aybanda force-pushed the feature/oci-template branch from c129148 to 31c802f Compare July 16, 2025 07:36
@DevelopmentCats
Copy link
Contributor

@aybanda Any update on this?

…arameter

- Fix duplicate option values for VM.Standard.A1.Flex and VM.Standard.E3.Flex shapes
- Add dynamic shape configuration handling for flexible shapes
- Implement proper OCPU and memory parsing from parameter values
- Ensure unique option values while maintaining descriptive names
- Template now passes terraform validation without errors
@aybanda
Copy link
Author

aybanda commented Jul 30, 2025

Demo Status Update

@DevelopmentCats @matifali I wanted to show you guys the OCI template working in a real Coder deployment, but I'm having trouble with my OCI account. So I put together a different kind of demo that shows what I've built.

What I've Done

I've created a complete OCI template that:

  • Sets up VMs, networking, and storage in Oracle Cloud
  • Integrates with Coder's code-server and JetBrains Gateway
  • Supports 15+ regions and multiple instance types
  • Includes proper security and cost optimization

The template is about 500 lines of Terraform config plus comprehensive docs. I've tested it locally and it validates perfectly - no syntax errors or configuration issues.

The Demo Video

Since I can't get OCI access, I recorded a walkthrough showing:

  • How the template is structured
  • All the configuration options available
  • The Terraform validation passing
  • The cloud-init setup for Coder agent
  • The documentation and troubleshooting guides

What I Need

Could someone with an OCI account please test this template?

I'd love to see it actually create a workspace, but I just can't get past Oracle's signup process. The template URL is:
https://github.com/aybanda/registry/tree/feature/oci-template/registry/aybanda/templates/oci-linux

You'd just need to:

  1. Import it into your Coder deployment
  2. Set your compartment OCID
  3. Create a workspace and see if it works

Conclusion

I think this template is solid and ready to go. It follows all the Coder patterns I've seen in other templates, has proper error handling, and includes everything needed for production use. The only missing piece is someone with OCI access to give it a real test.

If no one can test it right now, I'm happy to provide more detailed code walkthroughs or make any adjustments needed.

Thanks for taking a look!

Untitled.mov

@matifali matifali requested a review from DevelopmentCats July 30, 2025 12:11
@aybanda aybanda force-pushed the feature/oci-template branch from 9d58583 to cea6770 Compare August 5, 2025 07:12
@aybanda aybanda requested a review from matifali August 5, 2025 07:13
@DevelopmentCats
Copy link
Contributor

Im signing up for an account now. Ill update and let you know how it goes

@DevelopmentCats
Copy link
Contributor

@aybanda its taking a bit for me to get the activation email for the account.

Can you also take a look at your changes in the PR. you currently have changes made to other coder modules included in this PR which we do not want.

@aybanda aybanda force-pushed the feature/oci-template branch from cea6770 to 9bc4073 Compare August 7, 2025 09:39
@aybanda
Copy link
Author

aybanda commented Aug 7, 2025

@aybanda its taking a bit for me to get the activation email for the account.

Can you also take a look at your changes in the PR. you currently have changes made to other coder modules included in this PR which we do not want.

I've fixed it – the PR now only includes the intended changes.

.icons/oci.svg Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an aws logo not an oci logo. But Oracle does have complicated legal standards for logo usage rights.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can just go ahead and use the OCI logo if you can go ahead and update this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot use official OCI logo due to their trademark/licensing requirements, so removed icon reference entirely to avoid issues further.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I verified this with out product team, and you can go ahead and add it back.

.icons/oci.svg Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is definitely not the Oracle Logo

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oracle-Cloud-Logo this works?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to be the logo that OCI is using which will probably work better for the icon anyways

https://upload.wikimedia.org/wikipedia/commons/e/e1/Oracle_Corporation_logo.svg

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aybanda, please update the logo as per recommendation.

Copy link
Member

@matifali matifali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did not work for me. Even after resolving some of the issues I described above. I got

2025-09-04 09:02:10.837+05:00 Error: 401-NotAuthenticated, The required information to complete authentication was not provided or was incorrect.
Suggestion: Please retry or contact support for help with service: Identity Compartments
Documentation: https://registry.terraform.io/providers/oracle/oci/latest/docs/data-sources/identity_compartments
API Reference: https://docs.oracle.com/iaas/api/#/en/identity/20160918/Compartment/ListCompartments
Request Target: GET https://identity.us-ashburn-1.oci.oraclecloud.com/20160918/compartments?accessLevel=ACCESSIBLE&compartmentId=cid1.tenancy.oc1..aaaaaaaaigxlcgiui3lvzfa7z4cjcifkzomdsi45mt236ntq3btihom2bsiq&lifecycleState=ACTIVE
Provider version: 7.16.0, released on 2025-08-27. This provider is 1 Update(s) behind to current.
Service: Identity Compartments
Operation Name: ListCompartments
OPC request ID: 412635a3e275e2ab4d56c95ab1c852c0/9F233F34C3152E80330CC4B81E0CB733/423339ECDF1E0CF69EF4F2C31CDEBAF5

2025-09-04 09:02:10.837+05:00 on main.tf line 218, in data "oci_identity_compartments" "compartments":
2025-09-04 09:02:10.837+05:00   218: data "oci_identity_compartments" "compartments" {
2025-09-04 09:02:10.837+05:00
2025-09-04 09:02:10.837+05:00
2025-09-04 09:02:10.842+05:00 Error: 401-NotAuthenticated, The required information to complete authentication was not provided or was incorrect.
Suggestion: Please retry or contact support for help with service: Identity Availability Domains
Documentation: https://registry.terraform.io/providers/oracle/oci/latest/docs/data-sources/identity_availability_domains
API Reference: https://docs.oracle.com/iaas/api/#/en/identity/20160918/AvailabilityDomain/ListAvailabilityDomains
Request Target: GET https://identity.us-ashburn-1.oci.oraclecloud.com/20160918/availabilityDomains?compartmentId=cid1.tenancy.oc1..aaaaaaaaigxlcgiui3lvzfa7z4cjcifkzomdsi45mt236ntq3btihom2bsiq
Provider version: 7.16.0, released on 2025-08-27. This provider is 1 Update(s) behind to current.
Service: Identity Availability Domains
Operation Name: ListAvailabilityDomains
OPC request ID: b46cad642483ec528dad51f44d29a690/35273924FC2FBCC02B385D0F6C01992F/60E8E5DCDF4BF2CC7BA82CFB352F9F28

2025-09-04 09:02:10.842+05:00 on main.tf line 438, in data "oci_identity_availability_domains" "ads":
2025-09-04 09:02:10.842+05:00   438: data "oci_identity_availability_domains" "ads" {
2025-09-04 09:02:10.842+05:00
2025-09-04 09:02:10.842+05:00
2025-09-04 09:02:10.852+05:00 Error: 401-NotAuthenticated, The required information to complete authentication was not provided or was incorrect.
Suggestion: Please retry or contact support for help with service: Core Images
Documentation: https://registry.terraform.io/providers/oracle/oci/latest/docs/data-sources/core_images
API Reference: https://docs.oracle.com/iaas/api/#/en/iaas/20160918/Image/ListImages
Request Target: GET https://iaas.us-ashburn-1.oraclecloud.com/20160918/images?compartmentId=cid1.tenancy.oc1..aaaaaaaaigxlcgiui3lvzfa7z4cjcifkzomdsi45mt236ntq3btihom2bsiq&lifecycleState=AVAILABLE&operatingSystem=Canonical+Ubuntu&operatingSystemVersion=22.04&sortBy=TIMECREATED&sortOrder=DESC
Provider version: 7.16.0, released on 2025-08-27. This provider is 1 Update(s) behind to current.
Service: Core Images
Operation Name: ListImages
OPC request ID: ebc2170c48cc50e78352b08bf10404a7/CB33D3262B662EC71790B49EA6A05EFC/76FEE4481D6DD9BFA0E1964B08F00AC9

2025-09-04 09:02:10.852+05:00 on main.tf line 225, in data "oci_core_images" "ubuntu":
2025-09-04 09:02:10.852+05:00   225: data "oci_core_images" "ubuntu" {
2025-09-04 09:02:10.852+05:00
2025-09-04 09:02:10.853+05:00
=== ✔ Detecting persistent resources [12054ms]
==> ⧗ Cleaning Up
=== ✘ Cleaning Up [17ms]
=== ✘ Cleaning Up [628ms]
Encountered an error running "coder templates push", see "coder templates push --help" for more information
error: template import provision for start: terraform plan: exit status 1

.icons/oci.svg Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aybanda, please update the logo as per recommendation.

This template assumes that coderd is run in an environment that is authenticated with Oracle Cloud Infrastructure. The recommended authentication methods are:

1. **Instance Principal** (Recommended for production): Run Coder on an OCI instance with proper IAM policies
2. **API Key**: Set environment variables `OCI_TENANCY_OCID`, `OCI_USER_OCID`, `OCI_FINGERPRINT`, and `OCI_PRIVATE_KEY_PATH`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The user also needs to mount the key file in the coder server/provisioner container.

Comment on lines 21 to 25
variable "ssh_public_key" {
description = "SSH public key for the instance"
type = string
default = ""
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be required as Coder handles networking and authentication through the Coder agent.

variable "compartment_ocid" {
description = "The OCID of the compartment to create resources in"
type = string
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this optional and default to the root compartment, which is equivalent to the tenancy OCID. https://docs.oracle.com/en-us/iaas/Content/dev/terraform/configuring.htm#env-export-source

name = "instance_shape"
display_name = "Instance Shape"
description = "What instance shape should your workspace use?"
default = "VM.Standard.A1.Flex"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default should be one of the options.

2025-09-03 11:50:24.065+05:00 Error: Default value must be a valid option
2025-09-03 11:50:24.066+05:00 on main.tf line 126, in data "coder_parameter" "instance_shape":
2025-09-03 11:50:24.066+05:00   126:   default      = "VM.Standard.A1.Flex"
2025-09-03 11:50:24.066+05:00
2025-09-03 11:50:24.066+05:00 the value "VM.Standard.A1.Flex" must be defined as one of options
2025-09-03 11:50:24.074+05:00 Error: can not create client, bad configuration: did not find a proper configuration for tenancy
2025-09-03 11:50:24.074+05:00 on main.tf line 204, in provider "oci":
2025-09-03 11:50:24.074+05:00   204: provider "oci" {
2025-09-03 11:50:24.074+05:00
2025-09-03 11:50:24.074+05:00

AB added 2 commits September 11, 2025 14:40
…tenancy; fix instance_shape default; use effective compartment for image/AD; update OCI logo to official wordmark
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Oracle Cloud Infrastructure (OCI) template example
3 participants