Skip to content

Commit

Permalink
Merge pull request #1911 from DSD-DBS/fix-cluster-dev
Browse files Browse the repository at this point in the history
fix: Bring cluster deployment up-to-date with latest changes
  • Loading branch information
MoritzWeber0 authored Oct 16, 2024
2 parents c64ba8a + 2dfe91f commit 9e7c1a5
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 53 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ DEVELOPMENT_MODE ?= 0

TIMEOUT ?= 10m

CAPELLA_DOCKERIMAGES = $(MAKE) -C capella-dockerimages PUSH_IMAGES=1 DOCKER_REGISTRY=$(DOCKER_REGISTRY)
CAPELLA_DOCKERIMAGES = $(MAKE) -C capella-dockerimages PUSH_IMAGES=1 DOCKER_REGISTRY=$(CAPELLACOLLAB_SESSIONS_REGISTRY)

# Adds support for msys
export MSYS_NO_PATHCONV := 1
Expand Down
10 changes: 3 additions & 7 deletions backend/capellacollab/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import capellacollab.projects.toolmodels.backups.runs.interface as pipeline_runs_interface
import capellacollab.sessions.metrics as sessions_metrics
import capellacollab.settings.modelsources.t4c.license_server.metrics as t4c_metrics
from capellacollab import core

# This import statement is required and should not be removed! (Alembic will not work otherwise)
from capellacollab.config import config
Expand All @@ -42,12 +41,9 @@
handlers=[stream_handler, timed_rotating_file_handler],
)

ALLOW_ORIGINS = (
[f"{config.general.scheme}//{config.general.host}:{config.general.port}"]
+ ["http://localhost:4200", "http://127.0.0.1:4200"]
if core.DEVELOPMENT_MODE
else []
)
ALLOW_ORIGINS = [
f"{config.general.scheme}://{config.general.host}:{config.general.port}"
]


