Skip to content

oracle-devrel/terraform-oci-code-server

Repository files navigation

Code-Server on Oracle Cloud Infrastructure

License: UPL

Deploy Code-Server on a compute instance running on Oracle Cloud Infrastructure

One-click button deploy to deploy code-server on Oracle Cloud Infrastructure compute instance.

Introduction

This project enables you to create and configure network and compute resources on OCI and launch a code-server instance.

Architecture Diagram

code-server deployment architecture diagram

Prerequisites

  • Oracle Cloud account

Getting Started

  1. Click the button below to begin the deploy of code-server:

    Deploy to Oracle Cloud

  2. If needed, log into your account. You should then be presented with the Create Stack page.

    These next few steps will deploy a stack to your OCI tenancy. This will include a virtual clod network and a compute instance and the necessary configurations to deploy and run code-server from within your OCI account.

    Under Stack Information (the first screen), check the box I have reviewed and accept the Oracle Terms of Use. Once that box is checked, the information for the stack will be populated automatically.

  3. Click Next at the bottom of the screen. This will take you to the Configure Variables page. On this page you can provide/change these variables:

    • Compartment: select the compartment where do you want to deploy the stack
    • SSH public key (optional): the key will allow you to login into the instance.
    • Use Always Free eligible shape: If checked, the Always Free shape (VM.Standard.E2.1.Micro) is used. Make sure you are in a region where this Always Free shape is available
      If not checked: - Instance Shape: (optional): select the shape that will be used for the VM [default: VM.Standard.E4.Flex]
    • Availability Domain: select the Availability Domain (AD) you want the instance to be deployed to. If you have checked Always Free, make sure to select the Always Free elegible AD.
    • Show Advanced
      • Instance Name (optional): Name of the instance [default: oci-code-server]
      • Flex Instance OCPUs number (optional): Only if you have selected a Flex shape, you can select the number of OCPUs to assign to the flexible shape. [default: 1]

    Then click Next again.

  4. On the Review page, be sure Run Apply is checked, and click Create.

  5. This will take you to the Job Details page, and OCI will begin creating the stack and deploying the custom image for the lab. This will take a few minutes. When it completes (assuming everything went smoothly), the Job Details will show a bright green square with "Succeeded" below it.

  6. Go back to the Stack Details page, in the Application Information tab you can find the public IP of the instance. You can use that IP for the first login to VS Code.

URLs

For more information about code-server:

Know Issues

The code-server instance is launched with the --link flag to provide authentication through GitHub, TLS and a dedicated URL for accessing your VS Code. This feature presents some issues when you try to connect from a different geographic region than the one the instance is running and you encounter an error after the GitHub authentication. Current workaround is to use one of the other options provided by code-server guide to expose it:

Contributing

This project is open source. Please submit your contributions by forking this repository and submitting a pull request! Oracle appreciates any contributions that are made by the open source community.

License

Copyright (c) 2021 Oracle and/or its affiliates.

Licensed under the Universal Permissive License (UPL), Version 1.0.

See LICENSE for more details.


Quality gate