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
objectfactory is a python package to easily implement the factory design pattern for object creation, serialization, and polymorphism

py-object-factory objectfactory is a python package to easily implement the factory design pattern for object creation, serialization, and polymorphis

Devin A. Conley 6 Dec 14, 2022
A notebook explaining the principle of adversarial attacks and their defences

TL;DR: A notebook explaining the principle of adversarial attacks and their defences Abstract: Deep neural networks models have been wildly successful

1 Jan 22, 2022
A visidata plugin for parsing f5 ltm/gtm/audit logs

F5 Log Visidata Plugin This plugin supports the default log format for: /var/log/ltm* /var/log/gtm* /var/log/apm* /var/log/audit* It extracts common l

James Deucker 1 Jan 06, 2022
A lightweight solution for local Particle development.

neopo A lightweight solution for local Particle development. Features Builds Particle projects locally without any overhead. Compatible with Particle

Nathan Robinson 19 Jan 01, 2023
Demo Python project using Conda and Poetry

Conda Poetry This is a demonstration of how Conda and Poetry can be used in a Python project for dev dependency management and production deployment.

Ryan Allen 2 Apr 26, 2022
Домашние задания, выполненные на 3ем семестре РТУ МИРЭА, по дисциплине

ДЗ по курсу "Конфигурационное управление" в РТУ МИРЭА Описание В данном репозитории находятся домашние задания, выполненные на 3ем семестре РТУ МИРЭА,

Semyon Esaev 4 Dec 22, 2022
A python script developed to process Windows memory images based on triage type.

Overview A python script developed to process Windows memory images based on triage type. Requirements Python3 Bulk Extractor Volatility2 with Communi

CrowdStrike 245 Nov 24, 2022
Um pequeno painel de consulta grátis.

[PAINEL-DE-CONSULTA 3.8(BETA)] · Confira meu canal do YouTube. Clique aqui! Nota: Próxima Atualização será a última com coisas novas, o resto será par

276 Jan 05, 2023
This is a Fava extension to display a grouped portfolio view in Fava for a set of Beancount accounts.

Fava Portfolio Summary This is a Fava extension to display a grouped portfolio view in Fava for a set of Beancount accounts. It can also calculate MWR

18 Dec 26, 2022
MDAnalysis tool to calculate membrane curvature.

The MDAkit for membrane curvature analysis is part of the Google Summer of Code program and it is linked to a Code of Conduct.

MDAnalysis 19 Oct 20, 2022
Learning with Peter Norvig's lis.py interpreter

Learning with lis.py This repository contains variations of Peter Norvig's lis.py interpreter for a subset of Scheme, described in (How to Write a (Li

Fluent Python 170 Dec 15, 2022
Just another sentiment wrapper.

sentimany Just a simple sentiment tool. It just grabs a set of pre-made sentiment models that you can quickly use to attach sentiment scores to text.

vincent d warmerdam 15 Dec 27, 2022
Cross-platform MachO/ObjC Static binary analysis tool & library. class-dump + otool + lipo + more

ktool Static Mach-O binary metadata analysis tool / information dumper pip3 install k2l Development is currently taking place on the @python3.10 branc

Kritanta 301 Dec 28, 2022
User management system (UMS), has the primary purpose of connecting to an Active Directory (AD)

💿 Sistema de Gerenciamento de Usuário (SGU) 📚 Sobre o projeto Sistema de gerenciamento de usuários (SGU), tem o objetivo primário de se conectar a u

Patrick Viegas 2 Feb 25, 2022
Python Projects is an Open Source to enhance your python skills

Welcome! 👋🏽 Python Project is Open Source to enhance your python skills. You're free to contribute. 🤓 You just need to give us your scripts written

Tristán 6 Nov 28, 2022
Patch PL to disable LK verification. Patch LK to disable boot/recovery verification.

Simple Python(3) script to disable LK verification in Amazon Preloader images and boot/recovery image verification in Amazon LK ("Little Kernel") images.

Roger Ortiz 18 Mar 17, 2022
Tracking stock volatility.

SP500-highlow-tracking Track stock volatility. Being a useful indicator of the stock price volatility, High-Low gap represents the price range of the

Thong Huynh 13 Sep 07, 2022
Synchrosqueezing, wavelet transforms, and time-frequency analysis in Python

Synchrosqueezing is a powerful reassignment method that focuses time-frequency representations, and allows extraction of instantaneous amplitudes and frequencies

John Muradeli 382 Jan 06, 2023
Generates Windows 95 and 95 OEM keys using the modulus 7 check algorithm

w95keygen-python windowskeygen.py - Generates Windows 95 and 95 OEM keys using the modulus 7 check algorithm Just download and drop in the directory y

Joshua Alto 1 Dec 06, 2021
Sudoku solver using backtracking

Sudoku solver Sudoku solver using backtracking Basically in sudoku, we want to be able to solve a sudoku puzzle given an input like this, which repres

Kylie 99 Jan 07, 2023