Skip to content

Commit

Permalink
Add model generator package (#17)
Browse files Browse the repository at this point in the history
* Add model generator package
* Additional fixes
  * Unite separated pip installs in single layer
  * Update license checker version
  * Cleanup temporary files
  • Loading branch information
BjoernAtBosch authored Feb 17, 2023
1 parent 4d5cfd5 commit 4e3eb7f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-licenses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 10 additions & 4 deletions Dockerfiles/cpp/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -93,23 +93,29 @@ 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 && \
./install-velocitas-cli.sh ${TARGETARCH}
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
26 changes: 15 additions & 11 deletions Dockerfiles/python/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand All @@ -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
1 change: 1 addition & 0 deletions common/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
git+https://github.com/eclipse-velocitas/[email protected]

0 comments on commit 4e3eb7f

Please sign in to comment.