async def startup():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,23 +112,18 @@ def get_eclipse_configuration():
{
"type": "guacamole",
"id": "guacamole",
"name": "Classic (Guacamole)",
"name": "Guacamole",
"description": (
"Old connection method using Guacamole. "
"If it has worked fine previously, keep using it. "
"In case of issues, try the Xpra connection method."
"Guacamole doesn't support session sharing."
),
"ports": {"metrics": 9118, "rdp": 3389},
"environment": {"CONNECTION_METHOD": "xrdp"},
},
{
"type": "http",
"id": "xpra",
"name": "Experimental (Xpra)",
"description": (
"Experimental connection method using Xpra. "
"It's intended for those users who have issues with the Guacamole connection method."
),
"name": "Xpra",
"description": "Xpra supports session sharing.",
"ports": {"http": 10000, "metrics": 9118},
"environment": {
"CONNECTION_METHOD": "xpra",
Expand Down
2 changes: 1 addition & 1 deletion backend/capellacollab/config/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class GeneralConfig(BaseConfig):
examples=["localhost", "capella.example.com"],
)
port: int | str = pydantic.Field(
default=8000,
default=4200,
description="The port the application should run on.",
examples=[8000, 443, 8080],
)
Expand Down
34 changes: 9 additions & 25 deletions backend/capellacollab/core/database/migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from alembic import migration
from sqlalchemy import orm

from capellacollab import core
from capellacollab.config import config
from capellacollab.core import database
from capellacollab.events import crud as events_crud
Expand Down Expand Up @@ -143,31 +142,20 @@ def get_eclipse_session_configuration() -> (
methods=[
tools_models.GuacamoleConnectionMethod(
id="guacamole",
name="Classic (Guacamole)",
description=(
"Old connection method using Guacamole. "
"If it has worked fine previously, keep using it. "
"In case of issues, try the Xpra connection method."
),
name="Guacamole",
description="Guacamole doesn't support session sharing.",
ports=tools_models.RDPPorts(metrics=9118, rdp=3389),
environment={"CONNECTION_METHOD": "xrdp"},
),
tools_models.HTTPConnectionMethod(
id="xpra",
name="Experimental (Xpra)",
description=(
"Experimental connection method using Xpra. "
"It's intended for those users who have issues with the Guacamole connection method."
),
name="Xpra",
description="Xpra supports session sharing.",
ports=tools_models.HTTPPorts(http=10000, metrics=9118),
environment={
"CONNECTION_METHOD": "xpra",
"XPRA_SUBPATH": "{CAPELLACOLLAB_SESSIONS_BASE_PATH}",
"XPRA_CSP_ORIGIN_HOST": (
"http://localhost:4200"
if core.DEVELOPMENT_MODE
else "{CAPELLACOLLAB_ORIGIN_BASE_URL}"
),
"XPRA_CSP_ORIGIN_HOST": "{CAPELLACOLLAB_ORIGIN_BASE_URL}",
},
redirect_url="{CAPELLACOLLAB_SESSIONS_SCHEME}://{CAPELLACOLLAB_SESSIONS_HOST}:{CAPELLACOLLAB_SESSIONS_PORT}{CAPELLACOLLAB_SESSIONS_BASE_PATH}/?floating_menu=0&sharing=1&path={CAPELLACOLLAB_SESSIONS_BASE_PATH}/",
cookies={
Expand Down Expand Up @@ -197,7 +185,7 @@ def create_capella_tool(db: orm.Session) -> tools_models.DatabaseTool:
)
capella_database = tools_crud.create_tool(db, capella)

for capella_version_name in ("5.0.0", "5.2.0", "6.0.0", "6.1.0"):
for capella_version_name in ("5.0.0", "5.2.0", "6.0.0", "6.1.0", "7.0.0"):
if "localhost" in registry:
docker_tag = f"{capella_version_name}-latest"
else:
Expand All @@ -206,8 +194,8 @@ def create_capella_tool(db: orm.Session) -> tools_models.DatabaseTool:
capella_version = tools_models.CreateToolVersion(
name=capella_version_name,
config=tools_models.ToolVersionConfiguration(
is_recommended=capella_version_name == "6.1.0",
is_deprecated=capella_version_name == "5.0.0",
is_recommended=capella_version_name == "7.0.0",
is_deprecated=capella_version_name in ("5.0.0", "5.2.0"),
sessions=tools_models.SessionToolConfiguration(
persistent=tools_models.PersistentSessionToolConfiguration(
image=(f"{registry}/capella/remote:{docker_tag}"),
Expand Down Expand Up @@ -284,11 +272,7 @@ def create_jupyter_tool(db: orm.Session) -> tools_models.DatabaseTool:
environment={
"JUPYTER_PORT": "8888",
"JUPYTER_TOKEN": "{CAPELLACOLLAB_SESSION_TOKEN}",
"CSP_ORIGIN_HOST": (
"http://localhost:4200"
if core.DEVELOPMENT_MODE
else "{CAPELLACOLLAB_ORIGIN_BASE_URL}"
),
"CSP_ORIGIN_HOST": "{CAPELLACOLLAB_ORIGIN_BASE_URL}",
"JUPYTER_BASE_URL": "{CAPELLACOLLAB_SESSIONS_BASE_PATH}",
},
connection=tools_models.ToolSessionConnection(
Expand Down
2 changes: 1 addition & 1 deletion backend/tests/test_feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def test_send_feedback_with_session(
"warnings": [],
"connection_method": {
"id": "xpra",
"name": "Experimental (Xpra)",
"name": "Xpra",
},
}
],
Expand Down
13 changes: 4 additions & 9 deletions docs/docs/admin/tools/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,22 +341,17 @@ To help you configure your tools, we provide some examples as part of our
methods:
- id: guacamole
type: guacamole
name: Classic (Guacamole)
description: Old connection method using Guacamole. If
it has worked fine previously, keep using it.
In case of issues, try the Xpra connection
method.
name: Guacamole
description: Guacamole doesn't support session sharing.
ports:
metrics: 9118
rdp: 3389
environment:
CONNECTION_METHOD: xrdp
- id: xpra
type: http
name: Experimental (Xpra)
description: Experimental connection method using Xpra.
It's intended for those users who have issues
with the Guacamole connection method.
name: Xpra
description: Xpra supports session sharing.
ports:
metrics: 9118
http: 10000
Expand Down

0 comments on commit 9e7c1a5

Please sign in to comment.