Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Papyrus and pipeline tests #206

Merged
merged 4 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ base:
base
$(MAKE) PUSH_IMAGES=$(PUSH_IMAGES) DOCKER_TAG=$(CAPELLA_DOCKERIMAGES_REVISION) IMAGENAME=$@ .push

base: SHELL=/bin/bash
jupyter-notebook: DOCKER_TAG=$(JUPYTER_NOTEBOOK_REVISION)
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
docker build $(DOCKER_BUILD_FLAGS) -t $(DOCKER_PREFIX)$@:$(DOCKER_TAG) jupyter-notebook
$(MAKE) PUSH_IMAGES=$(PUSH_IMAGES) DOCKER_TAG=$(DOCKER_TAG) IMAGENAME=$@ .push

capella/base: SHELL=./capella_loop.sh
capella/base: base
Expand All @@ -195,24 +195,25 @@ capella/base: base
rm capella/.dockerignore
$(MAKE) PUSH_IMAGES=$(PUSH_IMAGES) IMAGENAME=$@ .push

papyrus/base: DOCKER_TAG=$(PAPYRUS_VERSION)-$(CAPELLA_DOCKERIMAGES_REVISION)
papyrus/base: DOCKER_BUILD_FLAGS=--platform linux/amd64
papyrus/base: base
docker build $(DOCKER_BUILD_FLAGS) \
-t $(DOCKER_PREFIX)$@:$$DOCKER_TAG \
-t $(DOCKER_PREFIX)$@:$(DOCKER_TAG) \
--build-arg BASE_IMAGE=$(DOCKER_PREFIX)$<:$(CAPELLA_DOCKERIMAGES_REVISION) \
--build-arg PAPYRUS_VERSION=$(PAPYRUS_VERSION) \
papyrus
$(MAKE) PUSH_IMAGES=$(PUSH_IMAGES) IMAGENAME=$@ .push
$(MAKE) PUSH_IMAGES=$(PUSH_IMAGES) DOCKER_TAG=$(DOCKER_TAG) IMAGENAME=$@ .push

eclipse/remote: DOCKER_TAG=$(ECLIPSE_VERSION)-$(CAPELLA_DOCKERIMAGES_REVISION)
eclipse/base: DOCKER_TAG=$(ECLIPSE_VERSION)-$(CAPELLA_DOCKERIMAGES_REVISION)
eclipse/base: base
docker build $(DOCKER_BUILD_FLAGS) \
-t $(DOCKER_PREFIX)$@:$$DOCKER_TAG \
-t $(DOCKER_PREFIX)$@:$(DOCKER_TAG) \
--build-arg BUILD_ARCHITECTURE=$(BUILD_ARCHITECTURE) \
--build-arg BASE_IMAGE=$(DOCKER_PREFIX)$<:$(CAPELLA_DOCKERIMAGES_REVISION) \
--build-arg ECLIPSE_VERSION=$(ECLIPSE_VERSION) \
eclipse
$(MAKE) PUSH_IMAGES=$(PUSH_IMAGES) IMAGENAME=$@ .push
$(MAKE) PUSH_IMAGES=$(PUSH_IMAGES) DOCKER_TAG=$(DOCKER_TAG) IMAGENAME=$@ .push

capella/remote: SHELL=./capella_loop.sh
capella/remote: capella/base
Expand All @@ -223,27 +224,27 @@ papyrus/remote: DOCKER_TAG=$(PAPYRUS_VERSION)-$(CAPELLA_DOCKERIMAGES_REVISION)
papyrus/remote: DOCKER_BUILD_FLAGS=--platform linux/amd64
papyrus/remote: papyrus/base
docker build $(DOCKER_BUILD_FLAGS) \
-t $(DOCKER_PREFIX)$@:$$DOCKER_TAG \
--build-arg BASE_IMAGE=$(DOCKER_PREFIX)$<:$$DOCKER_TAG \
-t $(DOCKER_PREFIX)$@:$(DOCKER_TAG) \
--build-arg BASE_IMAGE=$(DOCKER_PREFIX)$<:$(DOCKER_TAG) \
remote
$(MAKE) PUSH_IMAGES=$(PUSH_IMAGES) IMAGENAME=$@ .push
$(MAKE) PUSH_IMAGES=$(PUSH_IMAGES) DOCKER_TAG=$(DOCKER_TAG) IMAGENAME=$@ .push

