Class: Clusters::Applications::Jupyter

Inherits:
ApplicationRecord show all
Includes:
Concerns::ApplicationCore, Concerns::ApplicationData, Concerns::ApplicationStatus, Concerns::ApplicationVersion
Defined in:
app/models/clusters/applications/jupyter.rb

Overview

DEPRECATED for removal in %14.0 See gitlab.com/groups/gitlab-org/-/epics/4280

Constant Summary collapse

VERSION =
'0.9.0'

Constants included from Concerns::ApplicationVersion

Concerns::ApplicationVersion::EXTERNAL_VERSION

Constants inherited from ApplicationRecord

ApplicationRecord::MAX_PLUCK

Instance Method Summary collapse

Methods included from Concerns::ApplicationData

#files

Methods included from Concerns::ApplicationVersion

#update_available?

Methods included from Concerns::ApplicationStatus

#available?, #status_states, #update_in_progress?, #updateable?

Methods inherited from ApplicationRecord

cached_column_list, #create_or_load_association, declarative_enum, default_select_columns, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, #readable_by?, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, #to_ability_name, underscore, where_exists, where_not_exists, with_fast_read_statement_timeout, without_order

Methods included from SensitiveSerializableHash

#serializable_hash

Instance Method Details

#callback_urlObject


54
55
56
# File 'app/models/clusters/applications/jupyter.rb', line 54

def callback_url
  "http://#{hostname}/hub/oauth_callback"
end

#chartObject


31
32
33
# File 'app/models/clusters/applications/jupyter.rb', line 31

def chart
  "#{name}/jupyterhub"
end

#install_commandObject


43
44
45
46
47
48
49
50
51
52
# File 'app/models/clusters/applications/jupyter.rb', line 43

def install_command
  helm_command_module::InstallCommand.new(
    name: name,
    version: VERSION,
    rbac: cluster.platform_kubernetes_rbac?,
    chart: chart,
    files: files,
    repository: repository
  )
end

#oauth_scopesObject


58
59
60
# File 'app/models/clusters/applications/jupyter.rb', line 58

def oauth_scopes
  'api read_repository write_repository'
end

#repositoryObject


35
36
37
# File 'app/models/clusters/applications/jupyter.rb', line 35

def repository
  'https://jupyterhub.github.io/helm-chart/'
end

#set_initial_statusObject


23
24
25
26
27
28
29
# File 'app/models/clusters/applications/jupyter.rb', line 23

def set_initial_status
  return unless not_installable?
  return unless cluster&.application_ingress_available?

  ingress = cluster.application_ingress
  self.status = status_states[:installable] if ingress.external_ip_or_hostname?
end

#valuesObject


39
40
41
# File 'app/models/clusters/applications/jupyter.rb', line 39

def values
  content_values.to_yaml
end