Run CodeServer on Google Colab using Inlets in less than 60 secs using your own domain.

Overview

Inlets Colab

Run CodeServer on Colab using Inlets in less than 60 secs using your own domain.

Open In Colab

Features

  • Optimized for Inlets/InletsPro
  • Use your own Custom Domain i.e. https://colab.yourdomain.com
  • Quick Deployment
  • Password Protection (Optional)
  • Notebook/CLI Support
  • GDrive Integration
  • Cloud Storage Integration (gcs, s3, minio, etc.)

Currently Tested Storage Backends

  • GCP Cloud Storage
  • AWS S3
  • Minio

Installation

# From pypi
pip install --upgrade inlets-colab

# From source
pip install --upgrade git+https://github.com/trisongz/inlets-colab

Requirements


Usage in Colab Notebook

import os
os.environ['INLETS_LICENSE'] = ... # Inlets Pro License
os.environ['INLETS_TOKEN'] = ... # Inlets Token
os.environ['INLETS_TUNNEL_HOST'] = "inlets.domain.com" # Inlets Tunnel Host (ControlPlane)
os.environ['INLETS_SERVER_HOST'] = "colab.domain.com" # Inlets Tunnel Host (DataPlane)
os.environ['INLETS_CLIENT_HOST'] = "127.0.0.1" # The Local Server IP
os.environ['INLETS_CLIENT_PORT'] = "7070" # The Local Server IP
os.environ['GENERATE_AUTH'] = "true" # Will generate password if not provided
os.environ['MOUNT_GS'] = "true" # Bool to mount GCS Bucket
os.environ['GS_BUCKET'] = "gs_bucket" # Name of GCS Bucket to Mount
os.environ['GS_PROJECT'] = "gcs_project" # Project Name within GCP
os.environ['GS_AUTH'] = ... # Base64 Encoded String of your ServiceAccount.json

from inletscolab.client import InletsColab

InletsColab.start()

Usage in Colab Notebook + Terminal

## Write your env config to envfile.yaml

%%writefile /content/envfile.yaml

INLETS_LICENSE: ...
INLETS_TOKEN: ...
INLETS_TUNNEL_HOST: inlets.domain.com
INLETS_SERVER_HOST: colab.domain.com
INLETS_CLIENT_HOST: 127.0.0.1
INLETS_CLIENT_PORT: '7070'
GENERATE_AUTH: 'true'
MOUNT_GS: 'true'
GS_BUCKET: gs_bucket
GS_PROJECT: gcs_project
GS_AUTH: ...
## Now use the CLI to launch targeting the envfile.yaml

inletscolab start --envfile /content/envfile.yaml

Currently Tested Inlets Server

  • Inlets in VM
  • Inlets in Kubernetes Cluster
    • External:
      • ExternalDNS
      • CertManager
    • Repo: https://inlets.github.io/inlets-pro/charts/
    • Chart: inlets-pro/inlets-pro
    • Helm Values:
      • ingress.domain: $INLETS_TUNNEL_HOST
      • dataPlane.ports[0].port: $INLETS_CLIENT_PORT
      • dataPlane.ports[0].targetPort: $INLETS_CLIENT_PORT
    • Provider: aws-eks
    • Ingress:
      • Type: loadbalancer from nginx-controller
      • Class: nginx
      • Service: ...-inlets-pro-data-plane
      • Port: $INLETS_CLIENT_PORT
      • Path: /
      • PathType: Prefix
      • Host: $INLETS_SERVER_HOST

Currently Tested Inlets Cloud Providers

  • GCP ComputeEngine
  • GCP GKE
  • AWS EC2
  • AWS EKS
  • DigitalOcean Droplet
  • DigitalOcean Kubernetes
  • Linode
  • Azure
  • Oracle

Code Server

Default Version: 3.12.0

Default Plugins:


Environment Variables

Below are the Environment Variables that are used to build the Config

class InletsConfig:
    license: str = Env.to_str('INLETS_LICENSE', '')
    token: str = Env.to_str('INLETS_TOKEN', '')
    tunnel_host: str = Env.to_str('INLETS_TUNNEL_HOST', '')
    server_host: str = Env.to_str('INLETS_SERVER_HOST', '')
    server_port: int = Env.to_int('INLETS_SERVER_PORT', 8123)
    client_host: str = Env.to_str('INLETS_CLIENT_HOST', '127.0.0.1')
    client_port: int = Env.to_int('INLETS_CLIENT_PORT', 7070)
    domain_name: str = Env.to_str('INLETS_DOMAIN', 'localhost')
    is_cluster: bool = Env.to_bool('INLETS_CLUSTER', 'true')
    client_type: str = Env.to_str('INLETS_CLIENT_TYPE', 'tcp')
    use_sudo: bool = Env.to_bool('INLETS_USE_SUDO', 'true')

