Skip to content

Commit

Permalink
Add missing data variables from workshop definition and renderers.
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamDumpleton committed Aug 15, 2023
1 parent f998045 commit 33aecb2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions session-manager/handlers/workshopenvironment.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,11 @@ def workshop_environment_create(
if xget(workshop_spec, "environment.images.ingress.enabled", False):
oci_image_cache = f"images-{workshop_namespace}.{INGRESS_DOMAIN}"

ingress_port = "80"

if INGRESS_PROTOCOL == "https":
ingress_port = "443"

environment_downloads_variables = dict(
platform_arch=PLATFORM_ARCH,
image_repository=image_repository,
Expand All @@ -638,7 +643,9 @@ def workshop_environment_create(
cluster_domain=CLUSTER_DOMAIN,
ingress_domain=INGRESS_DOMAIN,
ingress_protocol=INGRESS_PROTOCOL,
ingress_port=ingress_port,
ingress_port_suffix="",
training_portal=portal_name,
)

workshop_files = workshop_spec.get("workshop", {}).get("files", [])
Expand Down Expand Up @@ -956,10 +963,12 @@ def workshop_environment_create(
cluster_domain=CLUSTER_DOMAIN,
ingress_domain=INGRESS_DOMAIN,
ingress_protocol=INGRESS_PROTOCOL,
ingress_port=ingress_port,
ingress_port_suffix="",
ingress_secret=INGRESS_SECRET,
ingress_class=INGRESS_CLASS,
storage_class=CLUSTER_STORAGE_CLASS,
training_portal=portal_name,
)

application_variables_list = workshop_spec.get("session").get("variables", [])
Expand Down
7 changes: 7 additions & 0 deletions session-manager/handlers/workshopsession.py
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,11 @@ def resolve_security_policy(name):
else:
image_repository = image_registry_host

ingress_port = "80"

if INGRESS_PROTOCOL == "https":
ingress_port = "443"

session_variables = dict(
platform_arch=PLATFORM_ARCH,
image_repository=image_repository,
Expand All @@ -933,11 +938,13 @@ def resolve_security_policy(name):
workshop_version=workshop_version,
environment_name=environment_name,
workshop_namespace=workshop_namespace,
training_portal=portal_name,
session_url=session_url,
session_hostname=session_hostname,
cluster_domain=CLUSTER_DOMAIN,
ingress_domain=INGRESS_DOMAIN,
ingress_protocol=INGRESS_PROTOCOL,
ingress_port=ingress_port,
ingress_port_suffix="",
ingress_secret=INGRESS_SECRET,
ingress_class=INGRESS_CLASS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
#@ add_param_from_environ("oci_image_cache")
#@ add_param_from_environ("assets_repository")
#@ add_param_from_environ("workshop_name")
#@ add_param_from_environ("environment_name")
#@ add_param_from_environ("session_name")
#@ add_param_from_environ("session_id")
#@ add_param_from_environ("session_url")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export let config = {
oci_image_cache: process.env.OCI_IMAGE_CACHE || "workshop-images",
assets_repository: process.env.ASSETS_REPOSITORY || "workshop-assets",
workshop_name: process.env.WORKSHOP_NAME || "workshop",
environment_name: process.env.ENVIRONMENT_NAME || "workshop",
session_name: process.env.SESSION_NAME || "workshop",
session_id: process.env.SESSION_ID || "workshop",
session_url: process.env.SESSION_URL || "http://workshop-127-0-0-1.nip.io",
Expand Down Expand Up @@ -119,6 +120,7 @@ config.variables.push({ name: "image_repository", content: config.image_reposito
config.variables.push({ name: "oci_image_cache", content: config.oci_image_cache })
config.variables.push({ name: "assets_repository", content: config.assets_repository })
config.variables.push({ name: "workshop_name", content: config.workshop_name })
config.variables.push({ name: "environment_name", content: config.environment_name })
config.variables.push({ name: "session_name", content: config.session_name })
config.variables.push({ name: "session_id", content: config.session_id })
config.variables.push({ name: "session_url", content: config.session_url })
Expand Down

0 comments on commit 33aecb2

Please sign in to comment.