-
Notifications
You must be signed in to change notification settings - Fork 85
Add Oracle OCI-VM template #612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
+439
−0
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| --- | ||
| display_name: Oracle Cloud VM (Linux) | ||
| description: Provision Oracle Cloud Infrastructure (OCI) instances as Coder workspaces | ||
| icon: ../../../../.icons/oracle.svg | ||
| verified: false | ||
| tags: [vm, linux, oracle, oci] | ||
| --- | ||
|
|
||
| # Remote Development on Oracle Cloud Infrastructure (OCI) | ||
|
|
||
| Provision OCI virtual machines as [Coder workspaces](https://coder.com/docs/workspaces) using this Terraform template. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| To deploy Coder workspaces on Oracle Cloud, you’ll need the following: | ||
|
|
||
| ### OCI Resources | ||
|
|
||
| Before deploying, ensure your Oracle Cloud tenancy has: | ||
|
|
||
| - A **VCN (Virtual Cloud Network)** already created | ||
| - At least one **subnet** within that VCN (can be public or private) | ||
| - An **Internet Gateway** attached to the VCN | ||
| - A **Route Table** that routes `0.0.0.0/0` traffic to the Internet Gateway | ||
|
|
||
| > [!NOTE] | ||
| > This template **does not create networking resources** (VCN, subnet, gateway, etc.). | ||
| > You must reference an existing subnet using its **OCID** via the `subnet_id` variable. | ||
|
|
||
| ### OCI Authentication | ||
|
|
||
| You’ll also need the following credentials: | ||
|
|
||
| - **Tenancy OCID** | ||
| - **User OCID** | ||
| - **Fingerprint** | ||
| - **Private Key** | ||
| - **Compartment OCID**(Optional) default to Tenancy OCID if not defined | ||
| - **Subnet OCID** | ||
|
|
||
| [OCI Documentation](https://docs.oracle.com/en-us/iaas/Content/dev/terraform/configuring.htm#api-key-auth) | ||
|
|
||
| --- | ||
|
|
||
| ## Example `.tfvars` File | ||
|
|
||
| ```hcl | ||
| tenancy_ocid = "ocid1.tenancy.oc1..xxxx" | ||
| user_ocid = "ocid1.user.oc1..xxxx" | ||
| fingerprint = "aa:bb:cc:dd:ee:ff" | ||
| subnet_id = "ocid1.subnet.oc1.eu-marseille-1.aaaaaaaaxxx" | ||
| region = "eu-marseille-1" | ||
| private_key = <<EOT | ||
| -----BEGIN PRIVATE KEY----- | ||
| MIIEvQIBADANBgkqhkiG9w0BAQEFAASC... | ||
| -----END PRIVATE KEY----- | ||
| EOT | ||
| ``` | ||
56 changes: 56 additions & 0 deletions
56
registry/Excellencedev/templates/oci-vm/cloud-init/cloud-config.yaml.tftpl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| #cloud-config | ||
| hostname: ${hostname} | ||
| users: | ||
| - name: ${username} | ||
| sudo: ["ALL=(ALL) NOPASSWD:ALL"] | ||
| groups: sudo | ||
| shell: /bin/bash | ||
| packages: | ||
| - git | ||
| - curl | ||
| - wget | ||
| - unzip | ||
| disk_setup: | ||
| /dev/sdb: | ||
| table_type: 'gpt' | ||
| layout: true | ||
| overwrite: false | ||
| fs_setup: | ||
| - label: ${home_volume_label} | ||
| filesystem: ext4 | ||
| device: /dev/sdb | ||
| partition: auto | ||
| mounts: | ||
| - ["/dev/sdb", "/home/${username}", "ext4", "defaults", "0", "2"] | ||
| write_files: | ||
| - path: /opt/coder/init | ||
| permissions: "0755" | ||
| encoding: b64 | ||
| content: ${init_script} | ||
| - path: /etc/systemd/system/coder-agent.service | ||
| permissions: "0644" | ||
| content: | | ||
| [Unit] | ||
| Description=Coder Agent | ||
| After=network-online.target | ||
| Wants=network-online.target | ||
|
|
||
| [Service] | ||
| User=${username} | ||
| ExecStart=/opt/coder/init | ||
| Environment=CODER_AGENT_TOKEN=${coder_agent_token} | ||
| Restart=always | ||
| RestartSec=10 | ||
| TimeoutStopSec=90 | ||
| KillMode=process | ||
|
|
||
| OOMScoreAdjust=-1000 | ||
| SyslogIdentifier=coder-agent | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target | ||
| runcmd: | ||
| - mkdir -p /home/${username} | ||
| - chown ${username}:${username} /home/${username} | ||
| - systemctl enable coder-agent | ||
| - systemctl start coder-agent |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The grammar should be "defaults to Tenancy OCID" instead of "default to Tenancy OCID" to match the subject-verb agreement.