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

Remove domain model dependency from the compilation step and add it at deployment time #10

Closed
8 tasks done
scp93ch opened this issue Apr 5, 2023 · 6 comments · Fixed by #25
Closed
8 tasks done
Assignees

Comments

@scp93ch
Copy link
Member

scp93ch commented Apr 5, 2023

We are currently part way through a process of changing the way domain models are handled. The knowledgebase manager page is able to upload a new (additional) domain model zip bundle including icon files, but at compile time we still have a dependency on a domain model and the previous loading mechanism is used.

  • remove the compile-time domain model dependency
  • ensure that the dashboard and knowledgebase manager pages work if there is no domain model loaded
  • display a warning in the dashboard if no domain model is loaded, along with a link to the knowledgebase manager page
  • at first boot time make the system-modeller service look for domain model zip bundles (i.e. *.zip) in a specific filesystem location and load them all in; the filesystem location should be configured in application.properties so that it can be overridden with an environment variable as necessary
  • ensure that domain models (including icons, etc) loaded by the new method (whether at boot or runtime) are located in persistent volumes
  • remove the old domain model update and download options from the knowledgebase manager
  • provide an example bind-mount in the docker-compose file
  • document the boot-time domain model import mechanism
@scp93ch
Copy link
Member Author

scp93ch commented Apr 5, 2023

Regarding the point on "remove the old domain model update and download options from the knowledgebase manager", the current knowledgebase manager page has the following:

image

The "Download ontologies.json" link needs removing as the list of domain models is now dynamic. The "Download" and "Upload new version" buttons against a specific domain model just deal with the NQ file and should probably be removed as I can't see why someone would want to do that now. If there is a new version of a domain model then it may well have new icons so just downloading/uploading the NQ isn't going to help. I guess there's a possibility that a domain model developer might want to just change the NQ. If @mike1813 thinks they are useful then let's hide those buttons unless you're in the developer mode (and also clarify that they are just about the NQ).

@mike1813
Copy link
Member

As far as I can see:

  • Delete button: will still be needed if we want the ability to delete a previously deployed domain model.
  • Access List button: will still be needed if we want the ability to restrict access to specific domain models. Whether that should be the case is a separate discussion. For now we should keep the button.
  • Upload new version: is not needed, as we can use the new mechanism to upload a replacement domain model ZIP bundle.
  • Download button: is sometimes useful if there is some uncertainty about which version of a domain model is loaded.

I have used the Download button occasionally to get the (gzipped) deployed NQ file so I can do a text comparison to check if it is the version it claims to be. The reason this was necessary is because the domain model owl#versionInfo property was inserted by hand, so it was possible through human error for two different versions to have the same owl#versionInfo.

In future, that motive for retaining a Download button will go away, as the domain model owl#versionInfo will be controlled by the CI pipeline, so human error will no longer be a factor. The only reasons for keeping this button now are:

  • because we are still working with old domain models that might be affected by previous human errors or
  • because we want people to be able to download the domain model they are using from system modeller

The first reason to keep the button is not a good one. In principle, we should only be using old models from the archive on the IT Innovation security project internal SharePoint, without alteration. If we need to change any of these models, we should add more 'live development' branches to the GitHub domain model project and tag the updates so the version info is automated. E.g. if we needed an update of the old v5e2-7-39, we would create a dev branch '5e', commit the v5e2-7-39 fileset, and go from there.

The second reason is also not a good one. We should be directing people to get domain model versions from the GitHub domain model project. But this page is restricted to service administrators, so most of those people can't see it.

On that basis, I would remove the 'Upload' and 'Download' button from this page, so we only have the 'Delete' button and (at least for now) the 'Access List' button.

@mike1813
Copy link
Member

Instead of the 'Download' button, we could provide a link allowing users (not service administrators) to get a domain model. This should be added to the Dashboard or system model Properties, probably as a link under the domain model version info. This link could either:

  • take users directly to the right URL to get the domain model bundle from the relevant repository, or
  • open a pop-up displaying a Git command to pull the domain model source files from GitHub

The domain model owl#versionInfo is inserted by csv2nq based on a tag in the domain model GitHub repository, but it isn't just the tag value - some extra strings may be included by csv2nq based on the command line options used. On that basis, it probably makes sense if csv2nq inserts a new property something like 'core#getDomainModel`, removing the need for system modeller to figure that out based on the version info.

I recommend that @scp93ch should review this suggestion and create new issues if this new 'user accessible KB download' option is something we should pursue. This depends on whether csv2nq could know the link or git command needed at the point when a CI pipeline is executed. I don't know enough about the CI pipeline to comment on that.

kenmeacham added a commit that referenced this issue Apr 19, 2023
kenmeacham added a commit that referenced this issue Apr 19, 2023
…ontroller, and corresponding unit test. TODO: remove "download ontologies.json" link from UI that calls this.
kenmeacham added a commit that referenced this issue Apr 19, 2023
…json. N.B. this should probably be deleted eventually, but similar functionality might be required for loading domain models from .zip bundles at deploy time
kenmeacham added a commit that referenced this issue Apr 19, 2023
…empting to load the ontologies.json file. These should either be reworked or deleted if no longer required.
@kenmeacham
Copy link
Contributor