eclipse/remote: DOCKER_TAG=$(ECLIPSE_VERSION)-$(CAPELLA_DOCKERIMAGES_REVISION)
eclipse/remote: eclipse/base
docker build $(DOCKER_BUILD_FLAGS) \
-t $(DOCKER_PREFIX)$@:$$DOCKER_TAG \
--build-arg BASE_IMAGE=$(DOCKER_PREFIX)$<:$$DOCKER_TAG \
-t $(DOCKER_PREFIX)$@:$(DOCKER_TAG) \
--build-arg BASE_IMAGE=$(DOCKER_PREFIX)$<:$(DOCKER_TAG) \
remote
$(MAKE) PUSH_IMAGES=$(PUSH_IMAGES) IMAGENAME=$@ .push
$(MAKE) PUSH_IMAGES=$(PUSH_IMAGES) DOCKER_TAG=$(DOCKER_TAG) IMAGENAME=$@ .push

eclipse/remote/pure-variants: DOCKER_TAG=$(ECLIPSE_VERSION)-$(PURE_VARIANTS_VERSION)-$(CAPELLA_DOCKERIMAGES_REVISION)
eclipse/remote/pure-variants: eclipse/remote
docker build $(DOCKER_BUILD_FLAGS) \
-t $(DOCKER_PREFIX)$@:$$DOCKER_TAG \
-t $(DOCKER_PREFIX)$@:$(DOCKER_TAG) \
--build-arg BASE_IMAGE=$(DOCKER_PREFIX)$<:$(ECLIPSE_VERSION)-$(CAPELLA_DOCKERIMAGES_REVISION) \
--build-arg PURE_VARIANTS_VERSION=$(PURE_VARIANTS_VERSION) \
pure-variants
$(MAKE) PUSH_IMAGES=$(PUSH_IMAGES) IMAGENAME=$@ .push
$(MAKE) PUSH_IMAGES=$(PUSH_IMAGES) DOCKER_TAG=$(DOCKER_TAG) IMAGENAME=$@ .push

t4c/client/base: SHELL=./capella_loop.sh
t4c/client/base: capella/base
Expand Down
3 changes: 2 additions & 1 deletion capella/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ ONBUILD USER root
# Install WebKit with GTK
ONBUILD COPY libs /tmp/libs
ONBUILD ARG INJECT_PACKAGES=false
# hadolint ignore=SC2046
ONBUILD RUN if [ "$INJECT_PACKAGES" = "true" ]; then \
apt-get update && \
# Inject old packages manually
find /tmp/libs -iname "*.deb" -exec apt-get install -y {} \; ; \
apt-get install -y $(find /tmp/libs -iname "*.deb"); \
rm -rf /var/lib/apt/lists/*; \
rm -r /tmp/libs; \
else \
Expand Down
4 changes: 4 additions & 0 deletions papyrus/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ ENV DEBIAN_FRONTEND=noninteractive
SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
ENV SHELL=/bin/bash

USER root

ARG PAPYRUS_VERSION
COPY ./versions/${PAPYRUS_VERSION}/papyrus.tar.gz /opt/

Expand All @@ -34,3 +36,5 @@ ENV ECLIPSE_INSTALLATION_PATH=/opt/Papyrus
ENV ECLIPSE_EXECUTABLE=/opt/Papyrus/papyrus

ENV BASE_TYPE=papyrus

USER techuser
4 changes: 3 additions & 1 deletion readonly/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@

set -exuo pipefail

salt=$(openssl rand -base64 16)
password_hash=$(openssl passwd -6 -salt ${salt} "${RMT_PASSWORD:?}")
line=$(grep techuser /etc/shadow);
echo ${line%%:*}:$(openssl passwd -6 -salt $(openssl rand -base64 16) "${RMT_PASSWORD:?}"):${line#*:*:} > /etc/shadow;
echo ${line%%:*}:${password_hash}:${line#*:*:} > /etc/shadow;
unset RMT_PASSWORD

# Prepare Workspace
Expand Down
4 changes: 3 additions & 1 deletion remote/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ set -exuo pipefail

if [ "$(whoami)" == "root" ] || [ "$(whoami)" == "techuser" ];
then
salt=$(openssl rand -base64 16)
password_hash=$(openssl passwd -6 -salt ${salt} "${RMT_PASSWORD:?}")
line=$(grep techuser /etc/shadow);
echo ${line%%:*}:$(openssl passwd -6 -salt $(openssl rand -base64 16) "${RMT_PASSWORD:?}"):${line#*:*:} > /etc/shadow;
echo ${line%%:*}:${password_hash}:${line#*:*:} > /etc/shadow;
else
echo "Only techuser and root are supported as users.";
exit 1;
Expand Down