From 6e1e0403b4563bd8c59057817614fce48323fd40 Mon Sep 17 00:00:00 2001 From: MoritzWeber Date: Thu, 13 Apr 2023 13:17:47 +0200 Subject: [PATCH 01/15] ci: Push images for different dropins sets --- .github/workflows/deploy-docker-images.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy-docker-images.yml b/.github/workflows/deploy-docker-images.yml index 0744aaeb..868e1f10 100644 --- a/.github/workflows/deploy-docker-images.yml +++ b/.github/workflows/deploy-docker-images.yml @@ -21,7 +21,14 @@ jobs: - "5.2.0" - "6.0.0" - "6.1.0" - name: Capella ${{ matrix.capella_version }} + dropins: + - name: "no" # no dropins + dropins: "" + - name: "selected" + dropins: "CapellaXHTMLDocGen,DiagramStyler,Filtering,PVMT,Requirements,SubsystemTransition,TextualEditor" # selected set of dropins + - name: "all" + dropins: "CapellaXHTMLDocGen,DiagramStyler,Filtering,PVMT,Requirements,SubsystemTransition,TextualEditor" # all open source dropins + name: Capella ${{ matrix.capella_version }} with ${{ matrix.dropins.name }} dropins steps: - name: Checkout repository uses: actions/checkout@v3 @@ -45,20 +52,21 @@ jobs: - name: Build run: > make ${{ env.images }} - CAPELLA_VERSIONS=${{ matrix.capella_version }} - DOCKER_PREFIX=${{ env.registry }} - CAPELLA_DOCKERIMAGES_REVISION=${{ steps.tag.outputs.branch }} + CAPELLA_VERSIONS="${{ matrix.capella_version }}" + DOCKER_PREFIX="${{ env.registry }}" + CAPELLA_DOCKERIMAGES_REVISION="${{ steps.tag.outputs.branch }}" + CAPELLA_DROPINS="${{ matrix.dropins.dropins }}" DOCKER_BUILD_FLAGS="--label git-short-sha=${{ steps.tag.outputs.sha }}" - name: Install test dependencies run: | pip install . - name: Run pytest run: > - DOCKER_PREFIX=${{ env.registry }} - DOCKER_TAG=${{ matrix.capella_version }}-${{ steps.tag.outputs.branch }} + DOCKER_PREFIX="${{ env.registry }}" + DOCKER_TAG="${{ matrix.capella_version }}-${{ steps.tag.outputs.branch }}" pytest -m "not (t4c_server or t4c)" tests - name: Push run: | for image in ${{ env.images }} - do docker push ${{ env.registry }}$image:${{ matrix.capella_version }}-${{ steps.tag.outputs.branch }} + do docker push "${{ env.registry }}$image:${{ matrix.capella_version }}-${{ steps.tag.outputs.branch }}" done From 9deffed03a39d2d600c9cde4d0f594fa901ca2dd Mon Sep 17 00:00:00 2001 From: MoritzWeber Date: Thu, 13 Apr 2023 13:34:52 +0200 Subject: [PATCH 02/15] feat: Add support for a custom DOCKER_TAG_SCHEMA --- .github/workflows/deploy-docker-images.yml | 1 + Makefile | 25 +++++++++++----------- capella_loop.sh | 8 +++---- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/deploy-docker-images.yml b/.github/workflows/deploy-docker-images.yml index 868e1f10..38d48a82 100644 --- a/.github/workflows/deploy-docker-images.yml +++ b/.github/workflows/deploy-docker-images.yml @@ -56,6 +56,7 @@ jobs: DOCKER_PREFIX="${{ env.registry }}" CAPELLA_DOCKERIMAGES_REVISION="${{ steps.tag.outputs.branch }}" CAPELLA_DROPINS="${{ matrix.dropins.dropins }}" + DOCKER_TAG_SCHEMA='${CAPELLA_VERSION}'-${{ matrix.dropins.name }}-'${CAPELLA_DOCKERIMAGES_REVISION}' DOCKER_BUILD_FLAGS="--label git-short-sha=${{ steps.tag.outputs.sha }}" - name: Install test dependencies run: | diff --git a/Makefile b/Makefile index 06a249d8..8b4a3c19 100644 --- a/Makefile +++ b/Makefile @@ -71,10 +71,10 @@ METRICS_PORT ?= 9118 export CAPELLA_VERSIONS ?= 5.0.0 5.2.0 6.0.0 # Capella version used to run containers -CAPELLA_VERSION ?= 6.0.0 +export CAPELLA_VERSION ?= 6.0.0 -# Only used when "capella_loop.sh" is NOT used -export DOCKER_TAG=$(CAPELLA_VERSION)-$(CAPELLA_DOCKERIMAGES_REVISION) +# Only use when "capella_loop.sh" is NOT used +export DOCKER_TAG_SCHEMA ?= $$CAPELLA_VERSION-$$CAPELLA_DOCKERIMAGES_REVISION # Should be 'latest', the branch name, the commit hash or a Git tag name export CAPELLA_DOCKERIMAGES_REVISION ?= latest @@ -110,8 +110,6 @@ DOCKER_REGISTRY ?= localhost:12345 # Log level when running Docker containers LOG_LEVEL ?= DEBUG -GIT_SHA = $(shell git rev-parse --short HEAD) - # If this option is set to 1, all tests that require a running t4c server # will be executed. To run these tests, you need a Makefile in # t4c/server with a target t4c/server/server that builds the t4c server @@ -150,10 +148,12 @@ all: \ t4c/client/backup \ t4c/client/exporter +base: SHELL=/bin/bash base: docker build $(DOCKER_BUILD_FLAGS) --build-arg UID=$(TECHUSER_UID) -t $(DOCKER_PREFIX)$@:$(CAPELLA_DOCKERIMAGES_REVISION) base $(MAKE) PUSH_IMAGES=$(PUSH_IMAGES) DOCKER_TAG=$(CAPELLA_DOCKERIMAGES_REVISION) IMAGENAME=$@ .push +base: SHELL=/bin/bash jupyter-notebook: base docker build $(DOCKER_BUILD_FLAGS) -t $(DOCKER_PREFIX)$@:$(JUPYTER_NOTEBOOK_REVISION) jupyter-notebook $(MAKE) PUSH_IMAGES=$(PUSH_IMAGES) DOCKER_TAG=$(JUPYTER_NOTEBOOK_REVISION) IMAGENAME=$@ .push @@ -239,7 +239,6 @@ t4c/client/exporter: t4c/client/base docker build $(DOCKER_BUILD_FLAGS) -t $(DOCKER_PREFIX)$@:$$DOCKER_TAG --build-arg BUILD_ARCHITECTURE=$(BUILD_ARCHITECTURE) --build-arg BASE_IMAGE=$(DOCKER_PREFIX)$<:$$DOCKER_TAG --build-arg CAPELLA_VERSION=$$CAPELLA_VERSION exporter $(MAKE) PUSH_IMAGES=$(PUSH_IMAGES) IMAGENAME=$@ .push - capella/builder: docker build $(DOCKER_BUILD_FLAGS) -t $(DOCKER_PREFIX)$@:$(CAPELLA_DOCKERIMAGES_REVISION) builder docker run -it -e CAPELLA_VERSION=$(CAPELLA_VERSION) -v $$(pwd)/builder/output/$(CAPELLA_VERSION):/output -v $$(pwd)/builder/m2_cache:/root/.m2/repository $(DOCKER_PREFIX)$@:$(CAPELLA_DOCKERIMAGES_REVISION) @@ -254,7 +253,7 @@ run-capella/readonly: capella/readonly -e GIT_DEPTH=$(GIT_REPO_DEPTH) \ -e GIT_USERNAME="" \ -e GIT_PASSWORD="" \ - $(DOCKER_PREFIX)capella/readonly:$(DOCKER_TAG) + $(DOCKER_PREFIX)capella/readonly:$$(echo "$(DOCKER_TAG_SCHEMA)" | envsubst) run-capella/readonly-debug: capella/readonly docker run $(DOCKER_RUN_FLAGS) \ @@ -271,7 +270,7 @@ run-capella/readonly-debug: capella/readonly -e GIT_USERNAME="$(GIT_USERNAME)" \ -e GIT_PASSWORD="$(GIT_PASSWORD)" \ --entrypoint bash \ - $(DOCKER_PREFIX)capella/readonly:$(DOCKER_TAG) + $(DOCKER_PREFIX)capella/readonly:$$(echo "$(DOCKER_TAG_SCHEMA)" | envsubst) run-t4c/client/remote-legacy: t4c/client/remote docker rm /t4c-client-remote || true @@ -286,7 +285,7 @@ run-t4c/client/remote-legacy: t4c/client/remote -p $(FILESYSTEM_PORT):8000 \ -p $(METRICS_PORT):9118 \ --name t4c-client-remote-legacy \ - $(DOCKER_PREFIX)t4c/client/remote:$(DOCKER_TAG) + $(DOCKER_PREFIX)t4c/client/remote:$$(echo "$(DOCKER_TAG_SCHEMA)" | envsubst) run-t4c/client/remote-json: t4c/client/remote docker rm /t4c-client-remote-json || true @@ -299,7 +298,7 @@ run-t4c/client/remote-json: t4c/client/remote -p $(FILESYSTEM_PORT):8000 \ -p $(METRICS_PORT):9118 \ --name t4c-client-remote-json \ - $(DOCKER_PREFIX)t4c/client/remote:$(DOCKER_TAG) + $(DOCKER_PREFIX)t4c/client/remote:$$(echo "$(DOCKER_TAG_SCHEMA)" | envsubst) run-t4c/client/remote/pure-variants: t4c/client/remote/pure-variants docker run $(DOCKER_RUN_FLAGS) \ @@ -313,7 +312,7 @@ run-t4c/client/remote/pure-variants: t4c/client/remote/pure-variants -p $(FILESYSTEM_PORT):8000 \ -p $(METRICS_PORT):9118 \ --rm \ - $(DOCKER_PREFIX)t4c/client/remote/pure-variants:$(DOCKER_TAG) + $(DOCKER_PREFIX)t4c/client/remote/pure-variants:$$(echo "$(DOCKER_TAG_SCHEMA)" | envsubst) run-t4c/client/backup: t4c/client/backup docker run $(DOCKER_RUN_FLAGS) --rm -it \ @@ -332,7 +331,7 @@ run-t4c/client/backup: t4c/client/backup -e HTTP_PORT="$(HTTP_PORT)" \ -e LOG_LEVEL="$(LOG_LEVEL)" \ -e CONNECTION_TYPE="$(CONNECTION_TYPE)" \ - $(DOCKER_PREFIX)t4c/client/backup:$(DOCKER_TAG) + $(DOCKER_PREFIX)t4c/client/backup:$$(echo "$(DOCKER_TAG_SCHEMA)" | envsubst) run-t4c/client/exporter: t4c/client/exporter docker run $(DOCKER_RUN_FLAGS) \ @@ -350,7 +349,7 @@ run-t4c/client/exporter: t4c/client/exporter -e HTTP_LOGIN="${HTTP_LOGIN}" \ -e HTTP_PASSWORD="${HTTP_PASSWORD}" \ -e LOG_LEVEL="$(LOG_LEVEL)" \ - $(DOCKER_PREFIX)t4c/client/exporter:$(DOCKER_TAG) + $(DOCKER_PREFIX)t4c/client/exporter:$(echo "$(DOCKER_TAG_SCHEMA)" | envsubst) debug-t4c/client/backup: LOG_LEVEL=DEBUG diff --git a/capella_loop.sh b/capella_loop.sh index bc986ab6..12744c40 100755 --- a/capella_loop.sh +++ b/capella_loop.sh @@ -19,14 +19,14 @@ ASCII_RESET="\033[0m" for version in $CAPELLA_VERSIONS do - printf "${ASCII_BOLD}${ASCII_CYAN}Running target '$MAKE_CURRENT_TARGET' for Capella version $version...${ASCII_RESET}\n" + printf "${ASCII_BOLD}${ASCII_CYAN}Running target '$MAKE_CURRENT_TARGET' for Capella version $version...${ASCII_RESET}\n" >&2 export CAPELLA_VERSION=$version - export DOCKER_TAG=$CAPELLA_VERSION-$CAPELLA_DOCKERIMAGES_REVISION + export DOCKER_TAG=$(echo "$DOCKER_TAG_SCHEMA" | envsubst) /bin/bash -euo pipefail "$@" || r=$? if [[ -z "$r" ]]; then - printf "${ASCII_BOLD}${ASCII_GREEN}Successfully ran target '$MAKE_CURRENT_TARGET' for Capella version $version.${ASCII_RESET}\n" + printf "${ASCII_BOLD}${ASCII_GREEN}Successfully ran target '$MAKE_CURRENT_TARGET' for Capella version $version.${ASCII_RESET}\n" >&2 else - printf "${ASCII_BOLD}${ASCII_RED}Running target '$MAKE_CURRENT_TARGET' for Capella version $version failed. Please check the logs above.${ASCII_RESET}\n" + printf "${ASCII_BOLD}${ASCII_RED}Running target '$MAKE_CURRENT_TARGET' for Capella version $version failed. Please check the logs above.${ASCII_RESET}\n" >&2 exit $r fi done From 391b69ce666837d0a1531c1c102749ff5af1c805 Mon Sep 17 00:00:00 2001 From: MoritzWeber Date: Thu, 13 Apr 2023 13:44:25 +0200 Subject: [PATCH 03/15] ci: Use correct docker tag and include capella/base image --- .github/workflows/deploy-docker-images.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-docker-images.yml b/.github/workflows/deploy-docker-images.yml index 38d48a82..c86e75ca 100644 --- a/.github/workflows/deploy-docker-images.yml +++ b/.github/workflows/deploy-docker-images.yml @@ -9,7 +9,7 @@ on: env: registry: ghcr.io/dsd-dbs/capella-dockerimages/ - images: capella/remote capella/readonly capella/ease capella/cli + images: capella/base capella/cli capella/remote capella/ease capella/readonly jobs: deploy-docker-images: @@ -56,7 +56,7 @@ jobs: DOCKER_PREFIX="${{ env.registry }}" CAPELLA_DOCKERIMAGES_REVISION="${{ steps.tag.outputs.branch }}" CAPELLA_DROPINS="${{ matrix.dropins.dropins }}" - DOCKER_TAG_SCHEMA='${CAPELLA_VERSION}'-${{ matrix.dropins.name }}-'${CAPELLA_DOCKERIMAGES_REVISION}' + DOCKER_TAG_SCHEMA=${{ matrix.capella_version }}-${{ matrix.dropins.name }}-${{ steps.tag.outputs.branch }} DOCKER_BUILD_FLAGS="--label git-short-sha=${{ steps.tag.outputs.sha }}" - name: Install test dependencies run: | @@ -64,10 +64,10 @@ jobs: - name: Run pytest run: > DOCKER_PREFIX="${{ env.registry }}" - DOCKER_TAG="${{ matrix.capella_version }}-${{ steps.tag.outputs.branch }}" + DOCKER_TAG="${{ matrix.capella_version }}-${{ matrix.dropins.name }}-${{ steps.tag.outputs.branch }}" pytest -m "not (t4c_server or t4c)" tests - name: Push run: | for image in ${{ env.images }} - do docker push "${{ env.registry }}$image:${{ matrix.capella_version }}-${{ steps.tag.outputs.branch }}" + do docker push "${{ env.registry }}$image:${{ matrix.capella_version }}-${{ matrix.dropins.name }}-${{ steps.tag.outputs.branch }} done From c362ea74b25e8dc33c311d53b359692cc44a38a1 Mon Sep 17 00:00:00 2001 From: MoritzWeber Date: Thu, 13 Apr 2023 16:34:13 +0200 Subject: [PATCH 04/15] feat: Add list of available dropins --- .github/workflows/deploy-docker-images.yml | 2 +- Makefile | 11 ++++ capella/Dockerfile | 4 ++ capella/install_dropins.py | 63 ++++++++++++++++++++++ capella/versions/5.0.0/dropins.yml | 42 +++++++++++++++ capella/versions/5.2.0/dropins.yml | 42 +++++++++++++++ capella/versions/6.0.0/dropins.yml | 42 +++++++++++++++ 7 files changed, 205 insertions(+), 1 deletion(-) create mode 100644 capella/install_dropins.py create mode 100644 capella/versions/5.0.0/dropins.yml create mode 100644 capella/versions/5.2.0/dropins.yml create mode 100644 capella/versions/6.0.0/dropins.yml diff --git a/.github/workflows/deploy-docker-images.yml b/.github/workflows/deploy-docker-images.yml index c86e75ca..11b38e0d 100644 --- a/.github/workflows/deploy-docker-images.yml +++ b/.github/workflows/deploy-docker-images.yml @@ -69,5 +69,5 @@ jobs: - name: Push run: | for image in ${{ env.images }} - do docker push "${{ env.registry }}$image:${{ matrix.capella_version }}-${{ matrix.dropins.name }}-${{ steps.tag.outputs.branch }} + do docker push "${{ env.registry }}$image:${{ matrix.capella_version }}-${{ matrix.dropins.name }}-${{ steps.tag.outputs.branch }}" done diff --git a/Makefile b/Makefile index 8b4a3c19..f85f334c 100644 --- a/Makefile +++ b/Makefile @@ -73,6 +73,10 @@ export CAPELLA_VERSIONS ?= 5.0.0 5.2.0 6.0.0 # Capella version used to run containers export CAPELLA_VERSION ?= 6.0.0 +# Comma-separated list of dropins to download & add, doesn't affect copied & mounted dropins +# See available options in documentation. +CAPELLA_DROPINS ?= CapellaXHTMLDocGen,DiagramStyler,PVMT,Filtering,Requirements,SubsystemTransition,TextualEditor + # Only use when "capella_loop.sh" is NOT used export DOCKER_TAG_SCHEMA ?= $$CAPELLA_VERSION-$$CAPELLA_DOCKERIMAGES_REVISION @@ -167,6 +171,7 @@ capella/base: base --build-arg BASE_IMAGE=$(DOCKER_PREFIX)$<:$(CAPELLA_DOCKERIMAGES_REVISION) \ --build-arg BUILD_TYPE=$(CAPELLA_BUILD_TYPE) \ --build-arg CAPELLA_VERSION=$$CAPELLA_VERSION \ + --build-arg "CAPELLA_DROPINS=$(CAPELLA_DROPINS)" \ --build-arg INSTALL_OLD_GTK_VERSION=$(INSTALL_OLD_GTK_VERSION) \ capella rm capella/.dockerignore @@ -243,6 +248,10 @@ capella/builder: docker build $(DOCKER_BUILD_FLAGS) -t $(DOCKER_PREFIX)$@:$(CAPELLA_DOCKERIMAGES_REVISION) builder docker run -it -e CAPELLA_VERSION=$(CAPELLA_VERSION) -v $$(pwd)/builder/output/$(CAPELLA_VERSION):/output -v $$(pwd)/builder/m2_cache:/root/.m2/repository $(DOCKER_PREFIX)$@:$(CAPELLA_DOCKERIMAGES_REVISION) +run-capella/base: capella/base + docker run $(DOCKER_RUN_FLAGS) \ + $(DOCKER_PREFIX)capella/base:$$(echo "$(DOCKER_TAG_SCHEMA)" | envsubst) + run-capella/readonly: capella/readonly docker run $(DOCKER_RUN_FLAGS) \ -p $(RDP_PORT):3389 \ @@ -351,6 +360,8 @@ run-t4c/client/exporter: t4c/client/exporter -e LOG_LEVEL="$(LOG_LEVEL)" \ $(DOCKER_PREFIX)t4c/client/exporter:$(echo "$(DOCKER_TAG_SCHEMA)" | envsubst) +debug-capella/base: DOCKER_RUN_FLAGS=-it --entrypoint="bash" +debug-capella/base: run-capella/base debug-t4c/client/backup: LOG_LEVEL=DEBUG debug-t4c/client/backup: DOCKER_RUN_FLAGS=-it --entrypoint="bash" -v $$(pwd)/backups/backup.py:/opt/capella/backup.py diff --git a/capella/Dockerfile b/capella/Dockerfile index e4aba45d..a9ab8fbe 100644 --- a/capella/Dockerfile +++ b/capella/Dockerfile @@ -92,6 +92,10 @@ RUN chmod +x capella/capella && \ # Install Dropins for Capella COPY ./versions/${CAPELLA_VERSION}/dropins /opt/capella/dropins +ARG CAPELLA_DROPINS="" +COPY install_dropins.py /opt/install_dropins.py +COPY ./versions/${CAPELLA_VERSION}/dropins.yml /opt/dropins.yml +RUN pip install PyYAML && python install_dropins.py # Eclipse settings RUN mkdir -p /opt/capella/configuration/.settings; \ diff --git a/capella/install_dropins.py b/capella/install_dropins.py new file mode 100644 index 00000000..d2df8570 --- /dev/null +++ b/capella/install_dropins.py @@ -0,0 +1,63 @@ +# SPDX-FileCopyrightText: Copyright DB Netz AG and the capella-collab-manager contributors +# SPDX-License-Identifier: Apache-2.0 + +import os +import pathlib +import subprocess +import typing as t + +import yaml + + +def load_dropins() -> dict[str, t.Any]: + return yaml.safe_load( + pathlib.Path("/opt/dropins.yml").read_text(encoding="utf-8") + )["dropins"] + + +def extract_repositories_and_installIUs( + dropins: dict[str, t.Any] +) -> tuple[list[str], list[str]]: + repositories = [] + install_iu = [] + + for dropin_slug in os.getenv("CAPELLA_DROPINS", "").split(","): + if not dropin_slug: + continue + + if not dropin_slug in dropins: + raise KeyError( + f"Dropin '{dropin_slug}' not found in list of supported dropins." + ) + + dropin = dropins[dropin_slug] + + repositories.append(dropin["eclipseRepository"]) + install_iu += dropin["installIU"] + + return repositories, install_iu + + +def install_update_sites(repositories: list[str], install_ui: list[str]): + subprocess.run( + [ + "/opt/capella/capella", + "-consoleLog", + "-application", + "org.eclipse.equinox.p2.director", + "-noSplash", + "-repository", + ",".join(repositories), + "-installIU", + ",".join(install_ui), + ], + check=True, + ) + + +if __name__ == "__main__": + dropins = load_dropins() + repositories, install_ui = extract_repositories_and_installIUs(dropins) + + if repositories: + install_update_sites(repositories, install_ui) diff --git a/capella/versions/5.0.0/dropins.yml b/capella/versions/5.0.0/dropins.yml new file mode 100644 index 00000000..3a99fc57 --- /dev/null +++ b/capella/versions/5.0.0/dropins.yml @@ -0,0 +1,42 @@ +# SPDX-FileCopyrightText: Copyright DB Netz AG and the capella-collab-manager contributors +# SPDX-License-Identifier: Apache-2.0 + +dropins: + CapellaXHTMLDocGen: + github: "https://github.com/eclipse/capella-xhtml-docgen" + eclipseRepository: "https://download.eclipse.org/capella/addons/xhtmldocgen/updates/releases/5.0.0/" + installIU: + - "org.polarsys.capella.docgen.package.feature.feature.group" + DiagramStyler: + github: "https://github.com/eclipse/capella/wiki/PVMT" + eclipseRepository: "jar:https://artifactory.thalesdigital.io/ui/api/v1/download?repoKey=mvn-public&path=com%252Fthalesgroup%252Fmde%252Fcapella%252Fdiagramstyler%252Fcom.thalesgroup.mde.capella.diagramstyler.repository%252F50.3.1%252Fcom.thalesgroup.mde.capella.diagramstyler.repository-50.3.1.zip!/" + installIU: + - "com.thalesgroup.mde.capella.diagramstyler.feature.feature.group" + PVMT: + github: "https://github.com/eclipse/capella/wiki/PVMT" + eclipseRepository: "jar:https://artifactory.thalesdigital.io/ui/api/v1/download?repoKey=mvn-public&path=com%252Fthalesgroup%252Fvpd%252Fproperty%252Fcom.thalesgroup.vpd.property.repository%252F50.5.1%252Fcom.thalesgroup.vpd.property.repository-50.5.1.zip!/" + installIU: + # - "com.thalesgroup.vpd.property.cdo.feature.feature.group" # PVMT CDO (requires net4j) + - "com.thalesgroup.vpd.property.feature.feature.group" # PVMT Feature + # - "com.thalesgroup.vpd.property.contextualexplorer.feature.feature.group" # PVMT ContextualExplorer extension (requires org.eclipse.amalgam.explorer.contextual.ui) + Filtering: + github: "https://github.com/eclipse/capella-filtering" + eclipseRepository: "jar:https://download.eclipse.org/capella/addons/filtering/updates/releases/1.5.1/Filtering-updateSite-1.5.1.202104270742.zip!/" + installIU: + - "org.polarsys.capella.filtering.feature.feature.group" + # - "org.polarsys.capella.filtering.cdo.feature.feature.group" + Requirements: + github: "https://github.com/eclipse/capella-requirements-vp" + eclipseRepository: "jar:https://download.eclipse.org/capella/addons/requirements/updates/releases/0.12.3/Requirements-updateSite-0.12.3.202208111122.zip!/" + installIU: + - "org.polarsys.capella.vp.requirements.feature.feature.group" + SubsystemTransition: + github: "https://github.com/eclipse/capella-sss-transition" + eclipseRepository: "jar:https://download.eclipse.org/capella/addons/subsystemtransition/updates/releases/1.6.1/SubsystemTransition-updateSite-1.6.1.202302141252.zip!/" + installIU: + - "org.polarsys.capella.transition.system2subsystem.feature.feature.group" + TextualEditor: + github: "https://github.com/eclipse/capella-textual-editor" + eclipseRepository: "jar:https://download.eclipse.org/capella/addons/textualeditor/updates/releases/0.11.0/TextualEditor-updateSite-0.11.0.202208161352.zip!/" + installIU: + - "org.polarsys.capella.scenario.editor.feature.feature.group" diff --git a/capella/versions/5.2.0/dropins.yml b/capella/versions/5.2.0/dropins.yml new file mode 100644 index 00000000..46f3150e --- /dev/null +++ b/capella/versions/5.2.0/dropins.yml @@ -0,0 +1,42 @@ +# SPDX-FileCopyrightText: Copyright DB Netz AG and the capella-collab-manager contributors +# SPDX-License-Identifier: Apache-2.0 + +dropins: + CapellaXHTMLDocGen: + github: "https://github.com/eclipse/capella-xhtml-docgen" + eclipseRepository: "https://download.eclipse.org/capella/addons/xhtmldocgen/updates/releases/5.2.0/" + installIU: + - "org.polarsys.capella.docgen.package.feature.feature.group" + DiagramStyler: + github: "https://github.com/eclipse/capella/wiki/PVMT" + eclipseRepository: "jar:https://artifactory.thalesdigital.io/ui/api/v1/download?repoKey=mvn-public&path=com%252Fthalesgroup%252Fmde%252Fcapella%252Fdiagramstyler%252Fcom.thalesgroup.mde.capella.diagramstyler.repository%252F50.3.1%252Fcom.thalesgroup.mde.capella.diagramstyler.repository-50.3.1.zip!/" + installIU: + - "com.thalesgroup.mde.capella.diagramstyler.feature.feature.group" + PVMT: + github: "https://github.com/eclipse/capella/wiki/PVMT" + eclipseRepository: "jar:https://artifactory.thalesdigital.io/ui/api/v1/download?repoKey=mvn-public&path=com%252Fthalesgroup%252Fvpd%252Fproperty%252Fcom.thalesgroup.vpd.property.repository%252F50.5.1%252Fcom.thalesgroup.vpd.property.repository-50.5.1.zip!/" + installIU: + # - "com.thalesgroup.vpd.property.cdo.feature.feature.group" # PVMT CDO (requires net4j) + - "com.thalesgroup.vpd.property.feature.feature.group" # PVMT Feature + # - "com.thalesgroup.vpd.property.contextualexplorer.feature.feature.group" # PVMT ContextualExplorer extension (requires org.eclipse.amalgam.explorer.contextual.ui) + Filtering: + github: "https://github.com/eclipse/capella-filtering" + eclipseRepository: "jar:https://download.eclipse.org/capella/addons/filtering/updates/releases/1.5.2/iltering-updateSite-1.5.2.202111091404.zip!/" + installIU: + - "org.polarsys.capella.filtering.feature.feature.group" + # - "org.polarsys.capella.filtering.cdo.feature.feature.group" + Requirements: + github: "https://github.com/eclipse/capella-requirements-vp" + eclipseRepository: "jar:https://download.eclipse.org/capella/addons/requirements/updates/releases/0.12.3/Requirements-updateSite-0.12.3.202208111122.zip!/" + installIU: + - "org.polarsys.capella.vp.requirements.feature.feature.group" + SubsystemTransition: + github: "https://github.com/eclipse/capella-sss-transition" + eclipseRepository: "jar:https://download.eclipse.org/capella/addons/subsystemtransition/updates/releases/1.6.1/SubsystemTransition-updateSite-1.6.1.202302141252.zip!/" + installIU: + - "org.polarsys.capella.transition.system2subsystem.feature.feature.group" + TextualEditor: + github: "https://github.com/eclipse/capella-textual-editor" + eclipseRepository: "jar:https://download.eclipse.org/capella/addons/textualeditor/updates/releases/0.11.0/TextualEditor-updateSite-0.11.0.202208161352.zip!/" + installIU: + - "org.polarsys.capella.scenario.editor.feature.feature.group" diff --git a/capella/versions/6.0.0/dropins.yml b/capella/versions/6.0.0/dropins.yml new file mode 100644 index 00000000..27b98e03 --- /dev/null +++ b/capella/versions/6.0.0/dropins.yml @@ -0,0 +1,42 @@ +# SPDX-FileCopyrightText: Copyright DB Netz AG and the capella-collab-manager contributors +# SPDX-License-Identifier: Apache-2.0 + +dropins: + CapellaXHTMLDocGen: + github: "https://github.com/eclipse/capella-xhtml-docgen" + eclipseRepository: "https://download.eclipse.org/capella/addons/xhtmldocgen/updates/releases/6.0.0/" + installIU: + - "org.polarsys.capella.docgen.package.feature.feature.group" + DiagramStyler: + github: "https://github.com/eclipse/capella/wiki/PVMT" + eclipseRepository: "jar:https://artifactory.thalesdigital.io/ui/api/v1/download?repoKey=mvn-public&path=com%252Fthalesgroup%252Fmde%252Fcapella%252Fdiagramstyler%252Fcom.thalesgroup.mde.capella.diagramstyler.repository%252F60.3.1%252Fcom.thalesgroup.mde.capella.diagramstyler.repository-60.3.1.zip!/" + installIU: + - "com.thalesgroup.mde.capella.diagramstyler.feature.feature.group" + PVMT: + github: "https://github.com/eclipse/capella/wiki/PVMT" + eclipseRepository: "jar:https://artifactory.thalesdigital.io/ui/api/v1/download?repoKey=mvn-public&path=com%252Fthalesgroup%252Fvpd%252Fproperty%252Fcom.thalesgroup.vpd.property.repository%252F60.7.0%252Fcom.thalesgroup.vpd.property.repository-60.7.0.zip!/" + installIU: + # - "com.thalesgroup.vpd.property.cdo.feature.feature.group" # PVMT CDO (requires net4j) + - "com.thalesgroup.vpd.property.feature.feature.group" # PVMT Feature + # - "com.thalesgroup.vpd.property.contextualexplorer.feature.feature.group" # PVMT ContextualExplorer extension (requires org.eclipse.amalgam.explorer.contextual.ui) + Filtering: + github: "https://github.com/eclipse/capella-filtering" + eclipseRepository: "jar:https://download.eclipse.org/capella/addons/filtering/updates/releases/1.6.0/Filtering-updateSite-1.6.0.202206090715.zip!/" + installIU: + - "org.polarsys.capella.filtering.feature.feature.group" + # - "org.polarsys.capella.filtering.cdo.feature.feature.group" + Requirements: + github: "https://github.com/eclipse/capella-requirements-vp" + eclipseRepository: "jar:https://download.eclipse.org/capella/addons/requirements/updates/releases/0.13.1/Requirements-updateSite-0.13.1.202303011400.zip!/" + installIU: + - "org.polarsys.capella.vp.requirements.feature.feature.group" + SubsystemTransition: + github: "https://github.com/eclipse/capella-sss-transition" + eclipseRepository: "jar:https://download.eclipse.org/capella/addons/subsystemtransition/updates/releases/1.6.1/SubsystemTransition-updateSite-1.6.1.202302141252.zip!/" + installIU: + - "org.polarsys.capella.transition.system2subsystem.feature.feature.group" + TextualEditor: + github: "https://github.com/eclipse/capella-textual-editor" + eclipseRepository: "jar:https://download.eclipse.org/capella/addons/textualeditor/updates/releases/0.11.0/TextualEditor-updateSite-0.11.0.202208161352.zip!/" + installIU: + - "org.polarsys.capella.scenario.editor.feature.feature.group" From d99119dce24dc8bc514eb6091af553d34b9d2cec Mon Sep 17 00:00:00 2001 From: MoritzWeber Date: Thu, 13 Apr 2023 17:18:06 +0200 Subject: [PATCH 05/15] fix: Disable TextualEditor It's failing all the time... --- .github/workflows/deploy-docker-images.yml | 4 ++-- capella/install_dropins.py | 18 ++++++------------ 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/.github/workflows/deploy-docker-images.yml b/.github/workflows/deploy-docker-images.yml index 11b38e0d..5efbecad 100644 --- a/.github/workflows/deploy-docker-images.yml +++ b/.github/workflows/deploy-docker-images.yml @@ -25,9 +25,9 @@ jobs: - name: "no" # no dropins dropins: "" - name: "selected" - dropins: "CapellaXHTMLDocGen,DiagramStyler,Filtering,PVMT,Requirements,SubsystemTransition,TextualEditor" # selected set of dropins + dropins: "CapellaXHTMLDocGen,DiagramStyler,Filtering,PVMT,Requirements,SubsystemTransition" # selected set of dropins - name: "all" - dropins: "CapellaXHTMLDocGen,DiagramStyler,Filtering,PVMT,Requirements,SubsystemTransition,TextualEditor" # all open source dropins + dropins: "CapellaXHTMLDocGen,DiagramStyler,Filtering,PVMT,Requirements,SubsystemTransition" # all open source dropins name: Capella ${{ matrix.capella_version }} with ${{ matrix.dropins.name }} dropins steps: - name: Checkout repository diff --git a/capella/install_dropins.py b/capella/install_dropins.py index d2df8570..9aa40c41 100644 --- a/capella/install_dropins.py +++ b/capella/install_dropins.py @@ -18,9 +18,6 @@ def load_dropins() -> dict[str, t.Any]: def extract_repositories_and_installIUs( dropins: dict[str, t.Any] ) -> tuple[list[str], list[str]]: - repositories = [] - install_iu = [] - for dropin_slug in os.getenv("CAPELLA_DROPINS", "").split(","): if not dropin_slug: continue @@ -32,13 +29,10 @@ def extract_repositories_and_installIUs( dropin = dropins[dropin_slug] - repositories.append(dropin["eclipseRepository"]) - install_iu += dropin["installIU"] - - return repositories, install_iu + install_update_sites(dropin["eclipseRepository"], dropin["installIU"]) -def install_update_sites(repositories: list[str], install_ui: list[str]): +def install_update_sites(repository: str, install_ui: list[str]): subprocess.run( [ "/opt/capella/capella", @@ -47,7 +41,7 @@ def install_update_sites(repositories: list[str], install_ui: list[str]): "org.eclipse.equinox.p2.director", "-noSplash", "-repository", - ",".join(repositories), + repository, "-installIU", ",".join(install_ui), ], @@ -57,7 +51,7 @@ def install_update_sites(repositories: list[str], install_ui: list[str]): if __name__ == "__main__": dropins = load_dropins() - repositories, install_ui = extract_repositories_and_installIUs(dropins) + extract_repositories_and_installIUs(dropins) - if repositories: - install_update_sites(repositories, install_ui) + # if repositories: + # install_update_sites(repositories, install_ui) From c747eca3fcb3b49ba75419046b485e145f3b24e7 Mon Sep 17 00:00:00 2001 From: MoritzWeber Date: Thu, 13 Apr 2023 17:25:03 +0200 Subject: [PATCH 06/15] fix: Typo in eclipseRepository of filtering --- capella/versions/5.2.0/dropins.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/capella/versions/5.2.0/dropins.yml b/capella/versions/5.2.0/dropins.yml index 46f3150e..fc2130c2 100644 --- a/capella/versions/5.2.0/dropins.yml +++ b/capella/versions/5.2.0/dropins.yml @@ -21,7 +21,7 @@ dropins: # - "com.thalesgroup.vpd.property.contextualexplorer.feature.feature.group" # PVMT ContextualExplorer extension (requires org.eclipse.amalgam.explorer.contextual.ui) Filtering: github: "https://github.com/eclipse/capella-filtering" - eclipseRepository: "jar:https://download.eclipse.org/capella/addons/filtering/updates/releases/1.5.2/iltering-updateSite-1.5.2.202111091404.zip!/" + eclipseRepository: "jar:https://download.eclipse.org/capella/addons/filtering/updates/releases/1.5.2/Filtering-updateSite-1.5.2.202111091404.zip!/" installIU: - "org.polarsys.capella.filtering.feature.feature.group" # - "org.polarsys.capella.filtering.cdo.feature.feature.group" From 8ba0dbae8336685825740e30a77401ea31e9d6bf Mon Sep 17 00:00:00 2001 From: MoritzWeber Date: Thu, 13 Apr 2023 17:45:06 +0200 Subject: [PATCH 07/15] fix: Increase read timeout --- capella/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/capella/Dockerfile b/capella/Dockerfile index a9ab8fbe..c7d3f657 100644 --- a/capella/Dockerfile +++ b/capella/Dockerfile @@ -95,6 +95,8 @@ COPY ./versions/${CAPELLA_VERSION}/dropins /opt/capella/dropins ARG CAPELLA_DROPINS="" COPY install_dropins.py /opt/install_dropins.py COPY ./versions/${CAPELLA_VERSION}/dropins.yml /opt/dropins.yml +RUN echo '-Dorg.eclipse.equinox.p2.transport.ecf.retry=15' >> /opt/capella/capella.ini +RUN echo '-Dorg.eclipse.ecf.provider.filetransfer.retrieve.readTimeout=10000' >> /opt/capella/capella.ini RUN pip install PyYAML && python install_dropins.py # Eclipse settings From 2e02914267c5614be0e783eecee8c786a279eb70 Mon Sep 17 00:00:00 2001 From: MoritzWeber Date: Mon, 24 Apr 2023 12:22:35 +0200 Subject: [PATCH 08/15] fix: Add dropins as techuser --- capella/Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/capella/Dockerfile b/capella/Dockerfile index c7d3f657..b9a05baa 100644 --- a/capella/Dockerfile +++ b/capella/Dockerfile @@ -91,6 +91,8 @@ RUN chmod +x capella/capella && \ chown -R techuser /opt/capella # Install Dropins for Capella +USER techuser + COPY ./versions/${CAPELLA_VERSION}/dropins /opt/capella/dropins ARG CAPELLA_DROPINS="" COPY install_dropins.py /opt/install_dropins.py @@ -99,6 +101,8 @@ RUN echo '-Dorg.eclipse.equinox.p2.transport.ecf.retry=15' >> /opt/capella/capel RUN echo '-Dorg.eclipse.ecf.provider.filetransfer.retrieve.readTimeout=10000' >> /opt/capella/capella.ini RUN pip install PyYAML && python install_dropins.py +USER root + # Eclipse settings RUN mkdir -p /opt/capella/configuration/.settings; \ ## Do not show WORKSPACE_SELECTION_DIALOG From 0938c1e3f709825f539151acb1b693bc4028f6cf Mon Sep 17 00:00:00 2001 From: MoritzWeber Date: Mon, 24 Apr 2023 12:24:01 +0200 Subject: [PATCH 09/15] refactor: Remove unused comments --- capella/versions/5.0.0/dropins.yml | 5 +---- capella/versions/5.2.0/dropins.yml | 5 +---- capella/versions/6.0.0/dropins.yml | 5 +---- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/capella/versions/5.0.0/dropins.yml b/capella/versions/5.0.0/dropins.yml index 3a99fc57..0cbe0462 100644 --- a/capella/versions/5.0.0/dropins.yml +++ b/capella/versions/5.0.0/dropins.yml @@ -16,15 +16,12 @@ dropins: github: "https://github.com/eclipse/capella/wiki/PVMT" eclipseRepository: "jar:https://artifactory.thalesdigital.io/ui/api/v1/download?repoKey=mvn-public&path=com%252Fthalesgroup%252Fvpd%252Fproperty%252Fcom.thalesgroup.vpd.property.repository%252F50.5.1%252Fcom.thalesgroup.vpd.property.repository-50.5.1.zip!/" installIU: - # - "com.thalesgroup.vpd.property.cdo.feature.feature.group" # PVMT CDO (requires net4j) - - "com.thalesgroup.vpd.property.feature.feature.group" # PVMT Feature - # - "com.thalesgroup.vpd.property.contextualexplorer.feature.feature.group" # PVMT ContextualExplorer extension (requires org.eclipse.amalgam.explorer.contextual.ui) + - "com.thalesgroup.vpd.property.feature.feature.group" Filtering: github: "https://github.com/eclipse/capella-filtering" eclipseRepository: "jar:https://download.eclipse.org/capella/addons/filtering/updates/releases/1.5.1/Filtering-updateSite-1.5.1.202104270742.zip!/" installIU: - "org.polarsys.capella.filtering.feature.feature.group" - # - "org.polarsys.capella.filtering.cdo.feature.feature.group" Requirements: github: "https://github.com/eclipse/capella-requirements-vp" eclipseRepository: "jar:https://download.eclipse.org/capella/addons/requirements/updates/releases/0.12.3/Requirements-updateSite-0.12.3.202208111122.zip!/" diff --git a/capella/versions/5.2.0/dropins.yml b/capella/versions/5.2.0/dropins.yml index fc2130c2..55068f18 100644 --- a/capella/versions/5.2.0/dropins.yml +++ b/capella/versions/5.2.0/dropins.yml @@ -16,15 +16,12 @@ dropins: github: "https://github.com/eclipse/capella/wiki/PVMT" eclipseRepository: "jar:https://artifactory.thalesdigital.io/ui/api/v1/download?repoKey=mvn-public&path=com%252Fthalesgroup%252Fvpd%252Fproperty%252Fcom.thalesgroup.vpd.property.repository%252F50.5.1%252Fcom.thalesgroup.vpd.property.repository-50.5.1.zip!/" installIU: - # - "com.thalesgroup.vpd.property.cdo.feature.feature.group" # PVMT CDO (requires net4j) - - "com.thalesgroup.vpd.property.feature.feature.group" # PVMT Feature - # - "com.thalesgroup.vpd.property.contextualexplorer.feature.feature.group" # PVMT ContextualExplorer extension (requires org.eclipse.amalgam.explorer.contextual.ui) + - "com.thalesgroup.vpd.property.feature.feature.group" Filtering: github: "https://github.com/eclipse/capella-filtering" eclipseRepository: "jar:https://download.eclipse.org/capella/addons/filtering/updates/releases/1.5.2/Filtering-updateSite-1.5.2.202111091404.zip!/" installIU: - "org.polarsys.capella.filtering.feature.feature.group" - # - "org.polarsys.capella.filtering.cdo.feature.feature.group" Requirements: github: "https://github.com/eclipse/capella-requirements-vp" eclipseRepository: "jar:https://download.eclipse.org/capella/addons/requirements/updates/releases/0.12.3/Requirements-updateSite-0.12.3.202208111122.zip!/" diff --git a/capella/versions/6.0.0/dropins.yml b/capella/versions/6.0.0/dropins.yml index 27b98e03..e6e71820 100644 --- a/capella/versions/6.0.0/dropins.yml +++ b/capella/versions/6.0.0/dropins.yml @@ -16,15 +16,12 @@ dropins: github: "https://github.com/eclipse/capella/wiki/PVMT" eclipseRepository: "jar:https://artifactory.thalesdigital.io/ui/api/v1/download?repoKey=mvn-public&path=com%252Fthalesgroup%252Fvpd%252Fproperty%252Fcom.thalesgroup.vpd.property.repository%252F60.7.0%252Fcom.thalesgroup.vpd.property.repository-60.7.0.zip!/" installIU: - # - "com.thalesgroup.vpd.property.cdo.feature.feature.group" # PVMT CDO (requires net4j) - - "com.thalesgroup.vpd.property.feature.feature.group" # PVMT Feature - # - "com.thalesgroup.vpd.property.contextualexplorer.feature.feature.group" # PVMT ContextualExplorer extension (requires org.eclipse.amalgam.explorer.contextual.ui) + - "com.thalesgroup.vpd.property.feature.feature.group" Filtering: github: "https://github.com/eclipse/capella-filtering" eclipseRepository: "jar:https://download.eclipse.org/capella/addons/filtering/updates/releases/1.6.0/Filtering-updateSite-1.6.0.202206090715.zip!/" installIU: - "org.polarsys.capella.filtering.feature.feature.group" - # - "org.polarsys.capella.filtering.cdo.feature.feature.group" Requirements: github: "https://github.com/eclipse/capella-requirements-vp" eclipseRepository: "jar:https://download.eclipse.org/capella/addons/requirements/updates/releases/0.13.1/Requirements-updateSite-0.13.1.202303011400.zip!/" From 46a8107b91f5085cf8cc7abcde1c4789d1ad569f Mon Sep 17 00:00:00 2001 From: MoritzWeber Date: Mon, 24 Apr 2023 12:27:24 +0200 Subject: [PATCH 10/15] ci: Only build without and selected dropins versions --- .github/workflows/deploy-docker-images.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-docker-images.yml b/.github/workflows/deploy-docker-images.yml index 5efbecad..bf34879b 100644 --- a/.github/workflows/deploy-docker-images.yml +++ b/.github/workflows/deploy-docker-images.yml @@ -22,12 +22,10 @@ jobs: - "6.0.0" - "6.1.0" dropins: - - name: "no" # no dropins + - name: "without-dropins" # without dropins dropins: "" - - name: "selected" - dropins: "CapellaXHTMLDocGen,DiagramStyler,Filtering,PVMT,Requirements,SubsystemTransition" # selected set of dropins - - name: "all" - dropins: "CapellaXHTMLDocGen,DiagramStyler,Filtering,PVMT,Requirements,SubsystemTransition" # all open source dropins + - name: "selected-dropins" + dropins: "CapellaXHTMLDocGen,DiagramStyler,PVMT,Filtering,Requirements,SubsystemTransition" # selected set of dropins name: Capella ${{ matrix.capella_version }} with ${{ matrix.dropins.name }} dropins steps: - name: Checkout repository From 354f8f796075643e1f347f8600a1731868389ec4 Mon Sep 17 00:00:00 2001 From: MoritzWeber Date: Mon, 24 Apr 2023 18:37:20 +0200 Subject: [PATCH 11/15] docs: Add dropins to documentation --- .github/workflows/deploy-docker-images.yml | 2 +- docs/docs/capella/base.md | 23 ++++++++++++++++++++++ docs/docs/capella/introduction.md | 22 ++++++++++++++++++++- 3 files changed, 45 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-docker-images.yml b/.github/workflows/deploy-docker-images.yml index bf34879b..8896d42a 100644 --- a/.github/workflows/deploy-docker-images.yml +++ b/.github/workflows/deploy-docker-images.yml @@ -5,7 +5,7 @@ name: Build & push images on: push: pull_request: - branches: [main, staging] + branches: ["main"] env: registry: ghcr.io/dsd-dbs/capella-dockerimages/ diff --git a/docs/docs/capella/base.md b/docs/docs/capella/base.md index a53f139d..8cb35558 100644 --- a/docs/docs/capella/base.md +++ b/docs/docs/capella/base.md @@ -68,6 +68,29 @@ To customise the Capella client you can 1. apply any modifications (e. g. installation of plugins and/ or dropins) to it, and 1. compress the modified folder `capella` to get a `capella.zip` or `capella.tar.gz` again. +##### Install dropins + +As alternative to the solution presented above, we provide an interface to install dropins easily. + +You have to pass a comma-separated list of dropin names as `CAPELLA_DROPINS` build argument to the `docker build` command: + +```zsh +--build-arg CAPELLA_DROPINS="CapellaXHTMLDocGen,DiagramStyler,PVMT,Filtering,Requirements,SubsystemTransition" +``` + +Supported dropins are: + +- [CapellaXHTMLDocGen](https://github.com/eclipse/capella-xhtml-docgen) +- [DiagramStyler](https://github.com/eclipse/capella/wiki/PVMT) +- [PVMT](https://github.com/eclipse/capella/wiki/PVMT) +- [Filtering](https://github.com/eclipse/capella-filtering) +- [Requirements](https://github.com/eclipse/capella-requirements-vp) +- [SubsystemTransition](https://github.com/eclipse/capella-sss-transition) +- [TextualEditor](https://github.com/eclipse/capella-textual-editor) + +The dropins are registered in the `capella/versions/$CAPELLA_VERSION/dropins.yml` file. +If you're missing a dropin in the list, feel free to open a PR. + #### Optional: Workaround of pinned library versions to remove incompatibilities **Note:** diff --git a/docs/docs/capella/introduction.md b/docs/docs/capella/introduction.md index 327f42ab..9e4bf94e 100644 --- a/docs/docs/capella/introduction.md +++ b/docs/docs/capella/introduction.md @@ -14,13 +14,33 @@ Currently, we support Capella versions `5.0.0`, `5.2.0`, `6.0.0`, and `6.1.0`. Currently, we support amd64 for all supported Capella version. In addition, we added support for arm64 starting with Capella `6.0.0`. +## Supported dropins + +Starting with version `v1.11.0`, we have prebuilt images with a pre-selected sets of dropins. Available options are: + +- `without-dropins`: Without dropins +- `selected-dropins`: With + [CapellaXHTMLDocGen](https://github.com/eclipse/capella-xhtml-docgen), + [DiagramStyler](https://github.com/eclipse/capella/wiki/PVMT), + [PVMT](https://github.com/eclipse/capella/wiki/PVMT), + [Filtering](https://github.com/eclipse/capella-filtering), + [Requirements](https://github.com/eclipse/capella-requirements-vp) and + [SubsystemTransition](https://github.com/eclipse/capella-sss-transition) + +If you need a custom set of dropins, you have two options: + +**Option 1**: Mount a dropins folder with additional dropins into `/opt/capella/dropins` when starting the container. + +**Option 2**: Build the `capella/base` Docker image manually. More information: [Build it yourself](./base.md#build-it-yourself) + ## Tagging schema for prebuilt images The Capella related images are tagged using the following schema: -`$CAPELLA_VERSION-$CAPELLA_DOCKER_IMAGES_REVISION`, e.g., `6.0.0-v1.10.2` for Capella version `6.0.0` and Capella Docker images revision `v1.10.2`. +`$CAPELLA_VERSION-$DROPINS_TYPE-$CAPELLA_DOCKER_IMAGES_REVISION`, e.g., `6.0.0-selected-dropins-v1.10.2` for Capella version `6.0.0` with selected dropins and Capella Docker images revision `v1.10.2`. `$CAPELLA_VERSION` is the semantic version of Capella (see supported versions [above](#supported-versions)). +`$DROPINS_TYPE` is the name of the set of dropins. `$CAPELLA_DOCKER_IMAGES_REVISION` can be a tag or branch of this repository. In case of branches, all characters matching the regex `[^a-zA-Z0-9.]` will be replaced with `-`. We don't tag images with the `latest` tag. You may want to use `$CAPELLA_VERSION-main` for the latest version, but we recommend using tags for the best stability. From 09b3b4c00003f250d7d8544fb0f0a1109709aa19 Mon Sep 17 00:00:00 2001 From: MoritzWeber Date: Thu, 4 May 2023 14:13:20 +0200 Subject: [PATCH 12/15] docs: Add link to documentation for dropins --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f85f334c..37b85d68 100644 --- a/Makefile +++ b/Makefile @@ -74,7 +74,7 @@ export CAPELLA_VERSIONS ?= 5.0.0 5.2.0 6.0.0 export CAPELLA_VERSION ?= 6.0.0 # Comma-separated list of dropins to download & add, doesn't affect copied & mounted dropins -# See available options in documentation. +# See available options in documentation: https://dsd-dbs.github.io/capella-dockerimages/capella/base/#optional-customisation-of-the-capella-client CAPELLA_DROPINS ?= CapellaXHTMLDocGen,DiagramStyler,PVMT,Filtering,Requirements,SubsystemTransition,TextualEditor # Only use when "capella_loop.sh" is NOT used From 8f91ee4862b05beafbabf5e584e8a59923faff7d Mon Sep 17 00:00:00 2001 From: MoritzWeber Date: Thu, 4 May 2023 14:15:10 +0200 Subject: [PATCH 13/15] refactor: Remove unused comments --- capella/install_dropins.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/capella/install_dropins.py b/capella/install_dropins.py index 9aa40c41..88db58c4 100644 --- a/capella/install_dropins.py +++ b/capella/install_dropins.py @@ -15,9 +15,7 @@ def load_dropins() -> dict[str, t.Any]: )["dropins"] -def extract_repositories_and_installIUs( - dropins: dict[str, t.Any] -) -> tuple[list[str], list[str]]: +def extract_repositories_and_installIUs(dropins: dict[str, t.Any]) -> None: for dropin_slug in os.getenv("CAPELLA_DROPINS", "").split(","): if not dropin_slug: continue @@ -52,6 +50,3 @@ def install_update_sites(repository: str, install_ui: list[str]): if __name__ == "__main__": dropins = load_dropins() extract_repositories_and_installIUs(dropins) - - # if repositories: - # install_update_sites(repositories, install_ui) From e5feff5ec8496c09bf6e8797f88e9087fe58774d Mon Sep 17 00:00:00 2001 From: MoritzWeber Date: Thu, 4 May 2023 14:19:26 +0200 Subject: [PATCH 14/15] feat: Add dropins for Capella 6.1.0 --- capella/versions/6.1.0/dropins.yml | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 capella/versions/6.1.0/dropins.yml diff --git a/capella/versions/6.1.0/dropins.yml b/capella/versions/6.1.0/dropins.yml new file mode 100644 index 00000000..f2359c19 --- /dev/null +++ b/capella/versions/6.1.0/dropins.yml @@ -0,0 +1,34 @@ +# SPDX-FileCopyrightText: Copyright DB Netz AG and the capella-collab-manager contributors +# SPDX-License-Identifier: Apache-2.0 + +dropins: + CapellaXHTMLDocGen: + github: "https://github.com/eclipse/capella-xhtml-docgen" + eclipseRepository: "https://download.eclipse.org/capella/addons/xhtmldocgen/updates/releases/6.1.0/" + installIU: + - "org.polarsys.capella.docgen.package.feature.feature.group" + DiagramStyler: + github: "https://github.com/eclipse/capella/wiki/PVMT" + eclipseRepository: "jar:https://artifactory.thalesdigital.io/ui/api/v1/download?repoKey=mvn-public&path=com%252Fthalesgroup%252Fmde%252Fcapella%252Fdiagramstyler%252Fcom.thalesgroup.mde.capella.diagramstyler.repository%252F60.3.1%252Fcom.thalesgroup.mde.capella.diagramstyler.repository-60.3.1.zip!/" + installIU: + - "com.thalesgroup.mde.capella.diagramstyler.feature.feature.group" + PVMT: + github: "https://github.com/eclipse/capella/wiki/PVMT" + eclipseRepository: "jar:https://artifactory.thalesdigital.io/ui/api/v1/download?repoKey=mvn-public&path=com%252Fthalesgroup%252Fvpd%252Fproperty%252Fcom.thalesgroup.vpd.property.repository%252F60.7.0%252Fcom.thalesgroup.vpd.property.repository-60.7.0.zip!/" + installIU: + - "com.thalesgroup.vpd.property.feature.feature.group" + Filtering: + github: "https://github.com/eclipse/capella-filtering" + eclipseRepository: "jar:https://download.eclipse.org/capella/addons/filtering/updates/releases/1.6.1/Filtering-updateSite-1.6.1.202303150855.zip!/" + installIU: + - "org.polarsys.capella.filtering.feature.feature.group" + Requirements: + github: "https://github.com/eclipse/capella-requirements-vp" + eclipseRepository: "jar:https://download.eclipse.org/capella/addons/requirements/updates/releases/0.13.1/Requirements-updateSite-0.13.1.202303011400.zip!/" + installIU: + - "org.polarsys.capella.vp.requirements.feature.feature.group" + SubsystemTransition: + github: "https://github.com/eclipse/capella-sss-transition" + eclipseRepository: "jar:https://download.eclipse.org/capella/addons/subsystemtransition/updates/releases/1.6.1/SubsystemTransition-updateSite-1.6.1.202302141252.zip!/" + installIU: + - "org.polarsys.capella.transition.system2subsystem.feature.feature.group" From 3820f062cce4a957b78f67df324ed96767e34795 Mon Sep 17 00:00:00 2001 From: MoritzWeber Date: Thu, 4 May 2023 14:22:19 +0200 Subject: [PATCH 15/15] ci: Rename name of dropins in matrix --- .github/workflows/deploy-docker-images.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-docker-images.yml b/.github/workflows/deploy-docker-images.yml index 8896d42a..1f4f1821 100644 --- a/.github/workflows/deploy-docker-images.yml +++ b/.github/workflows/deploy-docker-images.yml @@ -22,9 +22,9 @@ jobs: - "6.0.0" - "6.1.0" dropins: - - name: "without-dropins" # without dropins + - name: "without" # without dropins dropins: "" - - name: "selected-dropins" + - name: "selected" dropins: "CapellaXHTMLDocGen,DiagramStyler,PVMT,Filtering,Requirements,SubsystemTransition" # selected set of dropins name: Capella ${{ matrix.capella_version }} with ${{ matrix.dropins.name }} dropins steps: @@ -54,7 +54,7 @@ jobs: DOCKER_PREFIX="${{ env.registry }}" CAPELLA_DOCKERIMAGES_REVISION="${{ steps.tag.outputs.branch }}" CAPELLA_DROPINS="${{ matrix.dropins.dropins }}" - DOCKER_TAG_SCHEMA=${{ matrix.capella_version }}-${{ matrix.dropins.name }}-${{ steps.tag.outputs.branch }} + DOCKER_TAG_SCHEMA=${{ matrix.capella_version }}-${{ matrix.dropins.name }}-dropins-${{ steps.tag.outputs.branch }} DOCKER_BUILD_FLAGS="--label git-short-sha=${{ steps.tag.outputs.sha }}" - name: Install test dependencies run: | @@ -62,10 +62,10 @@ jobs: - name: Run pytest run: > DOCKER_PREFIX="${{ env.registry }}" - DOCKER_TAG="${{ matrix.capella_version }}-${{ matrix.dropins.name }}-${{ steps.tag.outputs.branch }}" + DOCKER_TAG="${{ matrix.capella_version }}-${{ matrix.dropins.name }}-dropins-${{ steps.tag.outputs.branch }}" pytest -m "not (t4c_server or t4c)" tests - name: Push run: | for image in ${{ env.images }} - do docker push "${{ env.registry }}$image:${{ matrix.capella_version }}-${{ matrix.dropins.name }}-${{ steps.tag.outputs.branch }}" + do docker push "${{ env.registry }}$image:${{ matrix.capella_version }}-${{ matrix.dropins.name }}-dropins-${{ steps.tag.outputs.branch }}" done