I've removed the dependency on domain-network artifact. Also gone further to remove ontologies.json and the main asset icons that were in the source tree (except fallback.svg). Functionality to download or update ontologies.json has also been removed.

@kenmeacham
Copy link
Contributor

kenmeacham commented Apr 20, 2023

Regarding 'the following:

ensure that the dashboard and knowledgebase manager pages work if there is no domain model loaded

I've checked that the pages basically work without error. The knowledgebase manager displays nothing except the "Upload new knowledgebase", as you would expect. In the dashboard, you cannot currently create a new model when there is no domain model available (the "Create New Model" button is disabled").

TODO: add some kind of warning that there is no domain model loaded, etc

kenmeacham added a commit that referenced this issue Apr 24, 2023
kenmeacham added a commit that referenced this issue Apr 24, 2023
…ata" folder for domain bundles at start-up (when resetOnStart is true, etc). All located zipfiles are then extracted and imported to SSM.
kenmeacham added a commit that referenced this issue Apr 27, 2023
…ed to (now removed) ontologies.json file. TODO: further work on PaletteGenerator to get info from domain zip bundle instead.
kenmeacham added a commit that referenced this issue May 3, 2023
kenmeacham added a commit that referenced this issue May 3, 2023
…o persisted kbInstallFolder, rather than /static/data and /static/images
kenmeacham added a commit that referenced this issue May 3, 2023
…er than /static/data. Create new getImage REST method to get an image stored in kbInstallFolder (icons folder).
kenmeacham added a commit that referenced this issue May 3, 2023
…lder. Remove tmp files after extraction, including uploaded zipfile. Some tidying up.
kenmeacham added a commit that referenced this issue May 5, 2023
…lette generation and checking of domain models and palettes on start-up.
kenmeacham added a commit that referenced this issue May 5, 2023
kenmeacham added a commit that referenced this issue May 5, 2023
kenmeacham added a commit that referenced this issue May 9, 2023
…onger required since removing the domain-network dependency. Update related docs.
kenmeacham added a commit that referenced this issue May 12, 2023
…vailable. Tailor message depending on whether SSM is being run in test/dev or production mode.
kenmeacham added a commit that referenced this issue May 17, 2023
…mport is deterministic. Warn user in the case of multiple zipfiles for the same domain URI
kenmeacham added a commit that referenced this issue May 17, 2023
kenmeacham added a commit that referenced this issue May 22, 2023
kenmeacham added a commit that referenced this issue May 24, 2023
…sistence of data, and how to re-install knowledgebases
kenmeacham added a commit that referenced this issue May 26, 2023
…ntroller. TODO: if we are sure that this feature is no longer required, we should remove the functionality in uploadNewDomainVersion.
kenmeacham added a commit that referenced this issue May 26, 2023
…check that it doesn't already exist. If updating an existing one, check that user is uploading a kb with the correct graph URI.
@kenmeacham
Copy link
Contributor

This isssue is now ready to be reviewed, so I'll submit a pull request shortly..

The new functionality for installing default knowledgebase(s) should be tested. I have made fixes to the README file which hopefully explain the process. The domain-network dependency is now removed, so configuration related to that has also been removed. The ontologies.json file no longer exists, and all support for upload/download of this has been removed, along with the original static images.

Regarding the old domain model update mechanism, I have removed support for uploading a domain model .nq or .rdf file. There was a misconception that update of the knowledgebase did not support .zip bundles, however this has been working for some time.

I have improved the checking of uploaded zip bundles as follows:

  1. "Upload new knowledgebase" now checks that the knowledgebase does not already exist, otherwise it throws an error
  2. "Upload new version" ensures that the uploaded knowledgebase graph URI matches that requested in the submission

@kenmeacham kenmeacham linked a pull request May 26, 2023 that will close this issue
kenmeacham added a commit that referenced this issue May 30, 2023
…r for deployed data. Don't check domain models and palettes for unit tests, during start-up.
kenmeacham added a commit that referenced this issue Jun 8, 2023
kenmeacham added a commit that referenced this issue Jun 9, 2023
kenmeacham added a commit that referenced this issue Jun 9, 2023
kenmeacham added a commit that referenced this issue Jun 9, 2023
kenmeacham added a commit that referenced this issue Jun 9, 2023
…=true, prior to (re)installing domain zipfiles
kenmeacham added a commit that referenced this issue Jun 12, 2023
kenmeacham added a commit that referenced this issue Jun 12, 2023
…lable, then redirect to KB Manager page (admin only)
kenmeacham added a commit that referenced this issue Jun 13, 2023
@kenmeacham kenmeacham added this to the Release version 3.5.0 milestone Apr 18, 2024
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 a pull request may close this issue.

3 participants