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

Replace/suppress packages on matchbox-server #320

Open
mahieuecd opened this issue Dec 12, 2024 · 6 comments
Open

Replace/suppress packages on matchbox-server #320

mahieuecd opened this issue Dec 12, 2024 · 6 comments

Comments

@mahieuecd
Copy link

Hello,

The APHP (Assistance Publique Hôpitaux de Paris) data teams are using matchbox project through its engine part to develop a tool that can perform a validation and transformation step on top of the FHIR Mapping Langage file as a Visual Studio Code extension.

One of the remaining challenges for us is to completely manage the packages installed on the matchbox-server using API requests.

Our problem is to replace or suppress a package loaded on the matchbox-server using the API request without the need of changing the package version or completely kill and recreate the server as the server seems to keep a package and its version in memory.

Is it something you already know, working on or maybe developed a solution for?

Thank you

@qligier
Copy link
Member

qligier commented Dec 13, 2024

Hi!

So you are trying to update a package installed on Matchbox with a new NPM content, but the same version (e.g. for a dev/ci-build version)?

To accomplish that, you could:

  1. Uninstall the ImplementationGuide from the database by using the REST API: DELETE /fhir/ImplementationGuide/id
  2. Reinstall it in the database by providing the content of the NPM package to the $install-npm-package operation: POST /fhir/$install-npm-package (see https://ahdis.github.io/matchbox/matchbox-server/#install-npm-package)

We could probably improve Matchbox to support updating the package if it already exists in the $install-npm-package operation.

Then, you need to reload the IG in the engine. The way to do it depends on your Matchbox version, and your configuration (especially the httpReadOnly and onlyOneEngine flags).

I recently wrote a bit of documentation about the handling of packages in Matchbox (e.g. the difference between installing a package in the server, vs loading a package in the engine): https://ahdis.github.io/matchbox/packages/

@mahieuecd
Copy link
Author

mahieuecd commented Dec 18, 2024

Thank you for your reply,

We tried to supress a package using the DELETE request, but the response changes depending on how the POST request to install it went :

  • if the package is successfully installed, the DELETE request works normally and delete the corresponding package.
  • if the package failled to install because of missing dependencies, the package seems to exist on the matchbox server but is impossible to DELETE (and a POST with same name and version is not possible either).

Here are few screenshots that may help to describe the second situation

1/ Loading a package without a dependencie failled :

1_load_package_without_dependencies

2/ But the package exists now on the server :

2_package_install

3/ We tried to delete the package using DELETE request, answer is 204 :

3_try_delete_package

4/ But the package persists on the server :

4_Package_still_install

5/ We tried to delete the package via web page :

5_try_delete_from_page

6/ But the package persists on the server :

6_still_here_with_delete

@qligier
Copy link
Member

qligier commented Dec 18, 2024

Thanks for the screenshots, I'll need to debug that.

@qligier
Copy link
Member

qligier commented Dec 18, 2024

I could not reproduce this issue. I tried installing an IG through the $install-npm-package operation, with an unknown dependency. I could see that the IG was installed, despite the 404 error in response.
I could then uninstall it as expected through the GUI (and it disappeared from the list.

Can you share more details about your instance of Matchbox? Can I access the package you're trying to install?

@mahieuecd
Copy link
Author

We manage to install/uninstall different packages but the package that is not correctly installing requires dependencies that are only built on a private repository. Therefore, we believe that dependencies referencing unpublished IGs may be the source of the issue.

Can Matchbox-server access a private registry to install dependencies of dependencies ?

Unfortunatly, we are not able to share resources yet due to sensitive information.

@oliveregger
Copy link
Member

can you access the registry through http calls or file based access? if yes, then it should be possible. you should also be able to provide proxy settings. you would need to install trough the API the dependent packages first.

I don't think you can out of the box specify another package server, but that could be for sure added.

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

No branches or pull requests

3 participants