feat(oci): add Oracle Cloud Infrastructure template (#201)#720
feat(oci): add Oracle Cloud Infrastructure template (#201)#720jackiewangjingchun-cpu wants to merge 2 commits intocoder:mainfrom
Conversation
- OCI Compute instance provisioning - VCN, subnet, and security group automation - Coder agent auto-installation - Configurable instance shapes Fixes coder#201
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fb9b69d8aa
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| @@ -0,0 +1,237 @@ | |||
| # Oracle Cloud Infrastructure (OCI) Template for Coder | |||
There was a problem hiding this comment.
Move OCI template into a registry namespace
Place this template under registry/<namespace>/templates/... instead of the top-level templates/ directory, because the normal registry automation is scoped to namespaced paths: deploy on push only watches registry/**/templates/** (.github/workflows/deploy-registry.yaml:14-17) and README/resource validation starts from ./registry (cmd/readmevalidation/readmefiles.go:18). In its current location, this template is skipped by the standard publish/validation flow and will not be released like other templates.
Useful? React with 👍 / 👎.
| metadata = { | ||
| ssh_authorized_keys = var.ssh_public_key | ||
| } |
There was a problem hiding this comment.
Bootstrap the VM with coder_agent init script and token
The OCI instance metadata only sets SSH keys here, and the VM never receives coder_agent.main.init_script or coder_agent.main.token, so there is no code path in this template that actually starts the Coder agent on first boot. Existing VM templates wire these into cloud-init/user data (for example registry/coder/templates/digitalocean-linux/main.tf:310-315), and without equivalent wiring this workspace will provision infrastructure but remain unconnected in Coder.
Useful? React with 👍 / 👎.
|
|
||
| # Coder Agent Resource | ||
| resource "coder_agent" "main" { | ||
| arch = "amd64" |
There was a problem hiding this comment.
Match agent architecture to selected OCI shape
Do not hardcode arch = "amd64" when the template advertises ARM shapes (VM.Standard.A1.Flex in templates/oci/README.md:117): if a user selects an ARM shape, the agent will use the wrong architecture and fail to start on the instance. This should be derived from the chosen shape (or exposed as a parameter) so ARM workspaces are functional.
Useful? React with 👍 / 👎.
Summary
Adds a complete Oracle Cloud Infrastructure (OCI) template for deploying Coder workspaces on OCI Compute instances.
Features
Files Added
templates/oci/main.tf: Complete Terraform configurationtemplates/oci/README.md: Comprehensive documentationUsage
Architecture
Supported Shapes
Documentation
Testing
Fixes #201