From 4e3eb7f29e44182b89780e43dafc553e055e81ca Mon Sep 17 00:00:00 2001 From: BjoernAtBosch Date: Fri, 17 Feb 2023 12:22:24 +0100 Subject: [PATCH] Add model generator package (#17) * Add model generator package * Additional fixes * Unite separated pip installs in single layer * Update license checker version * Cleanup temporary files --- .github/workflows/check-licenses.yml | 2 +- Dockerfiles/cpp/.devcontainer/Dockerfile | 14 +++++++---- Dockerfiles/python/.devcontainer/Dockerfile | 26 ++++++++++++--------- common/requirements.txt | 1 + 4 files changed, 27 insertions(+), 16 deletions(-) create mode 100644 common/requirements.txt diff --git a/.github/workflows/check-licenses.yml b/.github/workflows/check-licenses.yml index a4dc909..1e8fbd3 100644 --- a/.github/workflows/check-licenses.yml +++ b/.github/workflows/check-licenses.yml @@ -33,7 +33,7 @@ jobs: uses: actions/checkout@v3 with: repository: eclipse-velocitas/license-check - ref: v1.2.0 + ref: v1.2.1 path: .github/actions/license-check - name: Run License Checker diff --git a/Dockerfiles/cpp/.devcontainer/Dockerfile b/Dockerfiles/cpp/.devcontainer/Dockerfile index 9bbd748..3dd8da3 100644 --- a/Dockerfiles/cpp/.devcontainer/Dockerfile +++ b/Dockerfiles/cpp/.devcontainer/Dockerfile @@ -93,10 +93,10 @@ RUN groupadd --gid $USER_GID $USERNAME \ && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ && chmod 0440 /etc/sudoers.d/$USERNAME -COPY ./common /scripts +WORKDIR /tmp/setup +COPY ./common . ARG TARGETARCH -WORKDIR /scripts RUN ./install-python.sh && \ ./install-dapr-cli.sh && \ ./install-k3d-prerequisites.sh && \ @@ -104,12 +104,18 @@ RUN ./install-python.sh && \ USER 4000 RUN ./install-k3d-tooling.sh -ADD --chown=4000 https://raw.githubusercontent.com/eclipse-velocitas/vehicle-app-cpp-sdk/main/requirements.txt /container/requirements.txt +ADD --chown=4000 https://raw.githubusercontent.com/eclipse-velocitas/vehicle-app-cpp-sdk/main/requirements.txt ./requirements/requirements.txt + # Install Python requirements as vscode user and clean up -RUN pip3 install -r /container/requirements.txt +RUN pip3 install -r ./requirements/requirements.txt && \ + pip3 install -r ./requirements.txt # We need to set the USER back to root at the end, otherwise we get errors when using this in our repo. USER root +WORKDIR / + +# Cleanup temporary files +RUN rm -rf /tmp/setup # Obtain pre-build dependencies COPY --chown=4000 --from=builder /conan/.conan /home/vscode/.conan diff --git a/Dockerfiles/python/.devcontainer/Dockerfile b/Dockerfiles/python/.devcontainer/Dockerfile index 45f7dd1..6482eee 100644 --- a/Dockerfiles/python/.devcontainer/Dockerfile +++ b/Dockerfiles/python/.devcontainer/Dockerfile @@ -36,10 +36,10 @@ RUN groupadd --gid $USER_GID $USERNAME \ && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ && chmod 0440 /etc/sudoers.d/$USERNAME -COPY ./common /scripts +WORKDIR /tmp/setup +COPY ./common . ARG TARGETARCH -WORKDIR /scripts RUN ./install-python.sh && \ ./install-dapr-cli.sh && \ ./install-k3d-prerequisites.sh && \ @@ -48,17 +48,21 @@ USER 4000 RUN ./install-k3d-tooling.sh # Fetch requirements into requirements folder -ADD --chown=4000 https://raw.githubusercontent.com/eclipse-velocitas/vehicle-app-python-template/main/requirements-dev.txt /requirements/ -ADD --chown=4000 https://raw.githubusercontent.com/eclipse-velocitas/vehicle-app-python-template/main/app/requirements-links.txt /requirements/ -ADD --chown=4000 https://raw.githubusercontent.com/eclipse-velocitas/vehicle-app-python-template/main/app/requirements-app.txt /requirements/ -ADD --chown=4000 https://raw.githubusercontent.com/eclipse-velocitas/vehicle-app-python-template/main/app/tests/requirements-tests.txt /requirements/ +ADD --chown=4000 https://raw.githubusercontent.com/eclipse-velocitas/vehicle-app-python-template/main/requirements-dev.txt ./requirements/ +ADD --chown=4000 https://raw.githubusercontent.com/eclipse-velocitas/vehicle-app-python-template/main/app/requirements-links.txt ./requirements/ +ADD --chown=4000 https://raw.githubusercontent.com/eclipse-velocitas/vehicle-app-python-template/main/app/requirements-app.txt ./requirements/ +ADD --chown=4000 https://raw.githubusercontent.com/eclipse-velocitas/vehicle-app-python-template/main/app/tests/requirements-tests.txt ./requirements/ -WORKDIR /requirements # Always install requirements under vscode user to avoid issue with installation of packages -RUN pip3 install -r requirements-dev.txt -RUN pip3 install -r requirements-links.txt -RUN pip3 install -r requirements-app.txt -RUN pip3 install -r requirements-tests.txt +RUN pip3 install -r ./requirements/requirements-dev.txt && \ + pip3 install -r ./requirements/requirements-links.txt && \ + pip3 install -r ./requirements/requirements-app.txt && \ + pip3 install -r ./requirements/requirements-tests.txt && \ + pip3 install -r ./requirements.txt + # Keep root as last user USER root WORKDIR / + +# Cleanup temporary files +RUN rm -rf /tmp/setup diff --git a/common/requirements.txt b/common/requirements.txt new file mode 100644 index 0000000..4734bbb --- /dev/null +++ b/common/requirements.txt @@ -0,0 +1 @@ +git+https://github.com/eclipse-velocitas/vehicle-model-generator.git@v0.3.0