Skip to content

server: Add sdk dependency and build docker images from /server - #611

Open
hpoeche wants to merge 7 commits into
eclipse-basyx:developfrom
rwth-iat:improve/server-sdk-dependency
Open

hpoeche wants to merge 7 commits into
eclipse-basyx:developfrom
rwth-iat:improve/server-sdk-dependency

Conversation

@hpoeche

@hpoeche hpoeche commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

The server package uses the sdk extensively but never declared it as a dependency, and its Docker
builds required the repository root as build context, which is awkward for isolating the server
package in its own subpath.

  • Declare basyx-python-sdk as an explicit dependency of the server package, using the same
    commit-pinning workaround already applied to compliance_tool. This is only a temporary fix
    until proper cross-package dependency definitions are figured out in Adopt a proper cross-package dependency strategy for the monorepo (evaluate uv workspaces) #592, which should be
    considered next.
  • Change server Docker builds to use ./server as build context instead of the repository root,
    passing the sdk sources in via a separate named build context.
  • Update the GitHub Action, Dockerfiles, compose files, and README accordingly.

Fixes #459
Fixes #470

The sdk was not listed as dependency of the server package although
it is used in the server extensively. As we have for now no proper
cross-package dependency defninition strategy, we apply the same
workaround as with the compliance_tool. As the server is never
released as package to PyPI but only install in docker image builds,
this can be considered as appropiate temporary solution.
Previously the docker builds needed the repository root as build
context in order to copy the content of sdk and server directory.

In order to isolate the server package in its `/server` subpath,
the build now uses this directory as context. The sdk sources are
passed via an additional build context.
CI jobs, docker-compose.yml files and Readmes are adapted accordingly.
…-dependency

Also copy LICENSE to server directory in CI because this PR
restricts the build context to the `server` directory. As consequence
the build fails, when no LICENSE file is present in the server directory.
For local building a copy instruction was added to the `server/README.md`.
@hpoeche

hpoeche commented Sep 18, 2026

Copy link
Copy Markdown
Contributor Author

I had to adapt the CI to copy the LICENSE file to the server directory before docker build, so the file is inside the build context.

Previously, the example configuration READMEs still stated that the
build context must be the repository root, `CONTRIBUTING.md` showed
an outdated `docker build` command, and the Docker Hub link in the
server `README.md` pointed to the old `basyx-python-server` image.

This change updates them to match the build introduced in this branch:
images are built from the `server` directory with the `sdk` directory
passed in as a named build context. The registry README also pointed
to the repository Dockerfile, which is corrected as well.
Comment thread server/docker/discovery/Dockerfile Outdated

COPY --from=sdk . /sdk
COPY ./app /server/app
COPY ./LICENSE /LICENSE

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The LICENSE file only exists in ./LICENSE when the CI is ran, correct?
Wouldn't this mean this fails when trying to build the images on a local machine, for example with the compose.yaml files?

Comment thread server/pyproject.toml
]
readme = "README.md"
license = "MIT"
license-files = ["LICENSE"]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Wouldn't this expect /server/LICENSE? The CI copy action puts the file at /LICENSE.

In the first version of these changes the `LICENSE` file from the
repository root was copied in a CI step to the `/server` directory
to include it into the Docker image builds. This lead to failing
local builds on dev machines.

To fix this the builds of all three server profiles now depend on
a second additional build context `license`, which must hold the
`LICENSE` file. Because Docker only allows directorie to be passed
as additional build contexts, the `license` context is set to the
repository root.
These changes are documented in the contribution guide and all
`README`s of the server's example configurations.
@hpoeche

hpoeche commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

I changed include of the LICENSE file such that it now is passed via an additional build context license. Because Docker only allows directorie to be passed as additional build contexts, the license context is set to the repository root.
Although, one could argue that it is unnecessary complexity to pass .. and ../sdk as individual contexts, I promote this approach, because it makes the dependency of the server onto the sdk explicit and allows devs to dynamically include an alternative version of the sdk from another part on their disk.
If you do not agree with me here @s-heppner, I am open for suggestions.

@hpoeche
hpoeche requested a review from s-heppner September 22, 2026 17:01
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.

server: Docker expects to be run from the repository root Introduce SDK as dependency for server

2 participants