class ServerConfig:
    extensions: List[str] = Env.to_list('CODESERVER_EXTENSIONS', DefaultCodeServerExtensions)
    version: str = Env.to_str('CODESERVER_VERSION', DefaultCodeServerVersion)
    authtoken: str = Env.to_str('SERVER_AUTHTOKEN', '')
    password: str = Env.to_str('SERVER_PASSWORD', '')
    code: bool = Env.to_bool('RUN_CODE', 'true')
    lab: bool = Env.to_bool('RUN_LAB')
    generate_auth: bool = Env.to_bool('GENERATE_AUTH', 'true')

class StorageConfig:
    
    ## Bool to mount/not mount
    ## should be 'true'/'false'

    mount_drive: bool = Env.to_bool('MOUNT_DRIVE')
    mount_s3: bool = Env.to_bool('MOUNT_S3')
    mount_gs: bool = Env.to_bool('MOUNT_GS')
    mount_minio: bool = Env.to_bool('MOUNT_MINIO')

    ## Paths to Bucket(s)
    ## All bucket should exclude their prefixes
    ## i.e. gs://gsbucket -> gsbucket
    ##      s3://s3bucket -> s3bucket 

    s3_bucket: str = Env.to_str('S3_BUCKET')
    gs_bucket: str = Env.to_str('GS_BUCKET')
    minio_bucket: str = Env.to_str('MINIO_BUCKET')

    ## Paths to Mount Bucket(s)
    ## along with the defaults

    s3_mount_path: str = Env.to_str('S3_MOUNT_PATH', '/content/s3')
    gs_mount_path: str = Env.to_str('GS_MOUNT_PATH', '/content/gs')
    minio_mount_path: str = Env.to_str('MINIO_MOUNT_PATH', '/content/minio')

    ## GCP Cloud Auth
    ## GS_AUTH should be a base64 encoded string of the serviceaccount.json
    ## To create it, run `base64 -i /path/to/serviceaccount.json`
    ## It will likely be _very_ long
    ## If it exists, it will be decoded and saved as proper json to /authz/adc.json

    gauth: PathLike = Env.to_json_b64('GS_AUTH', 'GOOGLE_APPLICATION_CREDENTIALS', '/authz/adc.json')
    gproject: str = Env.to_str('GS_PROJECT')
    
    ## AWS Cloud Auth
    ## Note: as Colab Locations are Randomly selected globally
    ## you may incur increased ingress/egress charges with large files
    ## in your S3 if regions are far apart. Use with Caution

    s3_key_id: str = Env.to_str_env('AWS_KEYID', 'AWS_ACCESS_KEY_ID', '')
    s3_secret: str = Env.to_str_env('AWS_SECRET', 'AWS_SECRET_ACCESS_KEY', '')
    s3_region: str = Env.to_str('AWS_REGION', 'us-east-1')
    
    ## Minio Cloud Auth
    ## Currently Untested
    ## MINIO_ENDPOINT should be the full http/https along with port
    ## i.e. https://minio.yourdomain.com
    ##      http://1.2.3.4:9000

    minio_endpoint: str = Env.to_str('MINIO_ENDPOINT')
    minio_key_id: str = Env.to_str('MINIO_KEYID')
    minio_secret: str = Env.to_str('MINIO_SECRET')

Libraries & Dependencies

Python Dependencies

Runtime Dependencies


Helpful Links

Below are some helpful links in setting up Inlets if you do not already have one set up.


License

MIT

Owner
Chief Architect @ Growth Engine
Use a real time weather API to apply wind to your mouse cursor.

wind-cursor Use a real time weather API to apply wind to your mouse cursor. Requirements PyAutoGUI pyowm Usage This program uses the OpenWeatherMap AP

Andreas Schmid 1 Feb 07, 2022
MuMMI Core is the underlying infrastructure and generalizable component of the MuMMI framework

MuMMI Core is the underlying infrastructure and generalizable component of the MuMMI framework, which facilitates the coordination of massively parallel multiscale simulations.

4 Aug 17, 2022
A Python program that generates a maze that solves itself using DFS

Maze Generator And Solver Program Purpose: Generates a maze that then solves itself Language: Python and Pygame Algorithm: Randomized DFS / Floodfill

Joshua Liu 1 Jul 25, 2022
Python samples for Google Cloud Platform products.

Google Cloud Platform Python Samples Python samples for Google Cloud Platform products. Setup Install pip and virtualenv if you do not already have th

Google Cloud Platform 6k Jan 03, 2023
Demo code for "Logs in distributed systems" webinar

Hexlet Logs Demo Пререквизиты docker-compose python3 Учетка в DataDog Базовое понимание, что такое логи (можно почитать гайд

Anton Markelov 1 Dec 01, 2021
System Information Utility With Python

System-Information-Utility This is a simple utility, for the terminal, which allows you to find out information about your PC. It's very easy to run t

2 Apr 15, 2022
Covid-ml-predictors - COVID predictions using AI.

COVID Predictions This repo contains ML models to be trained on COVID-19 data from the UK, sourced off of Kaggle here. This uses many different ML mod

1 Jan 09, 2022
K2HASH Python library - NoSQL Key Value Store(KVS) library

k2hash_python Overview k2hash_python is an official python driver for k2hash. Install Firstly you must install the k2hash shared library: curl -o- htt

Yahoo! JAPAN 3 Oct 19, 2022
Python library to interact with Move Hub / PoweredUp Hubs

Python library to interact with Move Hub / PoweredUp Hubs Move Hub is central controller block of LEGO® Boost Robotics Set. In fact, Move Hub is just

Andrey Pokhilko 499 Jan 04, 2023
Hexa is an advanced browser.It can carry out all the functions present in a browser.

Hexa is an advanced browser.It can carry out all the functions present in a browser.It is coded in the language Python using the modules PyQt5 and sys mainly.It is gonna get developed more in the fut

1 Dec 10, 2021
a wordle-solver written in python

Wordle Solver Overview This is yet another wordle solver. It is built with the word list of the official wordle website, but it should also work with

Shoubhit Dash 10 Sep 24, 2022
The functions we created are included in a script. The necessary parts for pre-processing were taken. Analysis complete.

Feature-Engineering The functions we created are included in a script. The necessary parts for pre-processing were taken. Analysis complete. Business

Ayşe Nur Türkaslan 4 Oct 17, 2021
This is a far more in-depth and advanced version of "Write user interface to a file API Sample"

Fusion360-Write-UserInterface This is a far more in-depth and advanced version of "Write user interface to a file API Sample" from https://help.autode

4 Mar 18, 2022
A class to draw curves expressed as L-System production rules

A class to draw curves expressed as L-System production rules

Juna Salviati 6 Sep 09, 2022
Um pequeno painel de consulta

Spynel Um pequeno painel com consultas de: IP CEP PLACA CNPJ OBS: caso execute o script pelo termux, recomendo que use o da F-Droid por ser mais atual

Spyware 12 Oct 25, 2022
A timer for bird lovers, plays a random birdcall while displaying its image and info.

Birdcall Timer A timer for bird lovers. Siriema hatchling by Junior Peres Junior Background My partner needed a customizable timer for sitting and sta

Marcelo Sanches 1 Jul 08, 2022
Simple control of Thorlabs Elliptec devices from Python.

Elliptec Simple control of Thorlabs Elliptec devices. No docs yet » Get started · Report a bug · Request a feature About The Project ThorLabs Elliptec

David Roesel 8 Sep 22, 2022
The Ultimate Widevine Content Ripper (KEY Extract + Download + Decrypt) is REBORN

NARROWVINE-REBORN ** UPDATE 21.12.01 ** As expected Google patched its ChromeCDM Whitebox exploit by Satsuoni with a force-update on the ChromeCDM. Th

Vank0n 104 Dec 07, 2022
Plux - A dynamic code loading framework for building plugable Python distributions

Plux plux is the dynamic code loading framework used in LocalStack. Overview The

LocalStack 65 Dec 20, 2022
PythonKafkaCompose is an upgrade of the amazing work done in liveMaps

PythonKafkaCompose is an upgrade of the amazing work done in liveMaps It is a simple project composed by: an instance of Kafka a Py

5 Jun 19, 2022