<commit_before>import os
import hmac
import hashlib


c.Application.log_level = 'DEBUG'

c.JupyterHub.authenticator_class = 'oauthenticator.mediawiki.MWOAuthenticator'
c.JupyterHub.hub_ip = '127.0.0.1'
c.JupyterHub.ip = '0.0.0.0'
c.JupyterHub.db_url = os.environ['JPY_DB_URL']
c.JupyterHub.db_kwargs = {
    'pool_recycle': 60  # Do not keep connections for more than one minute
}

c.JupyterHub.statsd_host = 'labmon1001.eqiad.wmnet'
c.JupyterHub.statsd_prefix = 'tools.paws'

c.MWOAuthenticator.client_id = '0a73e346a40b07262b6e36bdba01cba4'
c.MWOAuthenticator.client_secret = '99b284730a79dd30e2c35988be42708ef7e57122'
c.MWOAuthenticator.pass_secrets = True

c.JupyterHub.spawner_class = 'kubespawner.KubeSpawner'
c.KubeSpawner.kube_namespace = 'paws'

c.Authenticator.admin_users = {'YuviPanda'}
c.JupyterHub.admin_access = True

def generate_mysql_password(spawner):
    h = hmac.new(
        os.environ['MYSQL_HMAC_KEY'].encode('utf-8'),
        spawner.user.name.encode('utf-8'),
        hashlib.sha256
    )
    return h.hexdigest()


def generate_mysql_username(spawner):
    return spawner.user.name


c.KubeSpawner.environment = {
    'MYSQL_HOST': os.environ['MYSQL_SERVICE_HOST'],
    'MYSQL_USERNAME': generate_mysql_username,
    'MYSQL_PASSWORD': generate_mysql_password
}

c.KubeSpawner.kube_api_endpoint = 'https://%s' % os.environ['KUBERNETES_PORT_443_TCP_ADDR']
c.KubeSpawner.hub_ip_connect = '%s:8000' % os.environ['PAWS_PORT_8000_TCP_ADDR']
c.KubeSpawner.kube_ca_path = False
c.KubeSpawner.kube_token = os.environ['INSECURE_KUBE_TOKEN']
c.KubeSpawner.singleuser_image_spec = 'yuvipanda/pawsuser:latest'
c.KubeSpawner.volumes = [<commit_msg>Spawn user containers from our private repository!<commit_after>import os
import hmac
import hashlib


c.Application.log_level = 'DEBUG'

c.JupyterHub.authenticator_class = 'oauthenticator.mediawiki.MWOAuthenticator'
c.JupyterHub.hub_ip = '127.0.0.1'
c.JupyterHub.ip = '0.0.0.0'
c.JupyterHub.db_url = os.environ['JPY_DB_URL']
c.JupyterHub.db_kwargs = {
    'pool_recycle': 60  # Do not keep connections for more than one minute
}

c.JupyterHub.statsd_host = 'labmon1001.eqiad.wmnet'
c.JupyterHub.statsd_prefix = 'tools.paws'

c.MWOAuthenticator.client_id = '0a73e346a40b07262b6e36bdba01cba4'
c.MWOAuthenticator.client_secret = '99b284730a79dd30e2c35988be42708ef7e57122'
c.MWOAuthenticator.pass_secrets = True

c.JupyterHub.spawner_class = 'kubespawner.KubeSpawner'
c.KubeSpawner.kube_namespace = 'paws'

c.Authenticator.admin_users = {'YuviPanda'}
c.JupyterHub.admin_access = True

def generate_mysql_password(spawner):
    h = hmac.new(
        os.environ['MYSQL_HMAC_KEY'].encode('utf-8'),
        spawner.user.name.encode('utf-8'),
        hashlib.sha256
    )
    return h.hexdigest()


def generate_mysql_username(spawner):
    return spawner.user.name


c.KubeSpawner.environment = {
    'MYSQL_HOST': os.environ['MYSQL_SERVICE_HOST'],
    'MYSQL_USERNAME': generate_mysql_username,
    'MYSQL_PASSWORD': <PASSWORD>
}

c.KubeSpawner.kube_api_endpoint = 'https://%s' % os.environ['KUBERNETES_PORT_443_TCP_ADDR']
c.KubeSpawner.hub_ip_connect = '%s:8000' % os.environ['PAWS_PORT_8000_TCP_ADDR']
c.KubeSpawner.kube_ca_path = False
c.KubeSpawner.kube_token = os.environ['INSECURE_KUBE_TOKEN']
c.KubeSpawner.singleuser_image_spec = 'docker-registry.tools.wmflabs.org/pawsuser:latest'
c.KubeSpawner.volumes = [
{'fraction_non_alphanumeric': 0.1225519287833828, 'fraction_numerical': 0.04747774480712166, 'mean_word_length': 5.4455066921606115, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '84630', 'n_tokens_mistral': 1516, 'n_tokens_neox': 1462, 'n_words': 164}