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

http.py: fix redirect and sdk intallation #362

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

Frosty2500
Copy link
Contributor

@Frosty2500 Frosty2500 commented Dec 30, 2024

Fixes the redirect from the AAS repository paths to the submodel repository paths.
Also installs the sdk locally instead of over git so changes immediately affect the server and not only after a Pull Request is merged.
Fixes #315

@Frosty2500 Frosty2500 changed the title http.py: fix redirect http.py: fix redirect and sdk intallation Dec 30, 2024
COPY ./app /app
ENV SETUPTOOLS_SCM_PRETEND_VERSION=1.0.0

COPY . /all
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Afaik, it is considered bad style to copy more stuff into the container, than you absolutely need (as it introduces security risks, as well as simply makes it larger).

If we keep it this way, I argue we should only copy the sdk folder, however maybe there's a better solution? Let's discuss in our next meeting!

@@ -15,7 +15,7 @@ See [below](#options) on how to configure this.
## Building
The container image can be built via:
```
$ docker buildx build -t basyx-python-sdk-http-server .
$ docker build -t basyx-python-server -f Dockerfile ..
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the -f Dockerfile option should be not needed, but we should mention above that the user needs to be in the server directory of the repository.

WORKDIR /app
RUN pip install ../all/sdk[dev]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the server it should (by definition) be enough to install the SDK without the [dev] dependencies, as it's an application using the SDK not a developer. Otherwise we defined the dependencies wrong.

Comment on lines +74 to +75
context: ..
dockerfile: server/Dockerfile
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems a bit duplicated:

  • We are in /server
  • We move the context one directroy up
  • We specify the /server/Dockerfile.

If I'm not mistaken, the build: . option should still work

@@ -1,6 +1,8 @@
services:
app:
build: .
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants